virNetDevGetVirtualFunctions: Remove 'max_vfs' argument

The only caller doesn't use it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2021-08-04 17:27:56 +02:00
parent fcae7a44c3
commit 00f804c1cf
3 changed files with 7 additions and 12 deletions

View 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);

View 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"));

View 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,