From nobody Sat Feb 7 15:29:54 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 1643143817823191.24385096152412; 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-110-aOccyiCqMwOp-8uWnDubRw-1; Tue, 25 Jan 2022 15:50:15 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B24A41898296; 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 8BF5B56F65; 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 59E6B18033F6; Tue, 25 Jan 2022 20:50:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 20PKnxSs024302 for ; Tue, 25 Jan 2022 15:49:59 -0500 Received: by smtp.corp.redhat.com (Postfix) id 7BB9D7ADD; Tue, 25 Jan 2022 20:49:59 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast07.extmail.prod.ext.rdu2.redhat.com [10.11.55.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 77C477ADB for ; Tue, 25 Jan 2022 20:49:58 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.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 0BA103C11A0C for ; Tue, 25 Jan 2022 20:49:52 +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-446-4RvXAbwQPg27nHAWOs7cbw-1; Tue, 25 Jan 2022 15:49:44 -0500 Received: by mail-oi1-f181.google.com with SMTP id v67so15344799oie.9 for ; Tue, 25 Jan 2022 12:49:44 -0800 (PST) Received: from rekt.COMFAST ([191.8.61.226]) by smtp.gmail.com with ESMTPSA id ay32sm1368569oob.16.2022.01.25.12.49.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jan 2022 12:49:43 -0800 (PST) X-MC-Unique: aOccyiCqMwOp-8uWnDubRw-1 X-MC-Unique: 4RvXAbwQPg27nHAWOs7cbw-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=gaW5hpW+tRPPKw1BDwtfnSiOfQ/PgRYjKRS1s66y0uo=; b=rCKFumftxBPDENcfJh5AtepDo+y8DcuEDepUVUxEgTccncJu0pKYy8XH2B2YiTKoaM i0sCVRSG2VrhEDYhpJhxg35Yocd6mnBd5cAwUaUZ1uNcaVPepKBCwicA0nYgNDzR3laX jAefSnS6LwNb2bwwOk5Fnmhi8Gc/ejNGC+zVU1ECPhyimOqLfXUap2BSndAiJCRzqIGF JrDaV3WeddGH/RSmyIcU2m62JkhDy0v2gPWh9G7o7Aek5jPnJCG8ZrVnBJxI6iQEUvsN Bzg6/rePn9mhnVYxSskX8MfnZj3wNdQJaiM+EVm3Og4mx7lnmEiq13H6W5NVZY1JVD0F 3yew== X-Gm-Message-State: AOAM533XJjKjh+NspXubmU5n0Vy4h55IY22+0Lm71570IezVnprYucPo wSbPozAsoXUQ7WdqsuWyw421+gSCjFQ= X-Google-Smtp-Source: ABdhPJwdhtxlgLJ+2LjhOb5m1AqTptSW+OkBJMc/NdbP3YxP3g3eMbVnYDBWdUe4gSjbzJNr4CvhBw== X-Received: by 2002:a05:6808:1202:: with SMTP id a2mr1870589oil.57.1643143783634; Tue, 25 Jan 2022 12:49:43 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH v2 18/29] qemu_command.c: add command line for the pnv-phb3 device Date: Tue, 25 Jan 2022 17:48:51 -0300 Message-Id: <20220125204902.772350-19-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.79 on 10.11.54.5 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.11 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: 1643143820484100002 Content-Type: text/plain; charset="utf-8" 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. Signed-off-by: Daniel Henrique Barboza Reviewed-by: J=C3=A1n Tomko --- 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 2a1fe27297..afb3bf3612 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3221,6 +3221,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; @@ -3408,8 +3424,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.34.1