From nobody Sun Feb 8 13:09:46 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 1645622572854516.234647378239; Wed, 23 Feb 2022 05:22:52 -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-460-UmHjN_PrOgmQUMU8ThaVaQ-1; Wed, 23 Feb 2022 08:22:50 -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 EF9C2814616; Wed, 23 Feb 2022 13:22:41 +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 D39FF105C873; Wed, 23 Feb 2022 13:22:41 +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 A53D51807D61; Wed, 23 Feb 2022 13:22:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 21NDKTDH029813 for ; Wed, 23 Feb 2022 08:20:29 -0500 Received: by smtp.corp.redhat.com (Postfix) id A1DC440E80EC; Wed, 23 Feb 2022 13:20:29 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9CFD740E4308 for ; Wed, 23 Feb 2022 13:20:29 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.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 864F4802E5D for ; Wed, 23 Feb 2022 13:20:29 +0000 (UTC) Received: from mail-oi1-f174.google.com (mail-oi1-f174.google.com [209.85.167.174]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-358-qQQrf7pSMAqISWrcVLEZxg-2; Wed, 23 Feb 2022 08:20:27 -0500 Received: by mail-oi1-f174.google.com with SMTP id z7so2206561oid.4 for ; Wed, 23 Feb 2022 05:20:27 -0800 (PST) Received: from rekt.ibmuc.com ([191.193.99.92]) by smtp.gmail.com with ESMTPSA id a4sm27646154oaa.42.2022.02.23.05.20.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Feb 2022 05:20:27 -0800 (PST) X-MC-Unique: UmHjN_PrOgmQUMU8ThaVaQ-1 X-MC-Unique: qQQrf7pSMAqISWrcVLEZxg-2 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=CW6edVqtn9n6Ofc2GAT1bHVdD8AOuQkLPB1qlv1A/zI=; b=55gb9T+90Lb0Z1IMeujQq/RUu1aaIpPs6flMqlsVTpvyO2ZFuVFK0WrheuEBLG6Tq7 GEYnLx+hu26IKKH1nelH2KEy1mzhVsPK0enJkEs/jgPzjgTZD++M60c1HDvWihg18rEq bqeONChZyMEoBTy+5mz2GBZ298T9ZKth9wsjbNlpJpS7nk5ie1SvV5X3JWITiYCdGfL7 58HBLaM8SREGafnhCv99yTyqEKhlZMyIheAynW7Kj3Uu5hzjdqjEcNCn2M3Bx55vy4+T gVuoMfgoOZ8eNO3QI+AY3GxSKWMuRfeNjK88Z3YIQYfGl079mMUaZRyLs10UZl5iuL5+ YJyA== X-Gm-Message-State: AOAM531ElwRFUNEEuHNN55um8vHqJVQssZfymyqrczM79nP3baEIX26H O73FgTSJ2XR7g3rpBClhSmRJOgvLLK8= X-Google-Smtp-Source: ABdhPJzMLejKXR7YEBxxXJjqbjDftB2F3elZdMqbIPbAQ3A8PGIRKuHmzTa4t7X6Mu1ApYrgFTyeMA== X-Received: by 2002:a05:6808:30a3:b0:2d5:2019:97ac with SMTP id bl35-20020a05680830a300b002d5201997acmr4306399oib.40.1645622427302; Wed, 23 Feb 2022 05:20:27 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH v3 18/29] qemu_command.c: add command line for the pnv-phb3 device Date: Wed, 23 Feb 2022 10:19:41 -0300 Message-Id: <20220223131952.922228-19-danielhb413@gmail.com> In-Reply-To: <20220223131952.922228-1-danielhb413@gmail.com> References: <20220223131952.922228-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.84 on 10.11.54.2 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.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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1645622573467100008 The command line for the pnv-phb3 device is similar to the spapr-pci-host-bridge command line but adding the extra 'chip-id' attribute. Reviewed-by: J=C3=A1n Tomko Signed-off-by: Daniel Henrique Barboza --- src/qemu/qemu_command.c | 21 +++++++++++++++++-- .../powernv8-basic.ppc64-latest.args | 1 + 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index c836799888..5710fba0d9 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3135,6 +3135,22 @@ qemuBuildControllerPCIDevProps(virDomainControllerDe= f *def, =20 break; case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT: + if (!virDomainControllerIsPowerNVPHB(def)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Unsupported PCI Express root controller")); + return -1; + } + + if (virJSONValueObjectAdd(&props, + "s:driver", modelName, + "i:index", pciopts->targetIndex, + "i:chip-id", pciopts->chipId, + "s:id", def->info.alias, + NULL) < 0) + return -1; + + break; + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("Unsupported PCI Express root controller")); return -1; @@ -3322,8 +3338,9 @@ static bool qemuBuildSkipController(const virDomainControllerDef *controller, const virDomainDef *def) { - /* skip pcie-root */ - if (controller->type =3D=3D VIR_DOMAIN_CONTROLLER_TYPE_PCI && + /* skip pcie-root for non PowerVM domains */ + if (!qemuDomainIsPowerNV(def) && + controller->type =3D=3D VIR_DOMAIN_CONTROLLER_TYPE_PCI && controller->model =3D=3D VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT) return true; =20 diff --git a/tests/qemuxml2argvdata/powernv8-basic.ppc64-latest.args b/test= s/qemuxml2argvdata/powernv8-basic.ppc64-latest.args index c9616ded13..224e2adba8 100644 --- a/tests/qemuxml2argvdata/powernv8-basic.ppc64-latest.args +++ b/tests/qemuxml2argvdata/powernv8-basic.ppc64-latest.args @@ -26,6 +26,7 @@ XDG_CONFIG_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.config \ -rtc base=3Dutc \ -no-shutdown \ -boot strict=3Don \ +-device '{"driver":"pnv-phb3","index":0,"chip-id":0,"id":"pcie.0"}' \ -usb \ -chardev pty,id=3Dcharserial0 \ -device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","in= dex":0}' \ --=20 2.35.1