From nobody Mon Feb 9 05:40:00 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 154760136216078.5169967634721; Tue, 15 Jan 2019 17:16:02 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 463B25D68A; Wed, 16 Jan 2019 01:16:00 +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 EEAD76092D; Wed, 16 Jan 2019 01:15:59 +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 7AC181803390; Wed, 16 Jan 2019 01:15:59 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x0G1FuaM022727 for ; Tue, 15 Jan 2019 20:15:56 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1305219940; Wed, 16 Jan 2019 01:15:56 +0000 (UTC) Received: from unknown0050b6a41c42.attlocal.net.com (ovpn-116-153.phx2.redhat.com [10.3.116.153]) by smtp.corp.redhat.com (Postfix) with ESMTP id C021E19C7C for ; Wed, 16 Jan 2019 01:15:55 +0000 (UTC) From: John Ferlan To: libvir-list@redhat.com Date: Tue, 15 Jan 2019 20:15:44 -0500 Message-Id: <20190116011549.16309-3-jferlan@redhat.com> In-Reply-To: <20190116011549.16309-1-jferlan@redhat.com> References: <20190116011549.16309-1-jferlan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/7] conf: Alter virCapabilitiesFormatHostXML to take virCapsHostPtr 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-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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 16 Jan 2019 01:16:01 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Rather than deref off of "caps->host.", let's pass "&caps->host" and make the helper use "host->" instead. Signed-off-by: John Ferlan --- src/conf/capabilities.c | 66 ++++++++++++++++++++--------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c index 33c0c37fbf..863cd06a8d 100644 --- a/src/conf/capabilities.c +++ b/src/conf/capabilities.c @@ -1058,7 +1058,7 @@ virCapabilitiesFormatMemoryBandwidth(virBufferPtr buf, =20 =20 static int -virCapabilitiesFormatHostXML(virCapsPtr caps, +virCapabilitiesFormatHostXML(virCapsHostPtr host, virBufferPtr buf) { size_t i, j; @@ -1066,40 +1066,40 @@ virCapabilitiesFormatHostXML(virCapsPtr caps, =20 virBufferAddLit(buf, "\n"); virBufferAdjustIndent(buf, 2); - if (virUUIDIsValid(caps->host.host_uuid)) { - virUUIDFormat(caps->host.host_uuid, host_uuid); + if (virUUIDIsValid(host->host_uuid)) { + virUUIDFormat(host->host_uuid, host_uuid); virBufferAsprintf(buf, "%s\n", host_uuid); } virBufferAddLit(buf, "\n"); virBufferAdjustIndent(buf, 2); =20 - if (caps->host.arch) + if (host->arch) virBufferAsprintf(buf, "%s\n", - virArchToString(caps->host.arch)); - if (caps->host.nfeatures) { + virArchToString(host->arch)); + if (host->nfeatures) { virBufferAddLit(buf, "\n"); virBufferAdjustIndent(buf, 2); - for (i =3D 0; i < caps->host.nfeatures; i++) { + for (i =3D 0; i < host->nfeatures; i++) { virBufferAsprintf(buf, "<%s/>\n", - caps->host.features[i]); + host->features[i]); } virBufferAdjustIndent(buf, -2); virBufferAddLit(buf, "\n"); } - virCPUDefFormatBuf(buf, caps->host.cpu); + virCPUDefFormatBuf(buf, host->cpu); =20 - for (i =3D 0; i < caps->host.nPagesSize; i++) { + for (i =3D 0; i < host->nPagesSize; i++) { virBufferAsprintf(buf, "\n", - caps->host.pagesSize[i]); + host->pagesSize[i]); } =20 virBufferAdjustIndent(buf, -2); virBufferAddLit(buf, "\n"); =20 /* The PM query was successful. */ - if (caps->host.powerMgmt) { + if (host->powerMgmt) { /* The host supports some PM features. */ - unsigned int pm =3D caps->host.powerMgmt; + unsigned int pm =3D host->powerMgmt; virBufferAddLit(buf, "\n"); virBufferAdjustIndent(buf, 2); while (pm) { @@ -1116,19 +1116,19 @@ virCapabilitiesFormatHostXML(virCapsPtr caps, } =20 virBufferAsprintf(buf, "\n", - caps->host.iommu ? "yes" : "no"); + host->iommu ? "yes" : "no"); =20 - if (caps->host.offlineMigrate) { + if (host->offlineMigrate) { virBufferAddLit(buf, "\n"); virBufferAdjustIndent(buf, 2); - if (caps->host.liveMigrate) + if (host->liveMigrate) virBufferAddLit(buf, "\n"); - if (caps->host.nmigrateTrans) { + if (host->nmigrateTrans) { virBufferAddLit(buf, "\n"); virBufferAdjustIndent(buf, 2); - for (i =3D 0; i < caps->host.nmigrateTrans; i++) { + for (i =3D 0; i < host->nmigrateTrans; i++) { virBufferAsprintf(buf, "%s\= n", - caps->host.migrateTrans[i]); + host->migrateTrans[i]); } virBufferAdjustIndent(buf, -2); virBufferAddLit(buf, "\n"); @@ -1137,32 +1137,32 @@ virCapabilitiesFormatHostXML(virCapsPtr caps, virBufferAddLit(buf, "\n"); } =20 - if (caps->host.netprefix) + if (host->netprefix) virBufferAsprintf(buf, "%s\n", - caps->host.netprefix); + host->netprefix); =20 - if (caps->host.nnumaCell && - virCapabilitiesFormatNUMATopology(buf, caps->host.nnumaCell, - caps->host.numaCell) < 0) + if (host->nnumaCell && + virCapabilitiesFormatNUMATopology(buf, host->nnumaCell, + host->numaCell) < 0) goto error; =20 - if (virCapabilitiesFormatCaches(buf, &caps->host.cache) < 0) + if (virCapabilitiesFormatCaches(buf, &host->cache) < 0) goto error; =20 - if (virCapabilitiesFormatMemoryBandwidth(buf, &caps->host.memBW) < 0) + if (virCapabilitiesFormatMemoryBandwidth(buf, &host->memBW) < 0) goto error; =20 - for (i =3D 0; i < caps->host.nsecModels; i++) { + for (i =3D 0; i < host->nsecModels; i++) { virBufferAddLit(buf, "\n"); virBufferAdjustIndent(buf, 2); virBufferAsprintf(buf, "%s\n", - caps->host.secModels[i].model); + host->secModels[i].model); virBufferAsprintf(buf, "%s\n", - caps->host.secModels[i].doi); - for (j =3D 0; j < caps->host.secModels[i].nlabels; j++) { + host->secModels[i].doi); + for (j =3D 0; j < host->secModels[i].nlabels; j++) { virBufferAsprintf(buf, "%s\= n", - caps->host.secModels[i].labels[j].type, - caps->host.secModels[i].labels[j].label); + host->secModels[i].labels[j].type, + host->secModels[i].labels[j].label); } virBufferAdjustIndent(buf, -2); virBufferAddLit(buf, "\n"); @@ -1195,7 +1195,7 @@ virCapabilitiesFormatXML(virCapsPtr caps) virBufferAddLit(&buf, "\n\n"); virBufferAdjustIndent(&buf, 2); =20 - if (virCapabilitiesFormatHostXML(caps, &buf) < 0) + if (virCapabilitiesFormatHostXML(&caps->host, &buf) < 0) goto error; =20 for (i =3D 0; i < caps->nguests; i++) { --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list