From nobody Fri May 3 09:57:37 2024 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 1511967548786847.1330110979367; Wed, 29 Nov 2017 06:59:08 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BB85B4E33A; Wed, 29 Nov 2017 14:59:07 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 810A25D976; Wed, 29 Nov 2017 14:59:07 +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 80BC64BB79; Wed, 29 Nov 2017 14:59:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id vATEx4V1014906 for ; Wed, 29 Nov 2017 09:59:04 -0500 Received: by smtp.corp.redhat.com (Postfix) id 606DC60C89; Wed, 29 Nov 2017 14:59:04 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id DAFA3609A5 for ; Wed, 29 Nov 2017 14:59:03 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 29 Nov 2017 15:58:54 +0100 Message-Id: <40e0a25e40303a7384421a2fcf6c438306020469.1511967132.git.jtomko@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/4] Move USER_ALIAS_PREFIX to the header file 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 29 Nov 2017 14:59:08 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Allow other parts of code to decide whether the alias is user-specified or not. --- src/conf/domain_conf.c | 3 +-- src/conf/domain_conf.h | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index b31917dad..41c94ed18 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -6656,7 +6656,6 @@ virDomainDeviceAddressParseXML(xmlNodePtr address, } =20 =20 -#define USER_ALIAS_PREFIX "ua-" #define USER_ALIAS_CHARS \ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-" =20 @@ -6713,7 +6712,7 @@ virDomainDeviceInfoParseXML(virDomainXMLOptionPtr xml= opt ATTRIBUTE_UNUSED, =20 if (!(flags & VIR_DOMAIN_DEF_PARSE_INACTIVE) || (xmlopt->config.features & VIR_DOMAIN_DEF_FEATURE_USER_ALIAS && - STRPREFIX(aliasStr, USER_ALIAS_PREFIX) && + STRPREFIX(aliasStr, VIR_DOMAIN_USER_ALIAS_PREFIX) && strspn(aliasStr, USER_ALIAS_CHARS) =3D=3D strlen(aliasStr))) VIR_STEAL_PTR(info->alias, aliasStr); } diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 48b07226e..afba0ede3 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -57,6 +57,8 @@ # include "virtypedparam.h" # include "virsavecookie.h" =20 +# define VIR_DOMAIN_USER_ALIAS_PREFIX "ua-" + /* forward declarations of all device types, required by * virDomainDeviceDef */ --=20 2.13.6 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 09:57:37 2024 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 151196754949527.46468492970598; Wed, 29 Nov 2017 06:59:09 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B927E6146F; Wed, 29 Nov 2017 14:59:07 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 81D8B60BE1; Wed, 29 Nov 2017 14:59:07 +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 03CCB3D380; Wed, 29 Nov 2017 14:59:05 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id vATEx5Xn014914 for ; Wed, 29 Nov 2017 09:59:05 -0500 Received: by smtp.corp.redhat.com (Postfix) id 56C8860C89; Wed, 29 Nov 2017 14:59:05 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id D162A60244 for ; Wed, 29 Nov 2017 14:59:04 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 29 Nov 2017 15:58:55 +0100 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/4] qemu: prefer the PCI bus alias from status XML 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 29 Nov 2017 14:59:08 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" For some corner cases, virQEMUCapsHasPCIMultiBus depends on the QEMU version, which is by desing not stored in the status XML and therefore it cannot be fixed for all existing running domains. Prefer the controller alias read from the status XML when formatting PCI addresses and only fall back to using virQEMUCapsHasPCIMultiBus if the alias is a user alias. This fixes hotplug after daemon restart for domains not using user aliases. https://bugzilla.redhat.com/show_bug.cgi?id=3D1518148 --- src/qemu/qemu_command.c | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index c78f1b83b..677cfc995 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -318,29 +318,31 @@ qemuBuildDeviceAddressStr(virBufferPtr buf, =20 if (cont->type =3D=3D VIR_DOMAIN_CONTROLLER_TYPE_PCI && cont->idx =3D=3D info->addr.pci.bus) { + contAlias =3D cont->info.alias; contIsPHB =3D virDomainControllerIsPSeriesPHB(cont); contTargetIndex =3D cont->opts.pciopts.targetIndex; =20 - /* When domain has builtin pci-root controller we don't pu= t it - * onto cmd line. Therefore we can't set its alias. In that - * case, use the default one. */ - if (!qemuDomainIsPSeries(domainDef) && - cont->model =3D=3D VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROO= T) { - if (virQEMUCapsHasPCIMultiBus(qemuCaps, domainDef)) - contAlias =3D "pci.0"; - else - contAlias =3D "pci"; - } else if (cont->model =3D=3D VIR_DOMAIN_CONTROLLER_MODEL_= PCIE_ROOT) { - contAlias =3D "pcie.0"; - } else { - contAlias =3D cont->info.alias; - if (!contAlias) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("Device alias was not set for PCI= " - "controller with index %u require= d " - "for device at address %s"), - info->addr.pci.bus, devStr); - goto cleanup; + if (!contAlias) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Device alias was not set for PCI " + "controller with index %u required " + "for device at address %s"), + info->addr.pci.bus, devStr); + goto cleanup; + } + + if (STRPREFIX(contAlias, VIR_DOMAIN_USER_ALIAS_PREFIX)) { + /* When domain has builtin pci-root controller we don'= t put it + * onto cmd line. Therefore we can't set its alias. In= that + * case, use the default one. */ + if (!qemuDomainIsPSeries(domainDef) && + cont->model =3D=3D VIR_DOMAIN_CONTROLLER_MODEL_PCI= _ROOT) { + if (virQEMUCapsHasPCIMultiBus(qemuCaps, domainDef)) + contAlias =3D "pci.0"; + else + contAlias =3D "pci"; + } else if (cont->model =3D=3D VIR_DOMAIN_CONTROLLER_MO= DEL_PCIE_ROOT) { + contAlias =3D "pcie.0"; } } break; --=20 2.13.6 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 09:57:37 2024 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 1511967584141707.066104049929; Wed, 29 Nov 2017 06:59:44 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3553D13A60; Wed, 29 Nov 2017 14:59:43 +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 0D2405C670; Wed, 29 Nov 2017 14:59:43 +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 C8FCA1800C87; Wed, 29 Nov 2017 14:59:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id vATEx62K014928 for ; Wed, 29 Nov 2017 09:59:06 -0500 Received: by smtp.corp.redhat.com (Postfix) id 2A6FA60C8A; Wed, 29 Nov 2017 14:59:06 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id A51BD60C89 for ; Wed, 29 Nov 2017 14:59:05 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 29 Nov 2017 15:58:56 +0100 Message-Id: <65f832e1d2d209e6a0adb6743487e9c07e72ac1f.1511967132.git.jtomko@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/4] virQEMUCapsHasPCIMultiBus: use def->os.arch 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 29 Nov 2017 14:59:43 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" We do not fill out qemuCaps->arch when parsing status XML. Use def->os.arch like we do for PPC. This fixes hotplug after daemon restart for domains that use a user alias for the implicit pci-root on x86. https://bugzilla.redhat.com/show_bug.cgi?id=3D1518148 --- src/qemu/qemu_capabilities.c | 2 +- tests/qemuhotplugtestcpus/ppc64-modern-bulk-result-live.xml | 2 +- tests/qemuhotplugtestcpus/ppc64-modern-individual-result-live.xml | 2 +- tests/qemuhotplugtestcpus/x86-modern-bulk-result-live.xml | 2 +- tests/qemuhotplugtestcpus/x86-modern-individual-add-result-live.xml | 2 +- tests/qemuhotplugtestcpus/x86-old-bulk-result-live.xml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index b5cfa70c5..c9d0a66d8 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2416,7 +2416,7 @@ bool virQEMUCapsHasPCIMultiBus(virQEMUCapsPtr qemuCap= s, { /* x86_64 and i686 support PCI-multibus on all machine types * since forever */ - if (ARCH_IS_X86(qemuCaps->arch)) + if (ARCH_IS_X86(def->os.arch)) return true; =20 if (def->os.arch =3D=3D VIR_ARCH_PPC || diff --git a/tests/qemuhotplugtestcpus/ppc64-modern-bulk-result-live.xml b/= tests/qemuhotplugtestcpus/ppc64-modern-bulk-result-live.xml index 662ed6739..43e626725 100644 --- a/tests/qemuhotplugtestcpus/ppc64-modern-bulk-result-live.xml +++ b/tests/qemuhotplugtestcpus/ppc64-modern-bulk-result-live.xml @@ -56,7 +56,7 @@
- + diff --git a/tests/qemuhotplugtestcpus/ppc64-modern-individual-result-live.= xml b/tests/qemuhotplugtestcpus/ppc64-modern-individual-result-live.xml index 866a81a2d..0a8d37214 100644 --- a/tests/qemuhotplugtestcpus/ppc64-modern-individual-result-live.xml +++ b/tests/qemuhotplugtestcpus/ppc64-modern-individual-result-live.xml @@ -56,7 +56,7 @@
- + diff --git a/tests/qemuhotplugtestcpus/x86-modern-bulk-result-live.xml b/te= sts/qemuhotplugtestcpus/x86-modern-bulk-result-live.xml index a025033e8..fe9a81a09 100644 --- a/tests/qemuhotplugtestcpus/x86-modern-bulk-result-live.xml +++ b/tests/qemuhotplugtestcpus/x86-modern-bulk-result-live.xml @@ -32,7 +32,7 @@
- + diff --git a/tests/qemuhotplugtestcpus/x86-modern-individual-add-result-liv= e.xml b/tests/qemuhotplugtestcpus/x86-modern-individual-add-result-live.xml index 8adcb7104..12b28be5f 100644 --- a/tests/qemuhotplugtestcpus/x86-modern-individual-add-result-live.xml +++ b/tests/qemuhotplugtestcpus/x86-modern-individual-add-result-live.xml @@ -32,7 +32,7 @@
- + diff --git a/tests/qemuhotplugtestcpus/x86-old-bulk-result-live.xml b/tests= /qemuhotplugtestcpus/x86-old-bulk-result-live.xml index b52f049fb..6f50bb5c1 100644 --- a/tests/qemuhotplugtestcpus/x86-old-bulk-result-live.xml +++ b/tests/qemuhotplugtestcpus/x86-old-bulk-result-live.xml @@ -22,7 +22,7 @@
- + --=20 2.13.6 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 09:57:37 2024 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 1511967584173369.2668381937232; Wed, 29 Nov 2017 06:59:44 -0800 (PST) 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 mx1.redhat.com (Postfix) with ESMTPS id 17604C070149; Wed, 29 Nov 2017 14:59:43 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EC4686031B; Wed, 29 Nov 2017 14:59:42 +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 BC5C53D385; Wed, 29 Nov 2017 14:59:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id vATEx7Th014942 for ; Wed, 29 Nov 2017 09:59:07 -0500 Received: by smtp.corp.redhat.com (Postfix) id 231FD60C89; Wed, 29 Nov 2017 14:59:07 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9F0D660244 for ; Wed, 29 Nov 2017 14:59:06 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 29 Nov 2017 15:58:57 +0100 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 4/4] virQEMUCapsHasPCIMultiBus: assume true if we have no version information 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 29 Nov 2017 14:59:43 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" In status XML, we do not store the QEMU version information, we only format all the capabilities. We dropped QEMU_CAPS_PCI_MULTIBUS in commit 5b783379 which was released in libvirt 3.2.0. Therefore the only way of telling if the already running domain at the time of daemon restart has been started with a QEMU that does use 'pci.0' or not on PPC is to look at the pci-root controller's alias. This is not an option if the domain has a user-specified alias for the pci-root. Instead of reintroducing the capability, assume 'pci.0' when we have no version information. That way the only left broken use case would be the combination of user aliases and very old QEMU. https://bugzilla.redhat.com/show_bug.cgi?id=3D1518148 Reviewed-by: Pavel Hrdina --- src/qemu/qemu_capabilities.c | 16 ++++++++-------- src/qemu/qemu_capspriv.h | 4 ---- tests/qemuxml2argvtest.c | 5 ----- 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index c9d0a66d8..7b52d1a71 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2436,6 +2436,14 @@ bool virQEMUCapsHasPCIMultiBus(virQEMUCapsPtr qemuCa= ps, * ppce500: 1.6.0 */ =20 + /* We do not store the qemu version in domain status XML. + * Hope the user is using a QEMU new enough to use 'pci.0', + * otherwise the results of this function will be wrong + * for domains already running at the time of daemon + * restart */ + if (qemuCaps->version =3D=3D 0) + return true; + if (qemuCaps->version >=3D 2000000) return true; =20 @@ -2487,14 +2495,6 @@ virArch virQEMUCapsGetArch(virQEMUCapsPtr qemuCaps) } =20 =20 -void -virQEMUCapsSetVersion(virQEMUCapsPtr qemuCaps, - unsigned int version) -{ - qemuCaps->version =3D version; -} - - unsigned int virQEMUCapsGetVersion(virQEMUCapsPtr qemuCaps) { return qemuCaps->version; diff --git a/src/qemu/qemu_capspriv.h b/src/qemu/qemu_capspriv.h index f23995ec6..219daa362 100644 --- a/src/qemu/qemu_capspriv.h +++ b/src/qemu/qemu_capspriv.h @@ -56,10 +56,6 @@ virQEMUCapsSetArch(virQEMUCapsPtr qemuCaps, virArch arch); =20 void -virQEMUCapsSetVersion(virQEMUCapsPtr qemuCaps, - unsigned int version); - -void virQEMUCapsInitHostCPUModel(virQEMUCapsPtr qemuCaps, virArch hostArch, virDomainVirtType type); diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index d3ac569e2..385a54615 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -384,11 +384,6 @@ testUpdateQEMUCaps(const struct testInfo *info, =20 virQEMUCapsInitQMPBasicArch(info->qemuCaps); =20 - /* We need to pretend QEMU 2.0.0 is in use so that pSeries guests - * will get the correct alias assigned to their buses. - * See virQEMUCapsHasPCIMultiBus() */ - virQEMUCapsSetVersion(info->qemuCaps, 2000000); - if (testAddCPUModels(info->qemuCaps, info->skipLegacyCPUs) < 0) goto cleanup; =20 --=20 2.13.6 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list