From 55946f23a6229785b32a8832a5c16780411e3551 Mon Sep 17 00:00:00 2001 From: Wolfgang Mauerer Date: Tue, 2 Mar 2010 09:28:26 +0100 Subject: [PATCH] Fix PCI address handling when controllers are deleted * src/qemu/qemu_driver.c: in qemudDomainDetachPciControllerDevice() when a controller is not present in the system anymore, the PCI address must be deleted from libvirt's hashtable because it can be re-used for other purposes. --- src/qemu/qemu_driver.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 5394ff59d9..8960ef8925 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -6280,6 +6280,11 @@ static int qemudDomainDetachPciControllerDevice(struct qemud_driver *driver, VIR_FREE(vm->def->controllers); vm->def->ncontrollers = 0; } + + if (qemuDomainPCIAddressReleaseAddr(priv->pciaddrs, &detach->info) < 0) { + VIR_WARN0("Unable to release PCI address on controller"); + } + virDomainControllerDefFree(detach); ret = 0;