]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Add test cases for gic-version option
authorPavel Fedin <p.fedin@samsung.com>
Wed, 30 Sep 2015 11:04:11 +0000 (14:04 +0300)
committerMartin Kletzander <mkletzan@redhat.com>
Fri, 2 Oct 2015 14:14:26 +0000 (16:14 +0200)
These tests make sure that we can use this option only when the capability is
set.

Signed-off-by: Pavel Fedin <p.fedin@samsung.com>
tests/qemuxml2argvdata/qemuxml2argv-aarch64-gicv3.args [new file with mode: 0644]
tests/qemuxml2argvdata/qemuxml2argv-aarch64-gicv3.xml [new file with mode: 0644]
tests/qemuxml2argvtest.c

diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gicv3.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gicv3.args
new file mode 100644 (file)
index 0000000..3d8732f
--- /dev/null
@@ -0,0 +1,7 @@
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-aarch64 -S -machine virt,accel=tcg,gic-version=3 \
+-cpu cortex-a53 -m 1024 -smp 1 \
+-nographic -nodefaults -monitor unix:/tmp/test-monitor,server,nowait -boot c \
+-kernel /aarch64.kernel -initrd /aarch64.initrd -append console=ttyAMA0 -usb \
+-net nic,macaddr=52:54:00:09:a4:37,vlan=0,model=virtio,name=net0 \
+-net user,vlan=0,name=hostnet0
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gicv3.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gicv3.xml
new file mode 100644 (file)
index 0000000..f8d63c3
--- /dev/null
@@ -0,0 +1,26 @@
+<domain type="qemu">
+  <name>aarch64test</name>
+  <uuid>6ba410c5-1e5c-4d57-bee7-2228e7ffa32f</uuid>
+  <memory>1048576</memory>
+  <currentMemory>1048576</currentMemory>
+  <vcpu>1</vcpu>
+  <features>
+    <acpi/>
+    <gic version='3'/>
+  </features>
+  <cpu match='exact'>
+    <model>cortex-a53</model>
+  </cpu>
+  <os>
+    <type arch="aarch64" machine="virt">hvm</type>
+    <kernel>/aarch64.kernel</kernel>
+    <initrd>/aarch64.initrd</initrd>
+    <cmdline>console=ttyAMA0</cmdline>
+  </os>
+  <devices>
+    <emulator>/usr/bin/qemu-system-aarch64</emulator>
+    <interface type='user'>
+      <mac address='52:54:00:09:a4:37'/>
+    </interface>
+  </devices>
+</domain>
index ae6777931173caa98dee33e7d8073a702abf8671..e6bf2f17863893ec4d3997f481458189b28f6797 100644 (file)
@@ -1644,6 +1644,11 @@ mymain(void)
             QEMU_CAPS_CPU_HOST, QEMU_CAPS_KVM);
     DO_TEST("aarch64-gic", QEMU_CAPS_DEVICE, QEMU_CAPS_DRIVE,
             QEMU_CAPS_KVM);
+    DO_TEST("aarch64-gicv3", QEMU_CAPS_DEVICE, QEMU_CAPS_DRIVE,
+            QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT,
+            QEMU_CAPS_MACH_VIRT_GIC_VERSION);
+    DO_TEST_FAILURE("aarch64-gicv3", QEMU_CAPS_DEVICE, QEMU_CAPS_DRIVE,
+            QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT);
 
     driver.caps->host.cpu->arch = VIR_ARCH_AARCH64;
     DO_TEST("aarch64-kvm-32-on-64", QEMU_CAPS_DEVICE, QEMU_CAPS_DRIVE,