]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: fix crash when removing <filterref> from interface with update-device
authorLaine Stump <laine@laine.org>
Thu, 1 May 2014 08:40:41 +0000 (11:40 +0300)
committerLaine Stump <laine@laine.org>
Thu, 1 May 2014 13:15:00 +0000 (16:15 +0300)
If a domain network interface that contains a <filterref> is modified
"live" using "virsh update-device --live", libvirtd would crash. This
was because the code supporting live update of an interface's
filterref was assuming that a filterref might be added or modified,
but didn't account for removing the filterref, resulting in a null
dereference of the filter name.

Introduced with commit 258fb278, which was first in libvirt v1.0.1.

This addresses https://bugzilla.redhat.com/show_bug.cgi?id=1093301

(cherry picked from commit 0eac9d1e90fc3388030c6109aeb1f4860f108054)

src/qemu/qemu_hotplug.c

index dfcbd111c39d7b3bb2129b6f8ee266702edd127b..ccb73b5a77e85ed231c1d91eab32c115ccfd0112 100644 (file)
@@ -1408,7 +1408,8 @@ qemuDomainChangeNetFilter(virConnectPtr conn,
 
     virDomainConfNWFilterTeardown(olddev);
 
-    if (virDomainConfNWFilterInstantiate(conn, vm->def->uuid, newdev) < 0) {
+    if (newdev->filter &&
+        virDomainConfNWFilterInstantiate(conn, vm->def->uuid, newdev) < 0) {
         virErrorPtr errobj;
 
         virReportError(VIR_ERR_OPERATION_FAILED,