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

[libvirt] [PATCH 07/22] pci: eliminate unused driver arg from virPCIDeviceDetach



The driver arg to virPCIDeviceDetach is no longer used (the name of the stub driver is now set in the virPCIDevice object, and virPCIDeviceDetach retrieves it from there). Remove it.
---
 src/qemu/qemu_driver.c  |  2 +-
 src/qemu/qemu_hostdev.c |  2 +-
 src/util/virpci.c       | 13 +++++--------
 src/util/virpci.h       |  3 +--
 src/xen/xen_driver.c    |  2 +-
 5 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 20edf45..20b127c 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -10300,7 +10300,7 @@ qemuNodeDeviceDetachFlags(virNodeDevicePtr dev,
     virObjectLock(driver->inactivePciHostdevs);
 
     if (virPCIDeviceDetach(pci, driver->activePciHostdevs,
-                           driver->inactivePciHostdevs, NULL) < 0) {
+                           driver->inactivePciHostdevs) < 0) {
         goto out;
     }
 
diff --git a/src/qemu/qemu_hostdev.c b/src/qemu/qemu_hostdev.c
index 7a9e6eb..dfe39c6 100644
--- a/src/qemu/qemu_hostdev.c
+++ b/src/qemu/qemu_hostdev.c
@@ -540,7 +540,7 @@ int qemuPrepareHostdevPCIDevices(virQEMUDriverPtr driver,
     for (i = 0; i < virPCIDeviceListCount(pcidevs); i++) {
         virPCIDevicePtr dev = virPCIDeviceListGet(pcidevs, i);
         if (virPCIDeviceGetManaged(dev) &&
-            virPCIDeviceDetach(dev, driver->activePciHostdevs, NULL, NULL) < 0)
+            virPCIDeviceDetach(dev, driver->activePciHostdevs, NULL) < 0)
             goto reattachdevs;
     }
 
diff --git a/src/util/virpci.c b/src/util/virpci.c
index 0074af3..a53912d 100644
--- a/src/util/virpci.c
+++ b/src/util/virpci.c
@@ -1239,15 +1239,12 @@ cleanup:
 int
 virPCIDeviceDetach(virPCIDevicePtr dev,
                    virPCIDeviceList *activeDevs,
-                   virPCIDeviceList *inactiveDevs,
-                   const char *driver)
+                   virPCIDeviceList *inactiveDevs)
 {
-    if (!driver && dev->stubDriver)
-        driver = dev->stubDriver;
-
-    if (virPCIProbeStubDriver(driver) < 0) {
+    if (virPCIProbeStubDriver(dev->stubDriver) < 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Failed to load PCI stub module %s"), driver);
+                       _("Failed to load PCI stub module %s"),
+                       dev->stubDriver);
         return -1;
     }
 
@@ -1257,7 +1254,7 @@ virPCIDeviceDetach(virPCIDevicePtr dev,
         return -1;
     }
 
-    if (virPCIDeviceBindToStub(dev, driver) < 0)
+    if (virPCIDeviceBindToStub(dev, dev->stubDriver) < 0)
         return -1;
 
     /* Add *a copy of* the dev into list inactiveDevs, if
diff --git a/src/util/virpci.h b/src/util/virpci.h
index d069adb..944aa09 100644
--- a/src/util/virpci.h
+++ b/src/util/virpci.h
@@ -51,8 +51,7 @@ const char *virPCIDeviceGetName(virPCIDevicePtr dev);
 
 int virPCIDeviceDetach(virPCIDevicePtr dev,
                        virPCIDeviceListPtr activeDevs,
-                       virPCIDeviceListPtr inactiveDevs,
-                       const char *driver);
+                       virPCIDeviceListPtr inactiveDevs);
 int virPCIDeviceReattach(virPCIDevicePtr dev,
                          virPCIDeviceListPtr activeDevs,
                          virPCIDeviceListPtr inactiveDevs);
diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c
index 2506b8e..6724a36 100644
--- a/src/xen/xen_driver.c
+++ b/src/xen/xen_driver.c
@@ -2245,7 +2245,7 @@ xenUnifiedNodeDeviceDetachFlags(virNodeDevicePtr dev,
         goto out;
     }
 
-    if (virPCIDeviceDetach(pci, NULL, NULL, NULL) < 0)
+    if (virPCIDeviceDetach(pci, NULL, NULL) < 0)
         goto out;
 
     ret = 0;
-- 
1.7.11.7


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