qemu: Move freeing of PCI address list to qemuProcessStop

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 44f8e00b6b)
This commit is contained in:
Peter Krempa 2017-04-26 10:27:49 +02:00 committed by Cole Robinson
parent b4b8804978
commit a050815a26
2 changed files with 2 additions and 1 deletions

View 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;
}

View 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;