]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Init reattaching related members of pciDevice before reattach
authorOsier Yang <jyang@redhat.com>
Wed, 17 Aug 2011 12:58:33 +0000 (20:58 +0800)
committerOsier Yang <jyang@redhat.com>
Wed, 17 Aug 2011 12:58:33 +0000 (20:58 +0800)
Otherwise the device will still be bound to pci-stub driver even
it's set as "managed=yes" when do detaching. Of course, it won't
triger any driver reprobing too.

src/qemu/qemu_hotplug.c

index 5f449fb4c02777340fd68b2d45eebb5e39f2f77b..b7fdfa04bb841e77db105188b3f5c30b1a639a58 100644 (file)
@@ -1761,6 +1761,7 @@ int qemuDomainDetachHostPciDevice(struct qemud_driver *driver,
         pciDeviceListDel(driver->activePciHostdevs, pci);
         if (pciResetDevice(pci, driver->activePciHostdevs, NULL) < 0)
             ret = -1;
+        pciDeviceReAttachInit(pci);
         qemuReattachPciDevice(pci, driver);
         pciFreeDevice(pci);
     }