From nobody Mon Feb 9 02:27:25 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1536134980327582.2960039948624; Wed, 5 Sep 2018 01:09:40 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 175ED859FF; Wed, 5 Sep 2018 08:09:38 +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 BF93416EF3; Wed, 5 Sep 2018 08:09:37 +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 5E97B4A460; Wed, 5 Sep 2018 08:09:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w8589Xi5022566 for ; Wed, 5 Sep 2018 04:09:33 -0400 Received: by smtp.corp.redhat.com (Postfix) id 145DA215670B; Wed, 5 Sep 2018 08:09:33 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.43.2.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8AC092156701 for ; Wed, 5 Sep 2018 08:09:32 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Wed, 5 Sep 2018 10:09:24 +0200 Message-Id: <20180905080926.3034-2-abologna@redhat.com> In-Reply-To: <20180905080926.3034-1-abologna@redhat.com> References: <20180905080926.3034-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 1/3] conf: Move virDomainPCIAddressAsString() to util/virpci 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 05 Sep 2018 08:09:38 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" It's a better fit than conf/domain_conf. Signed-off-by: Andrea Bolognani Reviewed-by: Martin Kletzander --- src/conf/domain_addr.c | 14 -------------- src/conf/domain_addr.h | 4 ---- src/libvirt_private.syms | 2 +- src/util/virpci.c | 13 +++++++++++++ src/util/virpci.h | 3 +++ 5 files changed, 17 insertions(+), 19 deletions(-) diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c index b62fd53c66..d2e1142462 100644 --- a/src/conf/domain_addr.c +++ b/src/conf/domain_addr.c @@ -573,20 +573,6 @@ virDomainPCIAddressSetGrow(virDomainPCIAddressSetPtr a= ddrs, } =20 =20 -char * -virDomainPCIAddressAsString(virPCIDeviceAddressPtr addr) -{ - char *str; - - ignore_value(virAsprintf(&str, "%.4x:%.2x:%.2x.%.1x", - addr->domain, - addr->bus, - addr->slot, - addr->function)); - return str; -} - - /* * Check if the PCI slot is used by another device. */ diff --git a/src/conf/domain_addr.h b/src/conf/domain_addr.h index 5ad9d8ef3d..f8ab742715 100644 --- a/src/conf/domain_addr.h +++ b/src/conf/domain_addr.h @@ -124,9 +124,6 @@ struct _virDomainPCIAddressSet { typedef struct _virDomainPCIAddressSet virDomainPCIAddressSet; typedef virDomainPCIAddressSet *virDomainPCIAddressSetPtr; =20 -char *virDomainPCIAddressAsString(virPCIDeviceAddressPtr addr) - ATTRIBUTE_NONNULL(1); - virDomainPCIAddressSetPtr virDomainPCIAddressSetAlloc(unsigned int nbuses); =20 void virDomainPCIAddressSetFree(virDomainPCIAddressSetPtr addrs); @@ -138,7 +135,6 @@ bool virDomainPCIAddressValidate(virDomainPCIAddressSet= Ptr addrs, bool fromConfig) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); =20 - int virDomainPCIAddressBusSetModel(virDomainPCIAddressBusPtr bus, virDomainControllerModelPCI model) ATTRIBUTE_NONNULL(1); diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index e2340d23a6..04242a22b1 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -119,7 +119,6 @@ virPCIDeviceAddressParseXML; virDomainCCWAddressAssign; virDomainCCWAddressSetCreateFromDomain; virDomainCCWAddressSetFree; -virDomainPCIAddressAsString; virDomainPCIAddressBusIsFullyReserved; virDomainPCIAddressBusSetModel; virDomainPCIAddressEnsureAddr; @@ -2497,6 +2496,7 @@ virObjectUnref; =20 =20 # util/virpci.h +virDomainPCIAddressAsString; virPCIDeviceAddressGetIOMMUGroupAddresses; virPCIDeviceAddressGetIOMMUGroupNum; virPCIDeviceAddressGetSysfsFile; diff --git a/src/util/virpci.c b/src/util/virpci.c index 6cf2acf2d1..512e365cad 100644 --- a/src/util/virpci.c +++ b/src/util/virpci.c @@ -1684,6 +1684,19 @@ virPCIGetAddrString(unsigned int domain, return 0; } =20 +char * +virDomainPCIAddressAsString(virPCIDeviceAddressPtr addr) +{ + char *str; + + ignore_value(virAsprintf(&str, "%.4x:%.2x:%.2x.%.1x", + addr->domain, + addr->bus, + addr->slot, + addr->function)); + return str; +} + virPCIDevicePtr virPCIDeviceNew(unsigned int domain, unsigned int bus, diff --git a/src/util/virpci.h b/src/util/virpci.h index 2ac87694df..9ef1b838b7 100644 --- a/src/util/virpci.h +++ b/src/util/virpci.h @@ -225,6 +225,9 @@ int virPCIGetAddrString(unsigned int domain, char **pciConfigAddr) ATTRIBUTE_NONNULL(5) ATTRIBUTE_RETURN_CHECK; =20 +char *virDomainPCIAddressAsString(virPCIDeviceAddressPtr addr) + ATTRIBUTE_NONNULL(1); + int virPCIDeviceAddressParse(char *address, virPCIDeviceAddressPtr bdf); =20 int virPCIGetVirtualFunctionInfo(const char *vf_sysfs_device_path, --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list