[PATCH 1/6] virNetDevGetVirtualFunctions: Remove 'max_vfs' argument

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

 



The only caller doesn't use it.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/network/bridge_driver.c |  3 +--
 src/util/virnetdev.c        | 11 ++++-------
 src/util/virnetdev.h        |  5 ++---
 3 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index c9ee4b1a4e..4ffcecdf9f 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -2599,7 +2599,6 @@ static int
 networkCreateInterfacePool(virNetworkDef *netdef)
 {
     size_t numVirtFns = 0;
-    unsigned int maxVirtFns = 0;
     char **vfNames = NULL;
     virPCIDeviceAddress **virtFns;

@@ -2610,7 +2609,7 @@ networkCreateInterfacePool(virNetworkDef *netdef)
        return 0;

     if ((virNetDevGetVirtualFunctions(netdef->forward.pfs->dev, &vfNames,
-                                      &virtFns, &numVirtFns, &maxVirtFns)) < 0) {
+                                      &virtFns, &numVirtFns)) < 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Could not get Virtual functions on %s"),
                        netdef->forward.pfs->dev);
diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
index fe531a3260..d578becb20 100644
--- a/src/util/virnetdev.c
+++ b/src/util/virnetdev.c
@@ -1225,17 +1225,16 @@ int
 virNetDevGetVirtualFunctions(const char *pfname,
                              char ***vfname,
                              virPCIDeviceAddress ***virt_fns,
-                             size_t *n_vfname,
-                             unsigned int *max_vfs)
+                             size_t *n_vfname)
 {
     int ret = -1;
     size_t i;
     g_autofree char *pf_sysfs_device_link = NULL;
     g_autofree char *pfPhysPortID = NULL;
+    unsigned int max_vfs;

     *virt_fns = NULL;
     *n_vfname = 0;
-    *max_vfs = 0;

     if (virNetDevGetPhysPortID(pfname, &pfPhysPortID) < 0)
         goto cleanup;
@@ -1243,8 +1242,7 @@ virNetDevGetVirtualFunctions(const char *pfname,
     if (virNetDevSysfsFile(&pf_sysfs_device_link, pfname, "device") < 0)
         goto cleanup;

-    if (virPCIGetVirtualFunctions(pf_sysfs_device_link, virt_fns,
-                                  n_vfname, max_vfs) < 0)
+    if (virPCIGetVirtualFunctions(pf_sysfs_device_link, virt_fns, n_vfname, &max_vfs) < 0)
         goto cleanup;

     *vfname = g_new0(char *, *n_vfname);
@@ -1480,8 +1478,7 @@ int
 virNetDevGetVirtualFunctions(const char *pfname G_GNUC_UNUSED,
                              char ***vfname G_GNUC_UNUSED,
                              virPCIDeviceAddress ***virt_fns G_GNUC_UNUSED,
-                             size_t *n_vfname G_GNUC_UNUSED,
-                             unsigned int *max_vfs G_GNUC_UNUSED)
+                             size_t *n_vfname G_GNUC_UNUSED)
 {
     virReportSystemError(ENOSYS, "%s",
                          _("Unable to get virtual functions on this platform"));
diff --git a/src/util/virnetdev.h b/src/util/virnetdev.h
index b694f4ac35..de786c9789 100644
--- a/src/util/virnetdev.h
+++ b/src/util/virnetdev.h
@@ -254,10 +254,9 @@ int virNetDevGetPhysPortName(const char *ifname,
 int virNetDevGetVirtualFunctions(const char *pfname,
                                  char ***vfname,
                                  virPCIDeviceAddress ***virt_fns,
-                                 size_t *n_vfname,
-                                 unsigned int *max_vfs)
+                                 size_t *n_vfname)
     ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
-    ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5) G_GNUC_WARN_UNUSED_RESULT;
+    ATTRIBUTE_NONNULL(4) G_GNUC_WARN_UNUSED_RESULT;

 int virNetDevSaveNetConfig(const char *linkdev, int vf,
                            const char *stateDir,
-- 
2.31.1




[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]

  Powered by Linux