mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
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,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:
|
||||
|
Loading…
Reference in New Issue
Block a user