[libvirt] [PATCH] qemu: fix cleanup of bridge during failure of qemuDomainAttachNetDevice

From: Laine Stump <laine@redhat.com> 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 | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index e90ea6c..375b822 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -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); } -- 1.7.7.6

On 02/25/2012 04:40 PM, Laine Stump wrote:
From: Laine Stump <laine@redhat.com>
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 | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-)
ACK - looks like the patch was just the addition of {} followed by reindentation. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 02/27/2012 01:15 PM, Eric Blake wrote:
On 02/25/2012 04:40 PM, Laine Stump wrote:
From: Laine Stump <laine@redhat.com>
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 | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) ACK - looks like the patch was just the addition of {} followed by reindentation.
Correct - just moved the next stanza into the if. Pushed, thanks!
participants (2)
-
Eric Blake
-
Laine Stump