提交 e926df60 编写于 作者: A Andrea Bolognani

hostdev: Only rollback detach of managed devices on error

Since we don't detach unmanaged devices before attaching them to a
domain, we shouldn't reattach them to rollback an error either.
上级 b8a625f3
......@@ -711,12 +711,14 @@ virHostdevPreparePCIDevices(virHostdevManagerPtr hostdev_mgr,
for (i = 0; i < virPCIDeviceListCount(pcidevs); i++) {
virPCIDevicePtr dev = virPCIDeviceListGet(pcidevs, i);
/* NB: This doesn't actually re-bind to original driver, just
* unbinds from the stub driver
*/
ignore_value(virPCIDeviceReattach(dev,
hostdev_mgr->activePCIHostdevs,
hostdev_mgr->inactivePCIHostdevs));
if (virPCIDeviceGetManaged(dev)) {
/* NB: This doesn't actually re-bind to original driver, just
* unbinds from the stub driver
*/
ignore_value(virPCIDeviceReattach(dev,
hostdev_mgr->activePCIHostdevs,
hostdev_mgr->inactivePCIHostdevs));
}
}
cleanup:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册