]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: fix cleanup of bridge during failure of qemuDomainAttachNetDevice
authorLaine Stump <laine@laine.org>
Tue, 28 Feb 2012 03:43:23 +0000 (22:43 -0500)
committerLaine Stump <laine@laine.org>
Tue, 28 Feb 2012 03:44:22 +0000 (22:44 -0500)
In qemuDomainAttachNetDevice, the guest's tap interface has only been
attached to the bridge if iface_connected is true. It's possible for
an error to occur prior to that happening, and previously we would
attempt to remove the tap interface from the bridge even if it hadn't
been attached.

src/qemu/qemu_hotplug.c

index 3dd7c0a9b90c88e125dab8266f486a9aee18c36d..ef8ec86a316c3252408a7732d6ab5ae43bc3729c 100644 (file)
@@ -837,13 +837,14 @@ cleanup:
                                             net->info.addr.pci.slot) < 0)
             VIR_WARN("Unable to release PCI address on NIC");
 
-        if (iface_connected)
+        if (iface_connected) {
             virDomainConfNWFilterTeardown(net);
 
-        vport = virDomainNetGetActualVirtPortProfile(net);
-        if (vport && vport->virtPortType == VIR_NETDEV_VPORT_PROFILE_OPENVSWITCH)
-            ignore_value(virNetDevOpenvswitchRemovePort(
-                            virDomainNetGetActualBridgeName(net), net->ifname));
+            vport = virDomainNetGetActualVirtPortProfile(net);
+            if (vport && vport->virtPortType == VIR_NETDEV_VPORT_PROFILE_OPENVSWITCH)
+               ignore_value(virNetDevOpenvswitchRemovePort(
+                               virDomainNetGetActualBridgeName(net), net->ifname));
+        }
 
         networkReleaseActualDevice(net);
     }