From nobody Sun Feb 8 05:40:44 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 1642686845200537.6659247934821; Thu, 20 Jan 2022 05:54:05 -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-31-_59nzWPIOEewz7XH2FUDSw-1; Thu, 20 Jan 2022 08:54:02 -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 1AD5E6EAFB; Thu, 20 Jan 2022 13:53:56 +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 E644310A3288; Thu, 20 Jan 2022 13:53:55 +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 AEAA618218B6; Thu, 20 Jan 2022 13:53:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 20KDrrgT010217 for ; Thu, 20 Jan 2022 08:53:53 -0500 Received: by smtp.corp.redhat.com (Postfix) id 079332166B1A; Thu, 20 Jan 2022 13:53:53 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 02C202166B13 for ; Thu, 20 Jan 2022 13:53:42 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (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 357C7101A52D for ; Thu, 20 Jan 2022 13:53:42 +0000 (UTC) Received: from mail-ot1-f46.google.com (mail-ot1-f46.google.com [209.85.210.46]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-673-n6MIng5pPpyKMsGz5PGLBA-1; Thu, 20 Jan 2022 08:53:40 -0500 Received: by mail-ot1-f46.google.com with SMTP id x31-20020a056830245f00b00599111c8b20so7640804otr.7 for ; Thu, 20 Jan 2022 05:53:40 -0800 (PST) Received: from rekt.COMFAST ([191.8.61.226]) by smtp.gmail.com with ESMTPSA id a26sm1574102oiy.26.2022.01.20.05.53.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jan 2022 05:53:39 -0800 (PST) X-MC-Unique: _59nzWPIOEewz7XH2FUDSw-1 X-MC-Unique: n6MIng5pPpyKMsGz5PGLBA-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=kh9D2zQPRgPyEnvX2/t24DIb0DzHMEqtotuu0NEEnio=; b=x45SAJ02n7urByHBmZVX530zEz39NwMAjPWZfW+du5bv5YHJuoLWrmS81zC9hltwUo 4NwKDzrJK/62bipEmLbQ5dBPROnXxri4Kbbf3laGLvxoWii777wf6lu9Txyqd5+mk3Sw jVh0p5D3j0DHLBuQ/Mwn+OQMymrfJp0pxUUQ4Rmon59C+XL/mcpkhg+JK8mAmDWbGLpP LQxuEWRThmJ5wXq+l4vtsSQXUzeG5Q+QsNzizvMgEMTRDAEX3R19bI+IkjdGRypD2l/9 nmjoB165PzeP7PYFJPwEumLYj0PuEleAwLaV3ZJy+CLoW5sO4l2yQKpqMTvKk0PRLIt3 Laxw== X-Gm-Message-State: AOAM532qwirbW8b9dRfX2lbQps7f0D53blvvf+6UZAp4Ep5H3T5WujP/ G7Zz+6VedNPwuY3KQ6trJyy6nh6K6/c= X-Google-Smtp-Source: ABdhPJwhHmwD+yqwSd6tDeRTkhxPGTFvzw0lLW3WQQDlQ2MHMkLeXI9e4rLUB8HjYUrgs3W3JHIczQ== X-Received: by 2002:a05:6830:10ca:: with SMTP id z10mr29472913oto.252.1642686819688; Thu, 20 Jan 2022 05:53:39 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH 29/33] qemu: add 'modelName' value for pnv-phb4-root-port device Date: Thu, 20 Jan 2022 10:52:32 -0300 Message-Id: <20220120135236.719924-30-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.6 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: 1642686846849100001 Content-Type: text/plain; charset="utf-8" Use the 'modelName' attribute for the pnv-phb4-root-port device. Let's also take this opportunity to adapt the virDomainControllerIsPowerNVRootPort() helper to also recognize pnv-phb4-root-port as a PowerNV root port. This will spare us from duplicating checks where the constraints of pnv-phb3-root-port also applies for the pnv-phb4-root-port device. Signed-off-by: Daniel Henrique Barboza --- src/conf/domain_conf.c | 3 ++- src/qemu/qemu_domain_address.c | 14 +++++++++++++- src/qemu/qemu_validate.c | 6 ++++-- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index ca22d42f0a..c4d79548cf 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -2475,7 +2475,8 @@ virDomainControllerIsPowerNVRootPort(const virDomainC= ontrollerDef *cont) =20 name =3D cont->opts.pciopts.modelName; =20 - if (name !=3D VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3_ROOT_PORT) + if ((name !=3D VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3_ROOT_PORT= ) && + (name !=3D VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB4_ROOT_PORT= )) return false; =20 return true; diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index 5d65049c34..f8b5da8b55 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -2412,6 +2412,18 @@ qemuDomainAssignDevicePCISlots(virDomainDef *def, } =20 =20 +static virDomainControllerPCIModelName +virDomainControllerGetPowerNVRootPortName(virDomainDef *def) +{ + if (STREQ(def->os.machine, "powernv8")) + return VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3_ROOT_PORT; + else if (STREQ(def->os.machine, "powernv9")) + return VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB4_ROOT_PORT; + + return VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE; +} + + static void qemuDomainPCIControllerSetDefaultModelName(virDomainControllerDef *cont, virDomainDef *def, @@ -2435,7 +2447,7 @@ qemuDomainPCIControllerSetDefaultModelName(virDomainC= ontrollerDef *cont, break; case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT_PORT: if (qemuDomainIsPowerNV(def)) { - *modelName =3D VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3_R= OOT_PORT; + *modelName =3D virDomainControllerGetPowerNVRootPortName(def); break; } =20 diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index cfcad91499..e43c49a01a 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -3604,12 +3604,14 @@ qemuValidateDomainDeviceDefControllerPCI(const virD= omainControllerDef *cont, case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT_PORT: if (pciopts->modelName !=3D VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_I= OH3420 && pciopts->modelName !=3D VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_P= CIE_ROOT_PORT && - pciopts->modelName !=3D VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_P= NV_PHB3_ROOT_PORT) { + pciopts->modelName !=3D VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_P= NV_PHB3_ROOT_PORT && + pciopts->modelName !=3D VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_P= NV_PHB4_ROOT_PORT) { virReportControllerInvalidValue(cont, model, modelName, "model= Name"); return -1; } =20 - if (pciopts->modelName =3D=3D VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME= _PNV_PHB3_ROOT_PORT && + if ((pciopts->modelName =3D=3D VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAM= E_PNV_PHB3_ROOT_PORT || + pciopts->modelName =3D=3D VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAM= E_PNV_PHB4_ROOT_PORT) && !qemuDomainIsPowerNV(def)) { virReportControllerInvalidValue(cont, model, modelName, "model= Name"); return -1; --=20 2.34.1