[libvirt] [PATCH 2/8] tests: Use DO_TEST_CAPS_*() for Intel IOMMU

Ján Tomko jtomko at redhat.com
Tue May 21 14:15:01 UTC 2019


On Mon, May 20, 2019 at 01:37:47PM +0200, Andrea Bolognani wrote:
>Signed-off-by: Andrea Bolognani <abologna at redhat.com>
>---
> ...tel-iommu-caching-mode.x86_64-latest.args} | 15 ++++++---
> ...tel-iommu-device-iotlb.x86_64-latest.args} | 15 ++++++---
> ...rgs => intel-iommu-eim.x86_64-latest.args} | 15 ++++++---
> .../qemuxml2argvdata/intel-iommu-machine.args | 26 ---------------
> ... => intel-iommu-machine.x86_64-2.6.0.args} |  9 +++--
> .../qemuxml2argvdata/intel-iommu-machine.xml  |  2 +-
> ...mu.args => intel-iommu.x86_64-latest.args} | 15 ++++++---
> tests/qemuxml2argvtest.c                      | 33 ++++---------------
> ...ntel-iommu-caching-mode.x86_64-latest.xml} |  0
> ...ntel-iommu-device-iotlb.x86_64-latest.xml} |  0
> ....xml => intel-iommu-eim.x86_64-latest.xml} |  0
> ...l => intel-iommu-machine.x86_64-2.6.0.xml} |  0
> ...ommu.xml => intel-iommu.x86_64-latest.xml} |  0
> tests/qemuxml2xmltest.c                       | 15 +++------
> 14 files changed, 58 insertions(+), 87 deletions(-)
> rename tests/qemuxml2argvdata/{intel-iommu-device-iotlb.args => intel-iommu-caching-mode.x86_64-latest.args} (61%)
> copy tests/qemuxml2argvdata/{intel-iommu-caching-mode.args => intel-iommu-device-iotlb.x86_64-latest.args} (61%)
> rename tests/qemuxml2argvdata/{intel-iommu-eim.args => intel-iommu-eim.x86_64-latest.args} (62%)
> delete mode 100644 tests/qemuxml2argvdata/intel-iommu-machine.args
> rename tests/qemuxml2argvdata/{intel-iommu-caching-mode.args => intel-iommu-machine.x86_64-2.6.0.args} (73%)
> rename tests/qemuxml2argvdata/{intel-iommu.args => intel-iommu.x86_64-latest.args} (62%)
> rename tests/qemuxml2xmloutdata/{intel-iommu-caching-mode.xml => intel-iommu-caching-mode.x86_64-latest.xml} (100%)
> rename tests/qemuxml2xmloutdata/{intel-iommu-device-iotlb.xml => intel-iommu-device-iotlb.x86_64-latest.xml} (100%)
> rename tests/qemuxml2xmloutdata/{intel-iommu-eim.xml => intel-iommu-eim.x86_64-latest.xml} (100%)
> rename tests/qemuxml2xmloutdata/{intel-iommu-machine.xml => intel-iommu-machine.x86_64-2.6.0.xml} (100%)
> rename tests/qemuxml2xmloutdata/{intel-iommu.xml => intel-iommu.x86_64-latest.xml} (100%)
>
>diff --git a/tests/qemuxml2argvdata/intel-iommu-machine.xml b/tests/qemuxml2argvdata/intel-iommu-machine.xml
>index 90aba16156..85027cd938 100644
>--- a/tests/qemuxml2argvdata/intel-iommu-machine.xml
>+++ b/tests/qemuxml2argvdata/intel-iommu-machine.xml
>@@ -5,7 +5,7 @@
>   <currentMemory unit='KiB'>219100</currentMemory>
>   <vcpu placement='static'>1</vcpu>
>   <os>
>-    <type arch='x86_64' machine='q35'>hvm</type>
>+    <type arch='x86_64' machine='pc-q35-2.6'>hvm</type>

Given that this is the only difference between intel-iommu-machine.xml
and intel-iommu.xml, could you delete intel-iommu-machine.xml
and use DO_TEST_CAPS_VER with 2.6.0?

We won't be able to reuse the XML file due to only striping the machine
aliases for latest XML files, but it will show we use the same input
file.

