]> xenbits.xensource.com Git - people/dariof/libvirt.git/commitdiff
pci: eliminate unused driver arg from virPCIDeviceDetach
authorLaine Stump <laine@laine.org>
Thu, 30 May 2013 18:14:46 +0000 (14:14 -0400)
committerLaine Stump <laine@laine.org>
Tue, 25 Jun 2013 22:03:52 +0000 (18:03 -0400)
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
src/qemu/qemu_hostdev.c
src/util/virpci.c
src/util/virpci.h
src/xen/xen_driver.c

index 127abfe69a3c9bc778f0372f0623bfb015c18216..f51e766108ae8df0d6f15f7853057ea0212f4d12 100644 (file)
@@ -10711,7 +10711,7 @@ qemuNodeDeviceDetachFlags(virNodeDevicePtr dev,
     virObjectLock(driver->inactivePciHostdevs);
 
     if (virPCIDeviceDetach(pci, driver->activePciHostdevs,
-                           driver->inactivePciHostdevs, NULL) < 0) {
+                           driver->inactivePciHostdevs) < 0) {
         goto out;
     }
 
index c507c311104890d6a4218233ea59ca0133223942..d7d54d7241979f42b316fbbaa51476a7890281cf 100644 (file)
@@ -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;
     }
 
index 2f4032f516f568130e543c435a617f085b62cc03..2980e22d3ee57deb7d068ace7b642f725ec3638e 100644 (file)
@@ -1238,15 +1238,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;
     }
 
@@ -1256,7 +1253,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
index d069adba0da06ff45abca38c5c430f1990066785..944aa09db4615a34431f73a729a75fb9676ad1d8 100644 (file)
@@ -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);
index 38adb23bb2ee7a83ed88e3778d37694212856845..f69feb581f1e05d4bc2056f16f6316083761329a 100644 (file)
@@ -2440,7 +2440,7 @@ xenUnifiedNodeDeviceDetachFlags(virNodeDevicePtr dev,
         goto out;
     }
 
-    if (virPCIDeviceDetach(pci, NULL, NULL, NULL) < 0)
+    if (virPCIDeviceDetach(pci, NULL, NULL) < 0)
         goto out;
 
     ret = 0;