From nobody Sat Feb 7 15:29:52 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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.133.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.133.124]) by mx.zohomail.com with SMTPS id 1643143829465369.68570749545336; Tue, 25 Jan 2022 12:50:29 -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-402-TP9AGw-2OjSo73XtkBDJYA-1; Tue, 25 Jan 2022 15:50:21 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8DD351083F6B; Tue, 25 Jan 2022 20:50:07 +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 6DE78CB84C; Tue, 25 Jan 2022 20:50:07 +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 3F1954A71C; Tue, 25 Jan 2022 20:50:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 20PKo3Jw024358 for ; Tue, 25 Jan 2022 15:50:03 -0500 Received: by smtp.corp.redhat.com (Postfix) id 14E6E401E22; Tue, 25 Jan 2022 20:50:01 +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 111704328DE for ; Tue, 25 Jan 2022 20:50:00 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (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 416A68F566A for ; Tue, 25 Jan 2022 20:49:53 +0000 (UTC) Received: from mail-oi1-f181.google.com (mail-oi1-f181.google.com [209.85.167.181]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-388-yhGWi8EcNpuFQl6Ra3YsZQ-1; Tue, 25 Jan 2022 15:49:41 -0500 Received: by mail-oi1-f181.google.com with SMTP id u129so7425359oib.4 for ; Tue, 25 Jan 2022 12:49:41 -0800 (PST) Received: from rekt.COMFAST ([191.8.61.226]) by smtp.gmail.com with ESMTPSA id ay32sm1368569oob.16.2022.01.25.12.49.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jan 2022 12:49:40 -0800 (PST) X-MC-Unique: TP9AGw-2OjSo73XtkBDJYA-1 X-MC-Unique: yhGWi8EcNpuFQl6Ra3YsZQ-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=7aOjx0Hg07m6RwXwiCjgyZhbF0sPr8Y4VhFWmU8lYFs=; b=zsFaRg4kqHZbopqzlk0ZIWpHW4rd0tbwtsXeJhKuanoUH9B83aFq41wVmpPwUaVg/A HEifBHUemxEZ9K0mZBWznkPBwsT705LbQmAMNGSAWNZbEBio4oBNBZToTRvK7WleBoTX iqnMFizN9/wj742Quv4AJ4XHOQ5K65sePVZJzjg+zwFTiRz/MPNUlSDJhM2KboFk6Y90 WeKX5leKCrd7W8Lhgwls7FbSl43XayKrkQsuIV3KNv5cGxsYzcIwntSZQQPz3Et/+JqH 0pVuCGNIjEphNXfm63sP5aJOv/vQxdCNgQ79Lyee4c4HJTI5JbYZWRFiKhSg6mVMle/r rEeQ== X-Gm-Message-State: AOAM531J9UkRbxTMvS3gi+0i1YqIoFH+Q8RZvnsRq8Dr+YnSRJPNGdwh vt+Y7xbLEmuHN/pRgixR0UXFy8REvRA= X-Google-Smtp-Source: ABdhPJzJ3JdYLVosmubRmsd05I4+kZf8njaL3Uu7r4QmDgFSqGz5O2XHSWSfJgnGhXUiVlIp6u6dJg== X-Received: by 2002:a05:6808:230f:: with SMTP id bn15mr1746473oib.95.1643143780359; Tue, 25 Jan 2022 12:49:40 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH v2 16/29] conf, qemu: add default 'chip-id' value for pnv-phb3 controllers Date: Tue, 25 Jan 2022 17:48:49 -0300 Message-Id: <20220125204902.772350-17-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.10 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.15 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: 1643143830456100005 Content-Type: text/plain; charset="utf-8" If ommited from the controller definition, chip-id defaults to zero. Signed-off-by: Daniel Henrique Barboza Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_domain_address.c | 16 +++++++++++++++- src/qemu/qemu_validate.c | 5 +++++ .../powernv8-basic.ppc64-latest.xml | 1 + 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index f08fea32f5..17c2649fb1 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -2844,10 +2844,24 @@ qemuDomainAssignPCIAddresses(virDomainDef *def, goto cleanup; } break; + case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT: + if (!qemuDomainIsPowerNV(def)) + break; + + /* + * Default to chip-id =3D 0 since it's guaranteed that one= socket + * will always be present. + * + * chipId validation requires CPU topology information tha= t isn't + * available at this point and will be done later on. + */ + if (options->chipId =3D=3D -1) + options->chipId =3D 0; + + break; case VIR_DOMAIN_CONTROLLER_MODEL_DMI_TO_PCI_BRIDGE: case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_TO_PCI_BRIDGE: case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_SWITCH_UPSTREAM_PORT: - case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT: case VIR_DOMAIN_CONTROLLER_MODEL_PCI_DEFAULT: case VIR_DOMAIN_CONTROLLER_MODEL_PCI_LAST: break; diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index e8d86a2280..bce52269a6 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -3648,6 +3648,11 @@ qemuValidateDomainDeviceDefControllerPCI(const virDo= mainControllerDef *cont, virReportControllerInvalidValue(cont, model, modelName, "model= Name"); return -1; } + + if (pciopts->chipId !=3D -1 && !virDomainControllerIsPowerNVPHB(co= nt)) { + virReportControllerInvalidOption(cont, model, modelName, "chip= -id"); + return -1; + } break; =20 case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_TO_PCI_BRIDGE: diff --git a/tests/qemuxml2xmloutdata/powernv8-basic.ppc64-latest.xml b/tes= ts/qemuxml2xmloutdata/powernv8-basic.ppc64-latest.xml index ebbc0653ca..28d86d7d9e 100644 --- a/tests/qemuxml2xmloutdata/powernv8-basic.ppc64-latest.xml +++ b/tests/qemuxml2xmloutdata/powernv8-basic.ppc64-latest.xml @@ -19,6 +19,7 @@ /usr/bin/qemu-system-ppc64 + --=20 2.34.1