[PATCH 2/7] hostdev: Use common reattach code to rollback prepare errors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 src/util/virhostdev.c | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/src/util/virhostdev.c b/src/util/virhostdev.c
index 0f258a5..267aa55 100644
--- a/src/util/virhostdev.c
+++ b/src/util/virhostdev.c
@@ -795,23 +795,7 @@ virHostdevPreparePCIDevices(virHostdevManagerPtr hostdev_mgr,
         virHostdevNetConfigRestore(hostdevs[i], hostdev_mgr->stateDir, NULL);
 
  reattachdevs:
-    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
-             */
-            VIR_DEBUG("Reattaching managed PCI device %s",
-                      virPCIDeviceGetName(dev));
-            ignore_value(virPCIDeviceReattach(dev,
-                                              hostdev_mgr->activePCIHostdevs,
-                                              hostdev_mgr->inactivePCIHostdevs));
-        } else {
-            VIR_DEBUG("Not reattaching unmanaged PCI device %s",
-                      virPCIDeviceGetName(dev));
-        }
-    }
+    ignore_value(reattachPCIDevices(hostdev_mgr, pcidevs, true));
 
  cleanup:
     virObjectUnlock(hostdev_mgr->activePCIHostdevs);
-- 
2.5.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]