]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Fix PCI address handling when controllers are deleted
authorWolfgang Mauerer <wolfgang.mauerer@siemens.com>
Tue, 2 Mar 2010 08:28:26 +0000 (09:28 +0100)
committerDaniel Veillard <veillard@redhat.com>
Tue, 2 Mar 2010 08:28:26 +0000 (09:28 +0100)
* 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

index 5394ff59d9d59528b1dd2ea0c9c456f02abffbda..8960ef8925ee06336ae5cf835c3265fe52230d98 100644 (file)
@@ -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;