[libvirt] [PATCH 09/10] hostdev: Devices have already been marked as inactive

Andrea Bolognani abologna at redhat.com
Wed Dec 2 17:40:00 UTC 2015


We mark all VFIO devices as inactive after we've detached them from the
domain, so that step doesn't need to be performed afterwards.
---
 src/util/virhostdev.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/util/virhostdev.c b/src/util/virhostdev.c
index 1042ab3..b350de0 100644
--- a/src/util/virhostdev.c
+++ b/src/util/virhostdev.c
@@ -894,12 +894,10 @@ virHostdevExpandPCIDeviceListIOMMUGroups(virPCIDeviceListPtr list,
 static void
 virHostdevReattachPCIDevice(virPCIDevicePtr dev, virHostdevManagerPtr mgr)
 {
-    /* If the device is not managed and was attached to guest
-     * successfully, it must have been inactive.
-     */
+    /* We don't need to do anything for unmanaged devices */
     if (!virPCIDeviceGetManaged(dev)) {
-        if (virPCIDeviceListAdd(mgr->inactivePCIHostdevs, dev) < 0)
-            virPCIDeviceFree(dev);
+        VIR_DEBUG("Skipping reattach of unmanaged PCI device %s",
+                  virPCIDeviceGetName(dev));
         return;
     }
 
-- 
2.5.0




More information about the libvir-list mailing list