From nobody Tue Feb 10 11:34:43 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 153451322159738.924566569513786; Fri, 17 Aug 2018 06:40:21 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DEA323168AB4; Fri, 17 Aug 2018 13:40:18 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 84A91AE4C1; Fri, 17 Aug 2018 13:40:18 +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 CAB8E1808872; Fri, 17 Aug 2018 13:40:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7HDeFcK007762 for ; Fri, 17 Aug 2018 09:40:15 -0400 Received: by smtp.corp.redhat.com (Postfix) id 15EA91006EAB; Fri, 17 Aug 2018 13:40:15 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.43.2.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A835F1007080 for ; Fri, 17 Aug 2018 13:40:14 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 17 Aug 2018 15:40:07 +0200 Message-Id: <20180817134007.22808-3-abologna@redhat.com> In-Reply-To: <20180817134007.22808-1-abologna@redhat.com> References: <20180817134007.22808-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/2] conf: Move some device_conf predicates 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.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Fri, 17 Aug 2018 13:40:19 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Turn virPCIDeviceAddressIsEmpty() virDeviceInfoPCIAddressIsWanted() virDeviceInfoPCIAddressIsPresent() from inline functions to regular functions. Signed-off-by: Andrea Bolognani --- src/conf/device_conf.c | 22 ++++++++++++++++++++++ src/conf/device_conf.h | 23 +++-------------------- src/libvirt_private.syms | 3 +++ 3 files changed, 28 insertions(+), 20 deletions(-) diff --git a/src/conf/device_conf.c b/src/conf/device_conf.c index d69f94fadf..7a8f84e036 100644 --- a/src/conf/device_conf.c +++ b/src/conf/device_conf.c @@ -191,6 +191,28 @@ int virPCIDeviceAddressIsValid(virPCIDeviceAddressPtr = addr, } =20 =20 +bool +virPCIDeviceAddressIsEmpty(const virPCIDeviceAddress *addr) +{ + return !(addr->domain || addr->bus || addr->slot); +} + +bool +virDeviceInfoPCIAddressIsWanted(const virDomainDeviceInfo *info) +{ + return info->type =3D=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE || + (info->type =3D=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI && + virPCIDeviceAddressIsEmpty(&info->addr.pci)); +} + +bool +virDeviceInfoPCIAddressIsPresent(const virDomainDeviceInfo *info) +{ + return info->type =3D=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI && + !virPCIDeviceAddressIsEmpty(&info->addr.pci); +} + + int virPCIDeviceAddressParseXML(xmlNodePtr node, virPCIDeviceAddressPtr addr) diff --git a/src/conf/device_conf.h b/src/conf/device_conf.h index 8c2bda2f4f..ff7d6c9d5f 100644 --- a/src/conf/device_conf.h +++ b/src/conf/device_conf.h @@ -188,27 +188,10 @@ bool virDomainDeviceInfoAddressIsEqual(const virDomai= nDeviceInfo *a, =20 int virPCIDeviceAddressIsValid(virPCIDeviceAddressPtr addr, bool report); +bool virPCIDeviceAddressIsEmpty(const virPCIDeviceAddress *addr); =20 -static inline bool -virPCIDeviceAddressIsEmpty(const virPCIDeviceAddress *addr) -{ - return !(addr->domain || addr->bus || addr->slot); -} - -static inline bool -virDeviceInfoPCIAddressIsWanted(const virDomainDeviceInfo *info) -{ - return info->type =3D=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE || - (info->type =3D=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI && - virPCIDeviceAddressIsEmpty(&info->addr.pci)); -} - -static inline bool -virDeviceInfoPCIAddressIsPresent(const virDomainDeviceInfo *info) -{ - return info->type =3D=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI && - !virPCIDeviceAddressIsEmpty(&info->addr.pci); -} +bool virDeviceInfoPCIAddressIsWanted(const virDomainDeviceInfo *info); +bool virDeviceInfoPCIAddressIsPresent(const virDomainDeviceInfo *info); =20 int virPCIDeviceAddressParseXML(xmlNodePtr node, virPCIDeviceAddressPtr addr); diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index ca4a192a4a..cd893f7108 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -93,12 +93,15 @@ virCPUModeTypeToString; =20 =20 # conf/device_conf.h +virDeviceInfoPCIAddressIsPresent; +virDeviceInfoPCIAddressIsWanted; virDomainDeviceInfoAddressIsEqual; virDomainDeviceInfoCopy; virInterfaceLinkFormat; virInterfaceLinkParseXML; virPCIDeviceAddressEqual; virPCIDeviceAddressFormat; +virPCIDeviceAddressIsEmpty; virPCIDeviceAddressIsValid; virPCIDeviceAddressParseXML; =20 --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list