From nobody Thu May 15 12:20:00 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1522245993267434.93072138984644; Wed, 28 Mar 2018 07:06:33 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id A13708047B; Wed, 28 Mar 2018 14:06:31 +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 5FF1E5D70A; Wed, 28 Mar 2018 14:06:31 +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 08D82180BAD5; Wed, 28 Mar 2018 14:06:31 +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 w2SE6L82027949 for ; Wed, 28 Mar 2018 10:06:21 -0400 Received: by smtp.corp.redhat.com (Postfix) id B3AEE215CDC7; Wed, 28 Mar 2018 14:06:21 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-204-126.brq.redhat.com [10.40.204.126]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 33521215CDC5 for ; Wed, 28 Mar 2018 14:06:20 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Wed, 28 Mar 2018 16:06:06 +0200 Message-Id: <20180328140610.8414-8-abologna@redhat.com> In-Reply-To: <20180328140610.8414-1-abologna@redhat.com> References: <20180328140610.8414-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 07/11] conf: Add virDomainPCIAddressSet.isPCIeToPCIBridgeSupported 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 28 Mar 2018 14:06:32 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Just like the existing areMultipleRootsSupported, this will allow us to change the results of the driver-agnostic PCI address allocation logic based on whether the QEMU binary supports certain features. Signed-off-by: Andrea Bolognani Reviewed-by: John Ferlan --- src/conf/domain_addr.h | 2 ++ src/qemu/qemu_domain_address.c | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/conf/domain_addr.h b/src/conf/domain_addr.h index 87248a4fb8..3236b7d6de 100644 --- a/src/conf/domain_addr.h +++ b/src/conf/domain_addr.h @@ -118,6 +118,8 @@ struct _virDomainPCIAddressSet { and addresses aren't saved in device infos */ /* If true, the guest can have multiple pci-root controllers */ bool areMultipleRootsSupported; + /* If true, the guest can use the pcie-to-pci-bridge controller */ + bool isPCIeToPCIBridgeSupported; }; typedef struct _virDomainPCIAddressSet virDomainPCIAddressSet; typedef virDomainPCIAddressSet *virDomainPCIAddressSetPtr; diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index 86d9807908..7fe9d5926c 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -1338,6 +1338,7 @@ qemuDomainCollectPCIAddress(virDomainDefPtr def ATTRI= BUTE_UNUSED, =20 static virDomainPCIAddressSetPtr qemuDomainPCIAddressSetCreate(virDomainDefPtr def, + virQEMUCapsPtr qemuCaps, unsigned int nbuses, bool dryRun) { @@ -1355,6 +1356,9 @@ qemuDomainPCIAddressSetCreate(virDomainDefPtr def, if (qemuDomainIsPSeries(def)) addrs->areMultipleRootsSupported =3D true; =20 + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_PCIE_PCI_BRIDGE)) + addrs->isPCIeToPCIBridgeSupported =3D true; + for (i =3D 0; i < def->ncontrollers; i++) { virDomainControllerDefPtr cont =3D def->controllers[i]; size_t idx =3D cont->idx; @@ -2361,7 +2365,7 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def, =20 if (nbuses > 0) { /* 1st pass to figure out how many PCI bridges we need */ - if (!(addrs =3D qemuDomainPCIAddressSetCreate(def, nbuses, true))) + if (!(addrs =3D qemuDomainPCIAddressSetCreate(def, qemuCaps, nbuse= s, true))) goto cleanup; =20 if (qemuDomainValidateDevicePCISlotsChipsets(def, qemuCaps, @@ -2491,7 +2495,7 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def, addrs =3D NULL; } =20 - if (!(addrs =3D qemuDomainPCIAddressSetCreate(def, nbuses, false))) + if (!(addrs =3D qemuDomainPCIAddressSetCreate(def, qemuCaps, nbuses, f= alse))) goto cleanup; =20 if (qemuDomainSupportsPCI(def, qemuCaps)) { --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list