From nobody Tue Feb 10 04:32:53 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.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1498230578017731.2495344908496; Fri, 23 Jun 2017 08:09:38 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8C96BA0B49; Fri, 23 Jun 2017 15:09:32 +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 632A46928C; Fri, 23 Jun 2017 15:09:32 +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 1BDC226A; Fri, 23 Jun 2017 15:09:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v5NF4dvU004365 for ; Fri, 23 Jun 2017 11:04:39 -0400 Received: by smtp.corp.redhat.com (Postfix) id 686CB6E8D7; Fri, 23 Jun 2017 15:04:39 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-12-57.pek2.redhat.com [10.72.12.57]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 797236F9CA for ; Fri, 23 Jun 2017 15:04:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8C96BA0B49 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 8C96BA0B49 From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 23 Jun 2017 23:03:15 +0800 Message-Id: <1498230208-14144-14-git-send-email-abologna@redhat.com> In-Reply-To: <1498230208-14144-1-git-send-email-abologna@redhat.com> References: <1498230208-14144-1-git-send-email-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 13/26] conf: Parse and format 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.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 23 Jun 2017 15:09:33 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Andrea Bolognani --- docs/formatdomain.html.in | 5 +++++ docs/schemas/domaincommon.rng | 5 +++++ src/conf/domain_conf.c | 24 ++++++++++++++++++++++++ src/conf/domain_conf.h | 1 + 4 files changed, 35 insertions(+) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index a55a9e1..159c243 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -3768,6 +3768,11 @@ libvirt API to attach host devices to the correct pci-expander-bus when assigning them to the domain). +
index
+
+ pci-root controllers for pSeries guests will use this attribute to + record the order they will show up in the guest. +

For machine types which provide an implicit PCI bus, the pci-root diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index e259e3e..39eff46 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -1997,6 +1997,11 @@ + + + + + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 29268a9..1538747 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -1866,6 +1866,7 @@ virDomainControllerDefNew(virDomainControllerType typ= e) def->opts.pciopts.chassis =3D -1; def->opts.pciopts.port =3D -1; def->opts.pciopts.busNr =3D -1; + def->opts.pciopts.idx =3D -1; def->opts.pciopts.numaNode =3D -1; break; case VIR_DOMAIN_CONTROLLER_TYPE_IDE: @@ -9099,6 +9100,7 @@ virDomainControllerDefParseXML(xmlNodePtr node, goto error; } def->idx =3D idxVal; + VIR_FREE(idx); } =20 cur =3D node->children; @@ -9130,6 +9132,7 @@ virDomainControllerDefParseXML(xmlNodePtr node, chassis =3D virXMLPropString(cur, "chassis"); port =3D virXMLPropString(cur, "port"); busNr =3D virXMLPropString(cur, "busNr"); + idx =3D virXMLPropString(cur, "index"); processedTarget =3D true; } } @@ -9348,6 +9351,23 @@ virDomainControllerDefParseXML(xmlNodePtr node, goto error; } } + if (idx) { + if (virStrToLong_i(idx, NULL, 0, + &def->opts.pciopts.idx) < 0) { + virReportError(VIR_ERR_XML_ERROR, + _("Invalid target index '%s' in PCI control= ler"), + idx); + goto error; + } + if (def->opts.pciopts.idx < 0 || + def->opts.pciopts.idx > 31) { + virReportError(VIR_ERR_XML_ERROR, + _("PCI controller target index '%s' out of " + "range - must be 0-31"), + idx); + goto error; + } + } if (numaNode >=3D 0) def->opts.pciopts.numaNode =3D numaNode; break; @@ -21748,6 +21768,7 @@ virDomainControllerDefFormat(virBufferPtr buf, def->opts.pciopts.chassis !=3D -1 || def->opts.pciopts.port !=3D -1 || def->opts.pciopts.busNr !=3D -1 || + def->opts.pciopts.idx !=3D -1 || def->opts.pciopts.numaNode !=3D -1) { virBufferAddLit(&childBuf, "opts.pciopts.chassisNr !=3D -1) @@ -21762,6 +21783,9 @@ virDomainControllerDefFormat(virBufferPtr buf, if (def->opts.pciopts.busNr !=3D -1) virBufferAsprintf(&childBuf, " busNr=3D'%d'", def->opts.pciopts.busNr); + if (def->opts.pciopts.idx !=3D -1) + virBufferAsprintf(&childBuf, " index=3D'%d'", + def->opts.pciopts.idx); if (def->opts.pciopts.numaNode =3D=3D -1) { virBufferAddLit(&childBuf, "/>\n"); } else { diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 6d9ee97..53a10db 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -785,6 +785,7 @@ struct _virDomainPCIControllerOpts { int chassis; int port; int busNr; /* used by pci-expander-bus, -1 =3D=3D unspecified */ + int idx; /* used by spapr-pci-host-bridge, -1 =3D=3D unspecified */ /* numaNode is a *subelement* of target (to match existing * item in memory target config) -1 =3D=3D unspecified */ --=20 2.7.5 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list