提交 82e8dd4c 编写于 作者: C Chunyan Liu 提交者: Daniel P. Berrange

Conditionally wait for kvm_assigned_device cleanup

Only wait for kvm device cleanup if the driver is pci-stub
上级 4e46107e
......@@ -1256,8 +1256,6 @@ qemuPrepareHostDevices(virQEMUDriverPtr driver,
static void
qemuReattachPciDevice(virPCIDevicePtr dev, virHostdevManagerPtr mgr)
{
int retries = 100;
/* If the device is not managed and was attached to guest
* successfully, it must have been inactive.
*/
......@@ -1267,10 +1265,14 @@ qemuReattachPciDevice(virPCIDevicePtr dev, virHostdevManagerPtr mgr)
return;
}
while (virPCIDeviceWaitForCleanup(dev, "kvm_assigned_device")
&& retries) {
usleep(100*1000);
retries--;
/* Wait for device cleanup if it is qemu/kvm */
if (STREQ(virPCIDeviceGetStubDriver(dev), "pci-stub")) {
int retries = 100;
while (virPCIDeviceWaitForCleanup(dev, "kvm_assigned_device")
&& retries) {
usleep(100*1000);
retries--;
}
}
if (virPCIDeviceReattach(dev, mgr->activePciHostdevs,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册