From nobody Mon Apr 29 12:56:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.37 as permitted sender) client-ip=209.132.183.37; envelope-from=libvir-list-bounces@redhat.com; helo=mx5-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.37 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx5-phx2.redhat.com (mx5-phx2.redhat.com [209.132.183.37]) by mx.zohomail.com with SMTPS id 1489510944632237.2669814813827; Tue, 14 Mar 2017 10:02:24 -0700 (PDT) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx5-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v2EGwv96011354; Tue, 14 Mar 2017 12:58:57 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v2EGwscp002790 for ; Tue, 14 Mar 2017 12:58:54 -0400 Received: from inaba.usersys.redhat.com ([10.34.129.229]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v2EGwptl021778 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 14 Mar 2017 12:58:53 -0400 From: Andrea Bolognani To: libvir-list@redhat.com Date: Tue, 14 Mar 2017 17:58:45 +0100 Message-Id: <1489510728-25923-2-git-send-email-abologna@redhat.com> In-Reply-To: <1489510728-25923-1-git-send-email-abologna@redhat.com> References: <1489510728-25923-1-git-send-email-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/4] qemu: Add support for generic PCIe Root Ports 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" QEMU 2.9 introduces the pcie-root-port device, which is a generic version of the existing ioh3420 device. Make the new device available to libvirt users. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1408808 --- docs/schemas/domaincommon.rng | 1 + src/conf/domain_conf.c | 4 +++- src/conf/domain_conf.h | 1 + src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_command.c | 18 +++++++++++++++--- tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml | 1 + 7 files changed, 24 insertions(+), 4 deletions(-) diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 5e59328..e4cf990 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -1904,6 +1904,7 @@ i82801b11-bridge ioh3420 + pcie-root-port x3130-upstream diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 88d419e..f110c31 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -338,7 +338,9 @@ VIR_ENUM_IMPL(virDomainControllerPCIModelName, "x3130-upstream", "xio3130-downstream", "pxb", - "pxb-pcie") + "pxb-pcie", + "pcie-root-port", +); =20 VIR_ENUM_IMPL(virDomainControllerModelSCSI, VIR_DOMAIN_CONTROLLER_MODEL_SC= SI_LAST, "auto", diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index b788a82..72901ca 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -694,6 +694,7 @@ typedef enum { VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_XIO3130_DOWNSTREAM, VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PXB, VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PXB_PCIE, + VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PCIE_ROOT_PORT, =20 VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_LAST } virDomainControllerPCIModelName; diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 70f9ed7..453bc8a 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -359,6 +359,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, "query-cpu-model-expansion", /* 245 */ "virtio-net.host_mtu", "spice-rendernode", + "pcie-root-port", ); =20 =20 @@ -1619,6 +1620,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[= ] =3D { { "ivshmem-plain", QEMU_CAPS_DEVICE_IVSHMEM_PLAIN }, { "ivshmem-doorbell", QEMU_CAPS_DEVICE_IVSHMEM_DOORBELL }, { "vhost-scsi", QEMU_CAPS_DEVICE_VHOST_SCSI }, + { "pcie-root-port", QEMU_CAPS_DEVICE_PCIE_ROOT_PORT }, }; =20 static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBalloon[]= =3D { diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index cc9f46e..79de977 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -394,6 +394,7 @@ typedef enum { QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION, /* qmp query-cpu-model-expansion = */ QEMU_CAPS_VIRTIO_NET_HOST_MTU, /* virtio-net-*.host_mtu */ QEMU_CAPS_SPICE_RENDERNODE, /* -spice rendernode */ + QEMU_CAPS_DEVICE_PCIE_ROOT_PORT, /* -device pcie-root-port */ =20 QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index b484b7b..7e5f727 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -2874,20 +2874,32 @@ qemuBuildControllerDevStr(const virDomainDef *domai= nDef, def->opts.pciopts.modelName); goto error; } - if (def->opts.pciopts.modelName - !=3D VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_IOH3420) { + if ((def->opts.pciopts.modelName !=3D + VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_IOH3420) && + (def->opts.pciopts.modelName !=3D + VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PCIE_ROOT_PORT)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("PCI controller model name '%s' " "is not valid for a pcie-root-port"), modelName); goto error; } - if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_IOH3420)) { + if ((def->opts.pciopts.modelName =3D=3D + VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_IOH3420) && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_IOH3420)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("the pcie-root-port (ioh3420) " "controller is not supported in this QEMU= binary")); goto error; } + if ((def->opts.pciopts.modelName =3D=3D + VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PCIE_ROOT_PORT) && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_PCIE_ROOT_PORT)= ) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("the pcie-root-port (pcie-root-port) " + "controller is not supported in this QEMU= binary")); + goto error; + } =20 virBufferAsprintf(&buf, "%s,port=3D0x%x,chassis=3D%d,id=3D%s", modelName, def->opts.pciopts.port, diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_2.9.0.x86_64.xml index 334f8e7..a397615 100644 --- a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml @@ -202,6 +202,7 @@ + 2008050 0 (v2.8.0-1961-g5b10b94bd5) --=20 2.7.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 12:56:33 2024 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 1489510951008933.3029989158039; Tue, 14 Mar 2017 10:02:31 -0700 (PDT) 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 v2EGwwaU022310; Tue, 14 Mar 2017 12:58:58 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v2EGwsn9002798 for ; Tue, 14 Mar 2017 12:58:54 -0400 Received: from inaba.usersys.redhat.com ([10.34.129.229]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v2EGwptm021778 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 14 Mar 2017 12:58:54 -0400 From: Andrea Bolognani To: libvir-list@redhat.com Date: Tue, 14 Mar 2017 17:58:46 +0100 Message-Id: <1489510728-25923-3-git-send-email-abologna@redhat.com> In-Reply-To: <1489510728-25923-1-git-send-email-abologna@redhat.com> References: <1489510728-25923-1-git-send-email-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/4] qemu: Use generic PCIe Root Ports by default for aarch64/virt 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" ioh3420 is emulated Intel hardware, so it always looked quite out of place in aarch64/virt guests. If pcie-root-port is available in QEMU, use that device instead. --- It was mentioned somewhere, at some point, that we might want to switch to generic PCIe Root Ports for x86/q35 guests as well. It sounds like a good idea to me, and in fact QEMU's sample configuration files for x86/q35 (docs/q35-virtio-*.cfg) already push in that direction; however, I didn't want to risk holding up the aarch64/virt change, which we unquestionably want, because of that, so I will propose it as a separate patch further down the line. src/qemu/qemu_domain_address.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index 64aa4ef..bd2f718 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -1846,13 +1846,16 @@ qemuDomainSupportsPCI(virDomainDefPtr def, =20 =20 static void -qemuDomainPCIControllerSetDefaultModelName(virDomainControllerDefPtr cont) +qemuDomainPCIControllerSetDefaultModelName(virDomainControllerDefPtr cont, + virDomainDefPtr def, + virQEMUCapsPtr qemuCaps) { int *modelName =3D &cont->opts.pciopts.modelName; =20 /* make sure it's not already set */ if (*modelName !=3D VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE) return; + switch ((virDomainControllerModelPCI)cont->model) { case VIR_DOMAIN_CONTROLLER_MODEL_PCI_BRIDGE: *modelName =3D VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PCI_BRIDGE; @@ -1861,7 +1864,13 @@ qemuDomainPCIControllerSetDefaultModelName(virDomain= ControllerDefPtr cont) *modelName =3D VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_I82801B11_BRID= GE; break; case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT_PORT: - *modelName =3D VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_IOH3420; + /* Use generic PCIe Root Ports for mach-virt guests, if available = */ + if (qemuDomainMachineIsVirt(def) && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_PCIE_ROOT_PORT)) { + *modelName =3D VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PCIE_ROOT_= PORT; + } else { + *modelName =3D VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_IOH3420; + } break; case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_SWITCH_UPSTREAM_PORT: *modelName =3D VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_X3130_UPSTREAM; @@ -2143,7 +2152,7 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def, * device in qemu) for any controller that doesn't yet * have it set. */ - qemuDomainPCIControllerSetDefaultModelName(cont); + qemuDomainPCIControllerSetDefaultModelName(cont, def, qemuCaps= ); =20 /* set defaults for any other auto-generated config * options for this controller that haven't been --=20 2.7.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 12:56:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.37 as permitted sender) client-ip=209.132.183.37; envelope-from=libvir-list-bounces@redhat.com; helo=mx5-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.37 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx5-phx2.redhat.com (mx5-phx2.redhat.com [209.132.183.37]) by mx.zohomail.com with SMTPS id 1489510963133800.0980038523402; Tue, 14 Mar 2017 10:02:43 -0700 (PDT) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx5-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v2EGwvsn011361; Tue, 14 Mar 2017 12:58:57 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v2EGwt8I002805 for ; Tue, 14 Mar 2017 12:58:55 -0400 Received: from inaba.usersys.redhat.com ([10.34.129.229]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v2EGwptn021778 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 14 Mar 2017 12:58:55 -0400 From: Andrea Bolognani To: libvir-list@redhat.com Date: Tue, 14 Mar 2017 17:58:47 +0100 Message-Id: <1489510728-25923-4-git-send-email-abologna@redhat.com> In-Reply-To: <1489510728-25923-1-git-send-email-abologna@redhat.com> References: <1489510728-25923-1-git-send-email-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/4] tests: Test generic PCIe Root Ports 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" We want pcie-root-ports to be used for aarch64/virt guests when available in QEMU, but at the same time we need to ensure that other machine type and hosts where QEMU releases lacking the new device type are not affected. --- ...uxml2argv-pcie-root-port-mach-virt-generic.args | 22 +++++++++++++ ...muxml2argv-pcie-root-port-mach-virt-generic.xml | 22 +++++++++++++ ...uxml2argv-pcie-root-port-mach-virt-ioh3420.args | 21 ++++++++++++ ...muxml2argv-pcie-root-port-mach-virt-ioh3420.xml | 19 +++++++++++ ...t.args =3D> qemuxml2argv-pcie-root-port-q35.args} | 7 ++-- .../qemuxml2argv-pcie-root-port-q35.xml | 23 +++++++++++++ .../qemuxml2argv-pcie-root-port.xml | 36 ------------------= -- tests/qemuxml2argvtest.c | 27 ++++++++++++--- ...xml2xmlout-pcie-root-port-mach-virt-generic.xml | 38 ++++++++++++++++++= ++++ ...xml2xmlout-pcie-root-port-mach-virt-ioh3420.xml | 33 +++++++++++++++++++ ...t.xml =3D> qemuxml2xmlout-pcie-root-port-q35.xml} | 19 +++++------ tests/qemuxml2xmltest.c | 22 ++++++++++--- 12 files changed, 227 insertions(+), 62 deletions(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-mach= -virt-generic.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-mach= -virt-generic.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-mach= -virt-ioh3420.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-mach= -virt-ioh3420.xml rename tests/qemuxml2argvdata/{qemuxml2argv-pcie-root-port.args =3D> qemux= ml2argv-pcie-root-port-q35.args} (59%) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-q35.= xml delete mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port.xml create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-pcie-root-port-= mach-virt-generic.xml create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-pcie-root-port-= mach-virt-ioh3420.xml rename tests/qemuxml2xmloutdata/{qemuxml2xmlout-pcie-root-port.xml =3D> qe= muxml2xmlout-pcie-root-port-q35.xml} (71%) diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-mach-virt-g= eneric.args b/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-mach-virt-= generic.args new file mode 100644 index 0000000..b0ae8b2 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-mach-virt-generic.= args @@ -0,0 +1,22 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/libexec/qemu-kvm \ +-name mach-virt-test \ +-S \ +-M virt \ +-m 2048 \ +-smp 2,sockets=3D2,cores=3D1,threads=3D1 \ +-uuid 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 \ +-nographic \ +-nodefaults \ +-monitor unix:/tmp/lib/domain--1-mach-virt-test/monitor.sock,server,nowait= \ +-no-acpi \ +-boot c \ +-device pcie-root-port,port=3D0x8,chassis=3D1,id=3Dpci.1,bus=3Dpcie.0,mult= ifunction=3Don,\ +addr=3D0x1 \ +-device ioh3420,port=3D0x9,chassis=3D2,id=3Dpci.2,bus=3Dpcie.0,addr=3D0x1.= 0x1 \ +-device pcie-root-port,port=3D0xa,chassis=3D3,id=3Dpci.3,bus=3Dpcie.0,addr= =3D0x1.0x2 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-mach-virt-g= eneric.xml b/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-mach-virt-g= eneric.xml new file mode 100644 index 0000000..950397a --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-mach-virt-generic.= xml @@ -0,0 +1,22 @@ + + mach-virt-test + 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 + 2097152 + 2097152 + 2 + + hvm + + + /usr/libexec/qemu-kvm + + + + + + + + + + + diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-mach-virt-i= oh3420.args b/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-mach-virt-= ioh3420.args new file mode 100644 index 0000000..a57cdfd --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-mach-virt-ioh3420.= args @@ -0,0 +1,21 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/libexec/qemu-kvm \ +-name mach-virt-test \ +-S \ +-M virt \ +-m 2048 \ +-smp 2,sockets=3D2,cores=3D1,threads=3D1 \ +-uuid 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 \ +-nographic \ +-nodefaults \ +-monitor unix:/tmp/lib/domain--1-mach-virt-test/monitor.sock,server,nowait= \ +-no-acpi \ +-boot c \ +-device ioh3420,port=3D0x8,chassis=3D1,id=3Dpci.1,bus=3Dpcie.0,multifuncti= on=3Don,\ +addr=3D0x1 \ +-device ioh3420,port=3D0x9,chassis=3D2,id=3Dpci.2,bus=3Dpcie.0,addr=3D0x1.= 0x1 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-mach-virt-i= oh3420.xml b/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-mach-virt-i= oh3420.xml new file mode 100644 index 0000000..897547b --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-mach-virt-ioh3420.= xml @@ -0,0 +1,19 @@ + + mach-virt-test + 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 + 2097152 + 2097152 + 2 + + hvm + + + /usr/libexec/qemu-kvm + + + + + + + + diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port.args b/test= s/qemuxml2argvdata/qemuxml2argv-pcie-root-port-q35.args similarity index 59% rename from tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port.args rename to tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-q35.args index 4e852ff..2e9d8da 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-q35.args @@ -18,8 +18,5 @@ QEMU_AUDIO_DRV=3Dnone \ -boot c \ -device ioh3420,port=3D0x10,chassis=3D1,id=3Dpci.1,bus=3Dpcie.0,multifunct= ion=3Don,\ addr=3D0x2 \ --device ioh3420,port=3D0x1a,chassis=3D40,id=3Dpci.2,bus=3Dpcie.0,addr=3D0x= 2.0x1 \ --drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-sat= a0-0-0 \ --device ide-drive,bus=3Dide.0,drive=3Ddrive-sata0-0-0,id=3Dsata0-0-0 \ --device qxl-vga,id=3Dvideo0,ram_size=3D67108864,vram_size=3D33554432,bus= =3Dpcie.0,\ -addr=3D0x1 +-device ioh3420,port=3D0x11,chassis=3D2,id=3Dpci.2,bus=3Dpcie.0,addr=3D0x2= .0x1 \ +-device pcie-root-port,port=3D0x12,chassis=3D3,id=3Dpci.3,bus=3Dpcie.0,add= r=3D0x2.0x2 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-q35.xml b/t= ests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-q35.xml new file mode 100644 index 0000000..1102919 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-q35.xml @@ -0,0 +1,23 @@ + + q35-test + 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 + 2097152 + 2097152 + 2 + + hvm + + + /usr/libexec/qemu-kvm + + + + + + + + + + + + diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port.xml b/tests= /qemuxml2argvdata/qemuxml2argv-pcie-root-port.xml deleted file mode 100644 index 7ecc4a6..0000000 --- a/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port.xml +++ /dev/null @@ -1,36 +0,0 @@ - - q35-test - 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 - 2097152 - 2097152 - 2 - - hvm - - - - destroy - restart - destroy - - /usr/libexec/qemu-kvm - - - -
- - - - - - - - - - - - - - diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 6bd7465..db4da95 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2011,12 +2011,15 @@ mymain(void) QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_HDA_DUPLEX, QEMU_CAPS_USB_REDIR); - DO_TEST("pcie-root-port", + + /* Make sure the default model for PCIe Root Ports is picked correctly + * according to architecture, machine type and binary capabilities; al= so + * make sure that the user can override the default */ + DO_TEST("pcie-root-port-q35", QEMU_CAPS_DEVICE_IOH3420, - QEMU_CAPS_ICH9_AHCI, - QEMU_CAPS_PCI_MULTIFUNCTION, - QEMU_CAPS_DEVICE_VIDEO_PRIMARY, - QEMU_CAPS_DEVICE_QXL); + QEMU_CAPS_DEVICE_PCIE_ROOT_PORT, + QEMU_CAPS_PCI_MULTIFUNCTION); + DO_TEST("autoindex", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, @@ -2294,6 +2297,20 @@ mymain(void) DO_TEST_FAILURE("aarch64-kvm-32-on-64", QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_DEVICE_VIRTIO_MMIO, QEMU_CAPS_KVM); + + /* Make sure the default model for PCIe Root Ports is picked correctly + * according to architecture, machine type and binary capabilities; al= so + * make sure that the user can override the default */ + DO_TEST("pcie-root-port-mach-virt-generic", + QEMU_CAPS_OBJECT_GPEX, + QEMU_CAPS_DEVICE_IOH3420, + QEMU_CAPS_DEVICE_PCIE_ROOT_PORT, + QEMU_CAPS_PCI_MULTIFUNCTION); + DO_TEST("pcie-root-port-mach-virt-ioh3420", + QEMU_CAPS_OBJECT_GPEX, + QEMU_CAPS_DEVICE_IOH3420, + QEMU_CAPS_PCI_MULTIFUNCTION); + qemuTestSetHostArch(driver.caps, VIR_ARCH_NONE); =20 DO_TEST("kvm-pit-delay", QEMU_CAPS_KVM_PIT_TICK_POLICY); diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pcie-root-port-mach-vi= rt-generic.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pcie-root-port-mac= h-virt-generic.xml new file mode 100644 index 0000000..0eabafd --- /dev/null +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pcie-root-port-mach-virt-gene= ric.xml @@ -0,0 +1,38 @@ + + mach-virt-test + 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 + 2097152 + 2097152 + 2 + + hvm + + + + + + + destroy + restart + destroy + + /usr/libexec/qemu-kvm + + + + +
+ + + + +
+ + + + +
+ + + + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pcie-root-port-mach-vi= rt-ioh3420.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pcie-root-port-mac= h-virt-ioh3420.xml new file mode 100644 index 0000000..6c80d2a --- /dev/null +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pcie-root-port-mach-virt-ioh3= 420.xml @@ -0,0 +1,33 @@ + + mach-virt-test + 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 + 2097152 + 2097152 + 2 + + hvm + + + + + + + destroy + restart + destroy + + /usr/libexec/qemu-kvm + + + + +
+ + + + +
+ + + + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pcie-root-port.xml b/t= ests/qemuxml2xmloutdata/qemuxml2xmlout-pcie-root-port-q35.xml similarity index 71% rename from tests/qemuxml2xmloutdata/qemuxml2xmlout-pcie-root-port.xml rename to tests/qemuxml2xmloutdata/qemuxml2xmlout-pcie-root-port-q35.xml index 5775eb9..0e6bb98 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pcie-root-port.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pcie-root-port-q35.xml @@ -3,7 +3,7 @@ 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 2097152 2097152 - 2 + 2 hvm @@ -14,11 +14,6 @@ destroy /usr/libexec/qemu-kvm - - - -
- @@ -27,18 +22,20 @@ - +
+ + + +
+ +
-