mirror of https://gitee.com/openkylin/libvirt.git
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.
This commit is contained in:
parent
b8a625f384
commit
e926df601d
|
@ -711,6 +711,7 @@ virHostdevPreparePCIDevices(virHostdevManagerPtr hostdev_mgr,
|
|||
for (i = 0; i < virPCIDeviceListCount(pcidevs); i++) {
|
||||
virPCIDevicePtr dev = virPCIDeviceListGet(pcidevs, i);
|
||||
|
||||
if (virPCIDeviceGetManaged(dev)) {
|
||||
/* NB: This doesn't actually re-bind to original driver, just
|
||||
* unbinds from the stub driver
|
||||
*/
|
||||
|
@ -718,6 +719,7 @@ virHostdevPreparePCIDevices(virHostdevManagerPtr hostdev_mgr,
|
|||
hostdev_mgr->activePCIHostdevs,
|
||||
hostdev_mgr->inactivePCIHostdevs));
|
||||
}
|
||||
}
|
||||
|
||||
cleanup:
|
||||
virObjectUnlock(hostdev_mgr->activePCIHostdevs);
|
||||
|
|
Loading…
Reference in New Issue