From nobody Sat Feb 7 15:29:48 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1643143817752676.8379572876202; Tue, 25 Jan 2022 12:50:17 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-347-c5QfFC82Py2BLmusxuKswA-1; Tue, 25 Jan 2022 15:50:14 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id AFADB8144E8; Tue, 25 Jan 2022 20:50:03 +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 86D124D735; Tue, 25 Jan 2022 20:50:03 +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 5416C18045C5; Tue, 25 Jan 2022 20:50:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 20PKo1Uo024338 for ; Tue, 25 Jan 2022 15:50:01 -0500 Received: by smtp.corp.redhat.com (Postfix) id 73B8FC4C7BE; Tue, 25 Jan 2022 20:50:00 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast08.extmail.prod.ext.rdu2.redhat.com [10.11.55.24]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6FBF7C23DCA for ; Tue, 25 Jan 2022 20:49:59 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8FD9E38183D9 for ; Tue, 25 Jan 2022 20:49:48 +0000 (UTC) Received: from mail-oi1-f177.google.com (mail-oi1-f177.google.com [209.85.167.177]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-327-4dxbfIK-PKuWC2kU_tsQxg-1; Tue, 25 Jan 2022 15:49:36 -0500 Received: by mail-oi1-f177.google.com with SMTP id s9so33466633oib.11 for ; Tue, 25 Jan 2022 12:49:36 -0800 (PST) Received: from rekt.COMFAST ([191.8.61.226]) by smtp.gmail.com with ESMTPSA id ay32sm1368569oob.16.2022.01.25.12.49.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jan 2022 12:49:35 -0800 (PST) X-MC-Unique: c5QfFC82Py2BLmusxuKswA-1 X-MC-Unique: 4dxbfIK-PKuWC2kU_tsQxg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rkYHj5v9o+2NwAQR6l0g7RLCPiFN+zivq0fkAfQSfP0=; b=3yzuzSmRLokboLOXugkTL3rPF5Zqsbc49fhahOZQZOE1xL1WOObg2UYlJNi1KN1QgZ bbSd3YFwmi9hIMDu8b09mx6vdFOh1sD0tUgcTWBSA1SW4EWbfMDqDVaK2aKInBR8DFia /a6S133UkC0RK8n93DoST3uNx2ZFsQtsBbVN5OaExFHqYmEh/XDxJ4F0fxfCaqasqr+2 r5W3Vp3wufg8CIR5gdPh+9KyIt7DvJ9WgCAsu1jQ4zi2zZ7rFqKH3e0Q7pvy5VDu8MYt 9JhuuYyuy5ivckb041PljQwPeUBygEbOgDnkTV7duSnZ7ezFCNfLW65sw3iI4Hi3yBj0 Pj8A== X-Gm-Message-State: AOAM5305A5TXSzeQqAiV4HmnxjAQVQlfNHlEqLbi4Y4swbBpD2WAN0ee NtCGZ7PC9yD5WuWmVhkdUOYiO0xt4pY= X-Google-Smtp-Source: ABdhPJxKsGurNb22tNZy7KE7jBTQ4tiQUAsludlYtrhyHSieEKVlfdIp0lB+8RgGaC99H+jKfkhF9w== X-Received: by 2002:aca:f0d:: with SMTP id 13mr1756448oip.51.1643143776066; Tue, 25 Jan 2022 12:49:36 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH v2 13/29] conf: parse and format Date: Tue, 25 Jan 2022 17:48:46 -0300 Message-Id: <20220125204902.772350-14-danielhb413@gmail.com> In-Reply-To: <20220125204902.772350-1-danielhb413@gmail.com> References: <20220125204902.772350-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 X-loop: libvir-list@redhat.com Cc: danielhb413@gmail.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1643143820467100001 Content-Type: text/plain; charset="utf-8" The 'chip-id' attribute indicates which chip/socket that owns the PowerNV pcie-root controller. Reviewed-by: Peter Krempa Signed-off-by: Daniel Henrique Barboza Reviewed-by: J=C3=A1n Tomko --- docs/formatdomain.rst | 6 ++++++ docs/schemas/domaincommon.rng | 5 +++++ src/conf/domain_conf.c | 15 +++++++++++++++ src/conf/domain_conf.h | 1 + 4 files changed, 27 insertions(+) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index e2f99c60a6..1e44d9a987 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -3898,6 +3898,12 @@ generated by libvirt. :since:`Since 1.2.19 (QEMU onl= y).` ``index`` pci-root controllers for pSeries guests use this attribute to record the order they will show up in the guest. :since:`Since 3.6.0` +``chip-id`` + pcie-root controllers for ``powernv`` domains use this attribute to ind= icate + the chip that will own the controller. A chip is equivalent to a CPU so= cket. + E.g. a ``powernv`` domain with `` sockets=3D3`` will have 3 c= hips. + chip-id=3D0 refers to the first chip, chip-id=3D1 refers to the second = chip and + so on. :since:`Since 8.1.0` =20 For machine types which provide an implicit PCI bus, the pci-root controll= er with index=3D0 is auto-added and required to use PCI devices. pci-root has= no diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 4c3a1c28a7..47a3107ea1 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -2655,6 +2655,11 @@ + + + + + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 72ee46026a..803c51d63a 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -2380,6 +2380,7 @@ virDomainControllerDefNew(virDomainControllerType typ= e) def->opts.pciopts.busNr =3D -1; def->opts.pciopts.targetIndex =3D -1; def->opts.pciopts.numaNode =3D -1; + def->opts.pciopts.chipId =3D -1; break; case VIR_DOMAIN_CONTROLLER_TYPE_XENBUS: def->opts.xenbusopts.maxGrantFrames =3D -1; @@ -9584,6 +9585,16 @@ virDomainControllerDefParseXML(virDomainXMLOption *x= mlopt, virReportError(VIR_ERR_XML_ERROR, _("Invalid target index '%i' in PCI control= ler"), def->opts.pciopts.targetIndex); + + if ((rc =3D virXMLPropInt(targetNodes[0], "chip-id", 0, VIR_XM= L_PROP_NONE, + &def->opts.pciopts.chipId, + def->opts.pciopts.chipId)) < 0) + return NULL; + + if ((rc =3D=3D 1) && def->opts.pciopts.chipId =3D=3D -1) + virReportError(VIR_ERR_XML_ERROR, + _("Invalid target chip-id '%i' in PCI contr= oller"), + def->opts.pciopts.chipId); } } else if (ntargetNodes > 1) { virReportError(VIR_ERR_XML_ERROR, "%s", @@ -23888,6 +23899,7 @@ virDomainControllerDefFormat(virBuffer *buf, def->opts.pciopts.busNr !=3D -1 || def->opts.pciopts.targetIndex !=3D -1 || def->opts.pciopts.numaNode !=3D -1 || + def->opts.pciopts.chipId !=3D -1 || def->opts.pciopts.hotplug !=3D VIR_TRISTATE_SWITCH_ABSENT) { virBufferAddLit(&childBuf, "opts.pciopts.chassisNr !=3D -1) @@ -23905,6 +23917,9 @@ virDomainControllerDefFormat(virBuffer *buf, if (def->opts.pciopts.targetIndex !=3D -1) virBufferAsprintf(&childBuf, " index=3D'%d'", def->opts.pciopts.targetIndex); + if (def->opts.pciopts.chipId !=3D -1) + virBufferAsprintf(&childBuf, " chip-id=3D'%d'", + def->opts.pciopts.chipId); if (def->opts.pciopts.hotplug !=3D VIR_TRISTATE_SWITCH_ABSENT)= { virBufferAsprintf(&childBuf, " hotplug=3D'%s'", virTristateSwitchTypeToString(def->opts.= pciopts.hotplug)); diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 1d9c689e83..93c5092f35 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -751,6 +751,7 @@ struct _virDomainPCIControllerOpts { int port; int busNr; /* used by pci-expander-bus, -1 =3D=3D unspecified */ int targetIndex; /* used by spapr-pci-host-bridge, -1 =3D=3D unspecifi= ed */ + int chipId; /* used by powernv pcie-root controllers, -1 =3D=3D unspec= ified */ /* numaNode is a *subelement* of target (to match existing * item in memory target config) -1 =3D=3D unspecified */ --=20 2.34.1