From nobody Sun Feb 8 16:05:01 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 1642686821830216.7207151121903; Thu, 20 Jan 2022 05:53:41 -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-621-zyQl_dp8PZyL82JfjDRtjA-1; Thu, 20 Jan 2022 08:53:37 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 31C2C363A8; Thu, 20 Jan 2022 13:53:32 +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 EC66A1091ED9; Thu, 20 Jan 2022 13:53:31 +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 B4D39180126E; Thu, 20 Jan 2022 13:53:31 +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 20KDrRu4009133 for ; Thu, 20 Jan 2022 08:53:27 -0500 Received: by smtp.corp.redhat.com (Postfix) id 46A211121339; Thu, 20 Jan 2022 13:53:27 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 421361121335 for ; Thu, 20 Jan 2022 13:53:22 +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 710F185A5B5 for ; Thu, 20 Jan 2022 13:53:22 +0000 (UTC) Received: from mail-oo1-f51.google.com (mail-oo1-f51.google.com [209.85.161.51]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-155-syEVfkUCO7CEkrsu1UDjIw-1; Thu, 20 Jan 2022 08:53:20 -0500 Received: by mail-oo1-f51.google.com with SMTP id f4-20020a4ac484000000b002e3e221d769so2336123ooq.1 for ; Thu, 20 Jan 2022 05:53:20 -0800 (PST) Received: from rekt.COMFAST ([191.8.61.226]) by smtp.gmail.com with ESMTPSA id a26sm1574102oiy.26.2022.01.20.05.53.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jan 2022 05:53:19 -0800 (PST) X-MC-Unique: zyQl_dp8PZyL82JfjDRtjA-1 X-MC-Unique: syEVfkUCO7CEkrsu1UDjIw-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=+iBixvf4hlFiNsbLfD6Z+jvGx0vcEjMghO45jTzZtaE=; b=h4hpYXHr5ys1hxD8pfxIPEWn+f9KLDVRpNSoRTYlKcIA/WgvXpIGyCZiEvUonO23na DYRljApUVZEMN/QdgpgxnG8hf+WUK3eHAEmOopfBt/PnmXDw+0bZ6e3h9UkX8lK8/vk3 WE2xHcad88N2ZnIJ9T/3WZX42Zhzo8tQfEKVjs8KnaP3vUWkZEDyWk2QsOx+q3X6g0G1 e08YkCopMOBC1fp7rFPzePD/9SC2qGKwDN4EdMS8IK22jI9z3tzoNHeoT2faqsHDDDCf Y85hZvD16dxOob9mltxnxmusrhr6JOnu5dZdJy52bzpdCGrkkT0dj4oqv36pnoNyUtqM 7OMQ== X-Gm-Message-State: AOAM533VWK2cl/3hki2wtmT8SZY6qeN107O7ZW+ZgpzrtPD6idA+G2VM jDqsi+dQeR5JqSngu8mjqDTTHHfsPUw= X-Google-Smtp-Source: ABdhPJzo5ItC3w8te3eCRyD0l2y7V4tOkixN9bi8UQ4qe+ro4cQzu9kE5Q9ACJqB88hS5vcaZ+Yt8g== X-Received: by 2002:a4a:b48d:: with SMTP id b13mr25747206ooo.37.1642686799825; Thu, 20 Jan 2022 05:53:19 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH 17/33] conf: parse and format Date: Thu, 20 Jan 2022 10:52:20 -0300 Message-Id: <20220120135236.719924-18-danielhb413@gmail.com> In-Reply-To: <20220120135236.719924-1-danielhb413@gmail.com> References: <20220120135236.719924-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.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Cc: fbarrat@linux.ibm.com, 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.84 on 10.5.11.22 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: 1642686822729100001 Content-Type: text/plain; charset="utf-8" The 'chip-id' attribute indicates which chip/socket that owns the PowerNV pcie-root controller. Signed-off-by: Daniel Henrique Barboza --- docs/formatdomain.rst | 4 ++++ docs/schemas/domaincommon.rng | 5 +++++ src/conf/domain_conf.c | 15 +++++++++++++++ src/conf/domain_conf.h | 1 + 4 files changed, 25 insertions(+) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index acd9020830..d38c566650 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -3896,6 +3896,10 @@ 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 indicat= e the + chip that will own the controller. A single chip can hold multiple pcie= -root + controllers. :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 7cfc22bc72..fed82c79e1 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -2654,6 +2654,11 @@ + + + + + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index be8dc82ccf..d1cda8c3f5 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -2379,6 +2379,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; @@ -9624,6 +9625,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", @@ -24081,6 +24092,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) @@ -24098,6 +24110,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 07fbf9780a..db9021146d 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -750,6 +750,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