From nobody Sun Feb 8 22:57:48 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1628172977; cv=none; d=zohomail.com; s=zohoarc; b=bkqFaAZtzN9r5qLw1auu4uucxpe20orz2RuhGFHEGqyafRfgGksDNsqFPKQ8ZQXrEi2nBVl443gKCZCfAUInyyb+2khQM7FRGEY/L61GXx2/QkyfdiUEQ6nJO8FlGwa93Or5/DzqTkoVJnOl03LuwX7YUha8uVg32QRA/ZmFlvQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628172977; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=t3iI4sd73i3xAivrpFkNljVwS4LpAh/kQeLB+LX1ij8=; b=clpgSN7plYDRvEpXc3zdD+5b5TRgGqm6FzM5ml5R598lzrT0dSRxUsni9t6UeyOfalj6B3roQNuf+IybPWs7Tx6NTqkknpfom2YH6AlKZ1dyHkcME4PXX7aa8VeqH34eZXXPJogaMirbCl/FrpxbSwNMeckGcXgA6BpAm2GOj3s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1628172977598913.1757520454488; Thu, 5 Aug 2021 07:16:17 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-353-cisOr_sfMvy0tkdzfSuKrg-1; Thu, 05 Aug 2021 10:16:15 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 37EBE1B18BC6; Thu, 5 Aug 2021 14:16:09 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1617B295E5; Thu, 5 Aug 2021 14:16:09 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 6F1EF4A7C8; Thu, 5 Aug 2021 14:16:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 175EDHe6016798 for ; Thu, 5 Aug 2021 10:13:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id 661295C25D; Thu, 5 Aug 2021 14:13:17 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id C7F285C1A1 for ; Thu, 5 Aug 2021 14:13:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628172976; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=t3iI4sd73i3xAivrpFkNljVwS4LpAh/kQeLB+LX1ij8=; b=MLqOK+at39aSBkFT3LMrtkoLQ24yUPvGy8mUm3IXDhqkKile2hMbXT3QYOxcM3tzuVJYIu vxdZt4d0BqdHwi+QCRWY3fwUuUgtmHNGPYLczbNn741PscujsEcOQ9Y0sicbTntmUzfe7A N7MDliAA5w7M5qPAfiM1krQhIx43F6M= X-MC-Unique: cisOr_sfMvy0tkdzfSuKrg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 1/6] virNetDevGetVirtualFunctions: Remove 'max_vfs' argument Date: Thu, 5 Aug 2021 16:13:05 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1628172979244100003 Content-Type: text/plain; charset="utf-8" The only caller doesn't use it. Signed-off-by: Peter Krempa --- 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 =3D 0; - unsigned int maxVirtFns =3D 0; char **vfNames =3D 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 =3D -1; size_t i; g_autofree char *pf_sysfs_device_link =3D NULL; g_autofree char *pfPhysPortID =3D NULL; + unsigned int max_vfs; *virt_fns =3D NULL; *n_vfname =3D 0; - *max_vfs =3D 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 =3D 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 platfo= rm")); 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, --=20 2.31.1