From: Andrea Bolognani Date: Thu, 7 Oct 2021 17:44:26 +0000 (+0200) Subject: tests: Add test for virtio-iommu address X-Git-Tag: v8.3.0-rc1~196 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e0156069846ab61e04c4505b9b41ac8fdf3e3598;p=thirdparty%2Flibvirt.git tests: Add test for virtio-iommu address virtio-iommu needs to be an integrated device, and our address assignment code will make sure that is the case. If the user has provided an explicit address, however, we should make sure any addresses pointing to a different bus are rejected. Signed-off-by: Andrea Bolognani Reviewed-by: Ján Tomko --- diff --git a/tests/qemuxml2argvdata/virtio-iommu-invalid-address.x86_64-latest.err b/tests/qemuxml2argvdata/virtio-iommu-invalid-address.x86_64-latest.err new file mode 100644 index 0000000000..997948e91f --- /dev/null +++ b/tests/qemuxml2argvdata/virtio-iommu-invalid-address.x86_64-latest.err @@ -0,0 +1 @@ +XML error: The device at PCI address 0000:01:00.0 needs to be an integrated device (bus=0) diff --git a/tests/qemuxml2argvdata/virtio-iommu-invalid-address.xml b/tests/qemuxml2argvdata/virtio-iommu-invalid-address.xml new file mode 100644 index 0000000000..0daa58e3e7 --- /dev/null +++ b/tests/qemuxml2argvdata/virtio-iommu-invalid-address.xml @@ -0,0 +1,20 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 1 + + hvm + + + + + + /usr/bin/qemu-system-x86_64 + + + +
+ + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index f6ce8e0200..44b71b48e4 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -3253,6 +3253,7 @@ mymain(void) DO_TEST_CAPS_LATEST_PARSE_ERROR("virtio-iommu-wrong-machine"); DO_TEST_CAPS_LATEST_PARSE_ERROR("virtio-iommu-no-acpi"); DO_TEST_CAPS_LATEST_PARSE_ERROR("virtio-iommu-invalid-address-type"); + DO_TEST_CAPS_LATEST_PARSE_ERROR("virtio-iommu-invalid-address"); DO_TEST("cpu-hotplug-startup", QEMU_CAPS_QUERY_HOTPLUGGABLE_CPUS); DO_TEST_PARSE_ERROR("cpu-hotplug-granularity",