qemu: Init reattaching related members of pciDevice before reattach

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.
This commit is contained in:
Osier Yang 2011-08-17 20:58:33 +08:00
parent cfbccb3821
commit 2ce90ea296

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