From nobody Tue Feb 10 19:14:24 2026 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 @@ - +
+ + + +
+ +
-