]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Move freeing of PCI address list to qemuProcessStop
authorPeter Krempa <pkrempa@redhat.com>
Wed, 26 Apr 2017 08:27:49 +0000 (10:27 +0200)
committerCole Robinson <crobinso@redhat.com>
Wed, 10 May 2017 22:02:39 +0000 (18:02 -0400)
Rather than freeing the list before starting a new VM clear it after
stopping the old instance when the data becomes invalid.

(cherry picked from commit 44f8e00b6b8e575ee09f301d209c1586b527f8c1)

src/qemu/qemu_domain_address.c
src/qemu/qemu_process.c

index 22d8bf67d93302efe7497d3ad5d7d9ec14f88515..f2f9381c61e2af90386ecb5bd5542823ecf7348a 100644 (file)
@@ -2221,7 +2221,6 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def,
     if (obj && obj->privateData) {
         priv = obj->privateData;
         /* if this is the live domain object, we persist the PCI addresses */
-        virDomainPCIAddressSetFree(priv->pciaddrs);
         priv->pciaddrs = addrs;
         addrs = NULL;
     }
index a6ecda3976adde20d25f0a1663046e070b82ff14..961afd70a9ad0b11a8f9924085962565926dcad1 100644 (file)
@@ -6438,6 +6438,8 @@ void qemuProcessStop(virQEMUDriverPtr driver,
     priv->autoCpuset = NULL;
 
     /* remove address data */
+    virDomainPCIAddressSetFree(priv->pciaddrs);
+    priv->pciaddrs = NULL;
     virDomainUSBAddressSetFree(priv->usbaddrs);
     priv->usbaddrs = NULL;