From nobody Sun Feb 8 01:30:07 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 1642686823482278.31554752137254; Thu, 20 Jan 2022 05:53:43 -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-373-1eOig1eDPhKiSk2mcqqYhQ-1; Thu, 20 Jan 2022 08:53:40 -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 CC4601091DAD; Thu, 20 Jan 2022 13:53:34 +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 A79C47E412; Thu, 20 Jan 2022 13:53:34 +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 68B1E181844C; Thu, 20 Jan 2022 13:53:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 20KDrSXb009165 for ; Thu, 20 Jan 2022 08:53:28 -0500 Received: by smtp.corp.redhat.com (Postfix) id C291D40F9D74; Thu, 20 Jan 2022 13:53:28 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast10.extmail.prod.ext.rdu2.redhat.com [10.11.55.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BE22B40F9D73 for ; Thu, 20 Jan 2022 13:53:28 +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 A60DC1C00F66 for ; Thu, 20 Jan 2022 13:53:28 +0000 (UTC) Received: from mail-oi1-f169.google.com (mail-oi1-f169.google.com [209.85.167.169]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-144-D33gSe_HPq2z4fO6WWLM8Q-4; Thu, 20 Jan 2022 08:53:26 -0500 Received: by mail-oi1-f169.google.com with SMTP id g205so8952076oif.5 for ; Thu, 20 Jan 2022 05:53:26 -0800 (PST) Received: from rekt.COMFAST ([191.8.61.226]) by smtp.gmail.com with ESMTPSA id a26sm1574102oiy.26.2022.01.20.05.53.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jan 2022 05:53:26 -0800 (PST) X-MC-Unique: 1eOig1eDPhKiSk2mcqqYhQ-1 X-MC-Unique: D33gSe_HPq2z4fO6WWLM8Q-4 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=0ADgNk9AgZw+O7TAK2uedfF7xWhS+zBAxUMcojwcmRE=; b=psAbIgA5gqGGnDcTDpXZCa/uR5wn+nemNk30cJ0Q2NLCTpILqbgKmBdh3RvTo67y3/ keDqahX3f8L3iaQNput1dhSlN+KpTrWfVn6SdP6ynSxOJp4yDPkDjemRlHtLZbvGqjcs oCAQjd6l/1KCNasIRHkau04MInWZpuF0yW7TAbxY4r25S0yfMdHYMkRl6FiYqa2gSzEp UJRD+UD7XkkdeMoQ8I646h8VSMZS0WKNzCiU3BOpBLBLEsd3r9/LZAA9CzjoKmDZs5Xb GMYPfaZwovDdEqV479cR7IBHrxH+4DwVQ1Zh2pcUrvulC+CSnzuyUemUof59ma+SUirl DzQQ== X-Gm-Message-State: AOAM533dH5sC873i1YtQ0ARRxfYyrp9+NSLkUXlytM/nAjNqqZUYlha+ pOreroAfYxwNCSlakw1IE0MqQ+M92oI= X-Google-Smtp-Source: ABdhPJwMEKDpLb+kx6hYMD5hw+D4sIm6C4PwCAOEkDDHgJ+lS+x2Bad/vGYx0+W3V+vAzCms9RQYfA== X-Received: by 2002:aca:4bd2:: with SMTP id y201mr7428754oia.150.1642686806524; Thu, 20 Jan 2022 05:53:26 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH 21/33] qemu_command.c: add command line for the pnv-phb3 device Date: Thu, 20 Jan 2022 10:52:24 -0300 Message-Id: <20220120135236.719924-22-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.84 on 10.11.54.1 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.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: 1642686825059100001 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 --- src/qemu/qemu_command.c | 21 +++++++++++++++++++-- tests/qemuxml2argvdata/powernv8-basic.args | 1 + 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 60b4f96e06..1948eff91f 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3220,6 +3220,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; @@ -3407,8 +3423,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.args b/tests/qemuxml2arg= vdata/powernv8-basic.args index 822cf62bdf..aa81454b08 100644 --- a/tests/qemuxml2argvdata/powernv8-basic.args +++ b/tests/qemuxml2argvdata/powernv8-basic.args @@ -25,6 +25,7 @@ QEMU_AUDIO_DRV=3Dnone \ -rtc base=3Dutc \ -no-shutdown \ -boot strict=3Don \ +-device pnv-phb3,index=3D0,chip-id=3D0,id=3Dpcie.0 \ -usb \ -chardev pty,id=3Dcharserial0 \ -device isa-serial,chardev=3Dcharserial0,id=3Dserial0,index=3D0 \ --=20 2.34.1