mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
macvtap: libvirtd forgot macvtap dev name when restarted
During a shutdown/restart cycle libvirtd forgot the macvtap device name that it had created on behalf of a VM so that a stale macvtap device remained on the host when the VM terminated. Libvirtd has to actively tear down a macvtap device and it uses its name for identifying which device to tear down. The solution is to not blank out the <target dev='...'/> completely, but only blank it out on VMs that are not active. So, if a VM is active, the device name makes it into the XML and is also being parsed. If a VM is not active, the device name is discarded.
This commit is contained in:
parent
d9c75c8d37
commit
c4bd44d927
@ -2343,6 +2343,7 @@ virDomainNetDefParseXML(virCapsPtr caps,
|
|||||||
def->data.direct.linkdev = dev;
|
def->data.direct.linkdev = dev;
|
||||||
dev = NULL;
|
dev = NULL;
|
||||||
|
|
||||||
|
if ((flags & VIR_DOMAIN_XML_INACTIVE))
|
||||||
VIR_FREE(ifname);
|
VIR_FREE(ifname);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user