]> xenbits.xensource.com Git - libvirt.git/commitdiff
tests: Add negative test for Intel IOMMU
authorAndrea Bolognani <abologna@redhat.com>
Fri, 17 May 2019 14:37:56 +0000 (16:37 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Wed, 22 May 2019 12:54:32 +0000 (14:54 +0200)
Make sure validation is working as intended by trying to use
Intel IOMMU with the i440fx machine type, though we know it's
a q35-only feature, and expecting an error to be returned.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
tests/qemuxml2argvdata/intel-iommu-wrong-machine.xml [new file with mode: 0644]
tests/qemuxml2argvtest.c

diff --git a/tests/qemuxml2argvdata/intel-iommu-wrong-machine.xml b/tests/qemuxml2argvdata/intel-iommu-wrong-machine.xml
new file mode 100644 (file)
index 0000000..ab116f8
--- /dev/null
@@ -0,0 +1,24 @@
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219100</memory>
+  <currentMemory unit='KiB'>219100</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='x86_64' machine='pc'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu-system-x86_64</emulator>
+    <controller type='pci' index='0' model='pci-root'/>
+    <controller type='usb' index='0' model='none'/>
+    <input type='mouse' bus='ps2'/>
+    <input type='keyboard' bus='ps2'/>
+    <memballoon model='none'/>
+    <iommu model='intel'/>
+  </devices>
+</domain>
index 09d37eb4541eb55e2193d0738d6f1ad8dad9af1a..de74aa91fe7ae74b4845fcc450f5fa521eb13a0a 100644 (file)
@@ -2812,6 +2812,7 @@ mymain(void)
     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_FAILURE("intel-iommu-wrong-machine", NONE);
 
     DO_TEST("cpu-hotplug-startup", QEMU_CAPS_QUERY_HOTPLUGGABLE_CPUS);
     DO_TEST_PARSE_ERROR("cpu-hotplug-granularity",