From nobody Wed Feb 11 10:16:30 2026 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.zoho.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 1489684470492898.9317620782142; Thu, 16 Mar 2017 10:14:30 -0700 (PDT) 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 978D97AE9E; Thu, 16 Mar 2017 17:14:29 +0000 (UTC) Received: from colo-mx.corp.redhat.com (unknown [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6AE7117F29; Thu, 16 Mar 2017 17:14:29 +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 1B8C34ED27; Thu, 16 Mar 2017 17:14:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v2GHEL4Z018195 for ; Thu, 16 Mar 2017 13:14:21 -0400 Received: by smtp.corp.redhat.com (Postfix) id F2B8817103; Thu, 16 Mar 2017 17:14:20 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.34.129.229]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4FF065C551 for ; Thu, 16 Mar 2017 17:14:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 978D97AE9E Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 978D97AE9E From: Andrea Bolognani To: libvir-list@redhat.com Date: Thu, 16 Mar 2017 18:14:10 +0100 Message-Id: <1489684451-9274-4-git-send-email-abologna@redhat.com> In-Reply-To: <1489684451-9274-1-git-send-email-abologna@redhat.com> References: <1489684451-9274-1-git-send-email-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 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-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.25]); Thu, 16 Mar 2017 17:14:30 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" We want pcie-root-ports to be used when available in QEMU, but at the same time we need to ensure that hosts running older QEMU releases keep working and that the user can override the default at any time. Add a comment for the original pcie-root-port test cases to make it clear how these new test cases are different. --- Changes from v1: * Don't change existing test cases; * Only test the new feature once. .../qemuxml2argv-pcie-root-port-model-generic.args | 22 ++++++++++++ .../qemuxml2argv-pcie-root-port-model-generic.xml | 22 ++++++++++++ .../qemuxml2argv-pcie-root-port-model-ioh3420.args | 21 ++++++++++++ .../qemuxml2argv-pcie-root-port-model-ioh3420.xml | 19 ++++++++++ tests/qemuxml2argvtest.c | 14 ++++++++ ...qemuxml2xmlout-pcie-root-port-model-generic.xml | 40 ++++++++++++++++++= ++++ ...qemuxml2xmlout-pcie-root-port-model-ioh3420.xml | 35 +++++++++++++++++++ tests/qemuxml2xmltest.c | 14 ++++++++ 8 files changed, 187 insertions(+) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-mode= l-generic.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-mode= l-generic.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-mode= l-ioh3420.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-mode= l-ioh3420.xml create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-pcie-root-port-= model-generic.xml create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-pcie-root-port-= model-ioh3420.xml diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-model-gener= ic.args b/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-model-generic.= args new file mode 100644 index 0000000..96239bd --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-model-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/bin/qemu-system-x86_64 \ +-name guest \ +-S \ +-M q35 \ +-m 2048 \ +-smp 2,sockets=3D2,cores=3D1,threads=3D1 \ +-uuid 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 \ +-nographic \ +-nodefaults \ +-monitor unix:/tmp/lib/domain--1-guest/monitor.sock,server,nowait \ +-no-acpi \ +-boot c \ +-device pcie-root-port,port=3D0x10,chassis=3D1,id=3Dpci.1,bus=3Dpcie.0,\ +multifunction=3Don,addr=3D0x2 \ +-device pcie-root-port,port=3D0x11,chassis=3D2,id=3Dpci.2,bus=3Dpcie.0,add= r=3D0x2.0x1 \ +-device ioh3420,port=3D0x12,chassis=3D3,id=3Dpci.3,bus=3Dpcie.0,addr=3D0x2= .0x2 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-model-gener= ic.xml b/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-model-generic.x= ml new file mode 100644 index 0000000..7acfb95 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-model-generic.xml @@ -0,0 +1,22 @@ + + guest + 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 + 2097152 + 2097152 + 2 + + hvm + + + /usr/bin/qemu-system-x86_64 + + + + + + + + + + + diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-model-ioh34= 20.args b/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-model-ioh3420.= args new file mode 100644 index 0000000..73f533b --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-model-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/bin/qemu-system-x86_64 \ +-name guest \ +-S \ +-M q35 \ +-m 2048 \ +-smp 2,sockets=3D2,cores=3D1,threads=3D1 \ +-uuid 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 \ +-nographic \ +-nodefaults \ +-monitor unix:/tmp/lib/domain--1-guest/monitor.sock,server,nowait \ +-no-acpi \ +-boot c \ +-device ioh3420,port=3D0x10,chassis=3D1,id=3Dpci.1,bus=3Dpcie.0,multifunct= ion=3Don,\ +addr=3D0x2 \ +-device ioh3420,port=3D0x11,chassis=3D2,id=3Dpci.2,bus=3Dpcie.0,addr=3D0x2= .0x1 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-model-ioh34= 20.xml b/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-model-ioh3420.x= ml new file mode 100644 index 0000000..4cba3f9 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pcie-root-port-model-ioh3420.xml @@ -0,0 +1,19 @@ + + guest + 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 + 2097152 + 2097152 + 2 + + hvm + + + /usr/bin/qemu-system-x86_64 + + + + + + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 5716509..4a66136 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2011,12 +2011,26 @@ mymain(void) QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_HDA_DUPLEX, QEMU_CAPS_USB_REDIR); + + /* Test automatic and manual setting of pcie-root-port attributes */ DO_TEST("pcie-root-port", QEMU_CAPS_DEVICE_IOH3420, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_DEVICE_QXL); + + /* Make sure the default model for PCIe Root Ports is picked correctly + * based on QEMU binary capabilities. We use x86/q35 for the test, but + * any PCIe machine type (such as aarch64/virt) will behave the same */ + DO_TEST("pcie-root-port-model-generic", + QEMU_CAPS_DEVICE_PCIE_ROOT_PORT, + QEMU_CAPS_DEVICE_IOH3420, + QEMU_CAPS_PCI_MULTIFUNCTION); + DO_TEST("pcie-root-port-model-ioh3420", + QEMU_CAPS_DEVICE_IOH3420, + QEMU_CAPS_PCI_MULTIFUNCTION); + DO_TEST("autoindex", QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pcie-root-port-model-g= eneric.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pcie-root-port-model-g= eneric.xml new file mode 100644 index 0000000..0de0d3e --- /dev/null +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pcie-root-port-model-generic.= xml @@ -0,0 +1,40 @@ + + guest + 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 + 2097152 + 2097152 + 2 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + + + +
+ + + + +
+ + + + +
+ + +
+ + + + + + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pcie-root-port-model-i= oh3420.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pcie-root-port-model-i= oh3420.xml new file mode 100644 index 0000000..3bbecf7 --- /dev/null +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pcie-root-port-model-ioh3420.= xml @@ -0,0 +1,35 @@ + + guest + 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 + 2097152 + 2097152 + 2 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + + + +
+ + + + +
+ + +
+ + + + + + diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index bf62dbb..7199175 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -884,12 +884,26 @@ mymain(void) QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_DEVICE_QXL); + + /* Test automatic and manual setting of pcie-root-port attributes */ DO_TEST("pcie-root-port", QEMU_CAPS_DEVICE_IOH3420, QEMU_CAPS_ICH9_AHCI, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_DEVICE_QXL); + + /* Make sure the default model for PCIe Root Ports is picked correctly + * based on QEMU binary capabilities. We use x86/q35 for the test, but + * any PCIe machine type (such as aarch64/virt) will behave the same */ + DO_TEST("pcie-root-port-model-generic", + QEMU_CAPS_DEVICE_PCIE_ROOT_PORT, + QEMU_CAPS_DEVICE_IOH3420, + QEMU_CAPS_PCI_MULTIFUNCTION); + DO_TEST("pcie-root-port-model-ioh3420", + QEMU_CAPS_DEVICE_IOH3420, + QEMU_CAPS_PCI_MULTIFUNCTION); + DO_TEST("pcie-switch-upstream-port", QEMU_CAPS_DEVICE_IOH3420, QEMU_CAPS_DEVICE_X3130_UPSTREAM, --=20 2.7.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list