When you have multiple networks that share the same vlan_id + nic_tag and you have a VM allocated on one of them that's found by a heartbeat request (ie, not created before the heartbeat comes in, for any of various reasons, including a VM that's been moved by vmadm send), currently you just get an error saying the NIC is invalid.
However, the code for this can happily check through the list of networks that match the vlan_id + nic_tag for one that contains the address on the NIC, and use that if one is found. This patch adds this functionality.
If we don't find one, then we return a new error that's a bit more specific than the previous one (no networks contained the ip/netmask).
When you have multiple networks that share the same vlan_id + nic_tag and you have a VM allocated on one of them that's found by a heartbeat request (ie, not created before the heartbeat comes in, for any of various reasons, including a VM that's been moved by vmadm send), currently you just get an error saying the NIC is invalid.
However, the code for this can happily check through the list of networks that match the vlan_id + nic_tag for one that contains the address on the NIC, and use that if one is found. This patch adds this functionality.
If we don't find one, then we return a new error that's a bit more specific than the previous one (no networks contained the ip/netmask).