]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virNetDevGetVirtualFunctions: Remove 'max_vfs' argument
authorPeter Krempa <pkrempa@redhat.com>
Wed, 4 Aug 2021 15:27:56 +0000 (17:27 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 9 Aug 2021 08:09:00 +0000 (10:09 +0200)
The only caller doesn't use it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/network/bridge_driver.c
src/util/virnetdev.c
src/util/virnetdev.h

index c9ee4b1a4e3b9ef6649108adeb70ce5ccc22cd4c..4ffcecdf9f7fecf419372707d40de1e227a56a3c 100644 (file)
@@ -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);
index fe531a3260a9a143e09dd684e9f5f00fc048c179..d578becb2068443bcb97155fe84475298ea15fb9 100644 (file)
@@ -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"));
index b694f4ac35515acd996d97d7e7f1a577bde844e7..de786c978945637b458016718fd9fef9733324fd 100644 (file)
@@ -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,