>     <boot dev='hd'/>
>   </os>
>   <clock offset='utc'/>
>diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
>index edc19ace6f..1c2a2b3905 100644
>--- a/tests/qemuxml2argvtest.c
>+++ b/tests/qemuxml2argvtest.c
>@@ -2806,33 +2806,12 @@ mymain(void)
>                         QEMU_CAPS_USB_HUB);
>
>     DO_TEST("acpi-table", NONE);
>-    DO_TEST("intel-iommu",
>-            QEMU_CAPS_DEVICE_INTEL_IOMMU);
>-    DO_TEST("intel-iommu-machine",
>-            QEMU_CAPS_MACHINE_IOMMU);
>-    DO_TEST("intel-iommu-caching-mode",
>-            QEMU_CAPS_MACHINE_KERNEL_IRQCHIP,
>-            QEMU_CAPS_MACHINE_KERNEL_IRQCHIP_SPLIT,
>-            QEMU_CAPS_DEVICE_PCI_BRIDGE,
>-            QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE,
>-            QEMU_CAPS_DEVICE_IOH3420,
>-            QEMU_CAPS_ICH9_AHCI,
>-            QEMU_CAPS_ICH9_USB_EHCI1,
>-            QEMU_CAPS_DEVICE_INTEL_IOMMU,
>-            QEMU_CAPS_INTEL_IOMMU_INTREMAP,
>-            QEMU_CAPS_INTEL_IOMMU_CACHING_MODE);
>-    DO_TEST("intel-iommu-eim",
>-            QEMU_CAPS_MACHINE_KERNEL_IRQCHIP,
>-            QEMU_CAPS_MACHINE_KERNEL_IRQCHIP_SPLIT,
>-            QEMU_CAPS_INTEL_IOMMU_INTREMAP,
>-            QEMU_CAPS_INTEL_IOMMU_EIM,
>-            QEMU_CAPS_DEVICE_INTEL_IOMMU);
>-    DO_TEST("intel-iommu-device-iotlb",
>-            QEMU_CAPS_MACHINE_KERNEL_IRQCHIP,
>-            QEMU_CAPS_MACHINE_KERNEL_IRQCHIP_SPLIT,
>-            QEMU_CAPS_INTEL_IOMMU_INTREMAP,
>-            QEMU_CAPS_INTEL_IOMMU_DEVICE_IOTLB,
>-            QEMU_CAPS_DEVICE_INTEL_IOMMU);
>+
>+    DO_TEST_CAPS_LATEST("intel-iommu");
>+    DO_TEST_CAPS_VER("intel-iommu-machine", "2.6.0");
>+    DO_TEST_CAPS_LATEST("intel-iommu-caching-mode");
>+    DO_TEST_CAPS_LATEST("intel-iommu-eim");
>+    DO_TEST_CAPS_LATEST("intel-iommu-device-iotlb");
>
>     DO_TEST("cpu-hotplug-startup", QEMU_CAPS_QUERY_HOTPLUGGABLE_CPUS);
>     DO_TEST_PARSE_ERROR("cpu-hotplug-granularity",
>diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
>index 3b4d7efa52..f11ded4fb3 100644
>--- a/tests/qemuxml2xmltest.c
>+++ b/tests/qemuxml2xmltest.c
>@@ -1202,16 +1202,11 @@ mymain(void)
>             QEMU_CAPS_DEVICE_VIRTIO_GPU_CCW);
>     DO_TEST("video-none-device", NONE);
>
>-    DO_TEST("intel-iommu",
>-            QEMU_CAPS_DEVICE_INTEL_IOMMU);
>-    DO_TEST("intel-iommu-machine",
>-            QEMU_CAPS_MACHINE_IOMMU);
>-    DO_TEST("intel-iommu-caching-mode",
>-            QEMU_CAPS_DEVICE_PCI_BRIDGE,
>-            QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE,
>-            QEMU_CAPS_DEVICE_IOH3420);
>-    DO_TEST("intel-iommu-eim", NONE);
>-    DO_TEST("intel-iommu-device-iotlb", NONE);
>+    DO_TEST_CAPS_LATEST("intel-iommu");
>+    DO_TEST_CAPS_VER("intel-iommu-machine", "2.6.0");
>+    DO_TEST_CAPS_LATEST("intel-iommu-caching-mode");
>+    DO_TEST_CAPS_LATEST("intel-iommu-eim");
>+    DO_TEST_CAPS_LATEST("intel-iommu-device-iotlb");
>

Reviewed-by: Ján Tomko <jtomko at redhat.com>

Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20190521/4ff3cc4f/attachment-0001.sig>


More information about the libvir-list mailing list