From nobody Mon Feb 9 09:22:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.25 as permitted sender) client-ip=209.132.183.25; envelope-from=libvir-list-bounces@redhat.com; helo=mx4-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.25 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) by mx.zohomail.com with SMTPS id 1487707295369735.715090010652; Tue, 21 Feb 2017 12:01:35 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v1LJw8fi031921; Tue, 21 Feb 2017 14:58:08 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v1LJvsW7020772 for ; Tue, 21 Feb 2017 14:57:54 -0500 Received: from inaba.usersys.redhat.com (ovpn-204-99.brq.redhat.com [10.40.204.99]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1LJvjbG002979 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 21 Feb 2017 14:57:53 -0500 From: Andrea Bolognani To: libvir-list@redhat.com Date: Tue, 21 Feb 2017 20:57:43 +0100 Message-Id: <1487707064-29602-6-git-send-email-abologna@redhat.com> In-Reply-To: <1487707064-29602-1-git-send-email-abologna@redhat.com> References: <1487707064-29602-1-git-send-email-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 5/6] qemu: Allow multiple bridges when pci-bridges is not available 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-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" qemuDomainAssignPCIAddresses() hardcoded the assumption that the only way to support devices on a non-zero bus is to add one or more pci-bridges; however, since we now support a large selection of PCI controllers that can be used instead, the assumption is no longer true. Moreover, this check was always redundant, because the only sensible time to check for the availability of pci-bridge is when building the QEMU command line, and such a check is of course already in place. In fact, there were *two* such checks, but since one of the two was relying on the incorrect assumption explained above, and it was redundant anyway, it has been dropped. --- src/qemu/qemu_command.c | 7 ------- src/qemu/qemu_domain_address.c | 10 +--------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index f0b938f..0ff1e7d 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -342,13 +342,6 @@ qemuBuildDeviceAddressStr(virBufferPtr buf, } } =20 - if (info->addr.pci.bus !=3D 0 && - !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_PCI_BRIDGE)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("Multiple PCI buses are not supported " - "with this QEMU binary")); - goto cleanup; - } virBufferAsprintf(buf, ",bus=3D%s", contAlias); =20 if (info->addr.pci.multi =3D=3D VIR_TRISTATE_SWITCH_ON) diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index 5b75044..f8995c9 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -1983,9 +1983,7 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def, if (qemuDomainFillAllPCIConnectFlags(def, qemuCaps, driver) < 0) goto cleanup; =20 - if (nbuses > 0 && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_PCI_BRIDGE)) { - + if (nbuses > 0) { /* 1st pass to figure out how many PCI bridges we need */ if (!(addrs =3D qemuDomainPCIAddressSetCreate(def, nbuses, true))) goto cleanup; @@ -2109,12 +2107,6 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def, nbuses =3D addrs->nbuses; virDomainPCIAddressSetFree(addrs); addrs =3D NULL; - - } else if (max_idx > 0) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("PCI bridges are not supported " - "by this QEMU binary")); - goto cleanup; } =20 if (!(addrs =3D qemuDomainPCIAddressSetCreate(def, nbuses, false))) --=20 2.7.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list