From nobody Sun Feb 8 11:45:35 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 1545663571255571.2126922351845; Mon, 24 Dec 2018 06:59:31 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D23A237E87; Mon, 24 Dec 2018 14:59:27 +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 2619960C68; Mon, 24 Dec 2018 14:59:27 +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 0BC5E181B9EB; Mon, 24 Dec 2018 14:59:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wBOExM5Q000739 for ; Mon, 24 Dec 2018 09:59:22 -0500 Received: by smtp.corp.redhat.com (Postfix) id C1EF460C68; Mon, 24 Dec 2018 14:59:22 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-27.ams2.redhat.com [10.36.112.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9D3F860C66; Mon, 24 Dec 2018 14:59:21 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Mon, 24 Dec 2018 14:58:49 +0000 Message-Id: <20181224145915.8700-2-berrange@redhat.com> In-Reply-To: <20181224145915.8700-1-berrange@redhat.com> References: <20181224145915.8700-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 01/27] conf: make virPCIDeviceAddressFormat void 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 24 Dec 2018 14:59:28 +0000 (UTC) Only one of the three callers of virPCIDeviceAddressFormat correctly handles an error return status. Fortunately it can't fail so can be made void. Signed-off-by: Daniel P. Berrang=C3=A9 --- src/conf/device_conf.c | 3 +-- src/conf/device_conf.h | 6 +++--- src/conf/domain_conf.c | 6 ++---- src/conf/network_conf.c | 7 +++---- src/conf/storage_adapter_conf.c | 4 ++-- 5 files changed, 11 insertions(+), 15 deletions(-) diff --git a/src/conf/device_conf.c b/src/conf/device_conf.c index 32628c6448..cd994057c5 100644 --- a/src/conf/device_conf.c +++ b/src/conf/device_conf.c @@ -308,7 +308,7 @@ virPCIDeviceAddressParseXML(xmlNodePtr node, return ret; } =20 -int +void virPCIDeviceAddressFormat(virBufferPtr buf, virPCIDeviceAddress addr, bool includeTypeInAddr) @@ -320,7 +320,6 @@ virPCIDeviceAddressFormat(virBufferPtr buf, addr.bus, addr.slot, addr.function); - return 0; } =20 bool diff --git a/src/conf/device_conf.h b/src/conf/device_conf.h index 56745707d9..7a3455f99f 100644 --- a/src/conf/device_conf.h +++ b/src/conf/device_conf.h @@ -202,9 +202,9 @@ bool virDeviceInfoPCIAddressExtensionIsPresent(const vi= rDomainDeviceInfo *info); int virPCIDeviceAddressParseXML(xmlNodePtr node, virPCIDeviceAddressPtr addr); =20 -int virPCIDeviceAddressFormat(virBufferPtr buf, - virPCIDeviceAddress addr, - bool includeTypeInAddr); +void virPCIDeviceAddressFormat(virBufferPtr buf, + virPCIDeviceAddress addr, + bool includeTypeInAddr); =20 bool virDomainDeviceCCWAddressIsValid(virDomainDeviceCCWAddressPtr addr); int virDomainDeviceCCWAddressParseXML(xmlNodePtr node, diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index d8dfd1656f..706ee361ff 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -24809,10 +24809,8 @@ virDomainHostdevDefFormatSubsys(virBufferPtr buf, } break; case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI: - if (virPCIDeviceAddressFormat(buf, pcisrc->addr, - includeTypeInAddr) !=3D 0) - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("PCI address Formatting failed")); + virPCIDeviceAddressFormat(buf, pcisrc->addr, + includeTypeInAddr); =20 if ((flags & VIR_DOMAIN_DEF_FORMAT_PCI_ORIG_STATES) && (def->origstates.states.pci.unbind_from_stub || diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c index e035d8aba7..3e2d6dc756 100644 --- a/src/conf/network_conf.c +++ b/src/conf/network_conf.c @@ -2471,10 +2471,9 @@ virNetworkDefFormatBuf(virBufferPtr buf, virBufferAddLit(buf, "/>\n"); } else { if (def->forward.ifs[i].type =3D=3D VIR_NETWORK_FORWA= RD_HOSTDEV_DEVICE_PCI) { - if (virPCIDeviceAddressFormat(buf, - def->forward.ifs[i].= device.pci, - true) < 0) - goto error; + virPCIDeviceAddressFormat(buf, + def->forward.ifs[i].devi= ce.pci, + true); } } } diff --git a/src/conf/storage_adapter_conf.c b/src/conf/storage_adapter_con= f.c index f333ae16ff..65d664b89b 100644 --- a/src/conf/storage_adapter_conf.c +++ b/src/conf/storage_adapter_conf.c @@ -325,8 +325,8 @@ virStorageAdapterFormatSCSIHost(virBufferPtr buf, virBufferAsprintf(buf, "\n", scsi_host->unique_id); virBufferAdjustIndent(buf, 2); - ignore_value(virPCIDeviceAddressFormat(buf, scsi_host->parentaddr, - false)); + virPCIDeviceAddressFormat(buf, scsi_host->parentaddr, + false); virBufferAdjustIndent(buf, -2); virBufferAddLit(buf, "\n"); virBufferAdjustIndent(buf, -2); --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list