From 2ce90ea296eec5a16148fc8c7e2054ded60e1d32 Mon Sep 17 00:00:00 2001 From: Osier Yang Date: Wed, 17 Aug 2011 20:58:33 +0800 Subject: [PATCH] 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. --- src/qemu/qemu_hotplug.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 5f449fb4c0..b7fdfa04bb 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -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); }