Rather than freeing the list before starting a new VM clear it after
stopping the old instance when the data becomes invalid.
---
src/qemu/qemu_domain_address.c | 1 -
src/qemu/qemu_process.c | 2 ++
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
index 064d05079..203a367ac 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -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;
}
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index d3266e778..3a18c96ca 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -6442,6 +6442,8 @@ void qemuProcessStop(virQEMUDriverPtr driver,
priv->autoCpuset = NULL;
/* remove address data */
+ virDomainPCIAddressSetFree(priv->pciaddrs);
+ priv->pciaddrs = NULL;
virDomainUSBAddressSetFree(priv->usbaddrs);
priv->usbaddrs = NULL;
--
2.12.2