From: Stefan Berger Date: Wed, 3 Nov 2010 11:26:29 +0000 (-0400) Subject: macvtap: libvirtd forgot macvtap dev name when restarted X-Git-Tag: v0.8.6~175 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c4bd44d927b5e9af6b25e0d35b37a0f6b30fa578;p=thirdparty%2Flibvirt.git 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 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. --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index fe937117f8..cdfb890f43 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -2343,7 +2343,8 @@ virDomainNetDefParseXML(virCapsPtr caps, def->data.direct.linkdev = dev; dev = NULL; - VIR_FREE(ifname); + if ((flags & VIR_DOMAIN_XML_INACTIVE)) + VIR_FREE(ifname); break;