]> xenbits.xensource.com Git - libvirt.git/commitdiff
tests: add qemu x86 kvm 32-on-64 test
authorCole Robinson <crobinso@redhat.com>
Thu, 13 Jul 2017 15:32:41 +0000 (11:32 -0400)
committerCole Robinson <crobinso@redhat.com>
Wed, 16 Aug 2017 20:07:23 +0000 (16:07 -0400)
There's some specific logic in qemuBuildCpuCommandLine to support
auto adding -cpu qemu 32 for arch=i686 with an x86_64 qemu binary.
Add a test case for it

tests/qemuxml2argvdata/qemuxml2argv-x86-kvm-32-on-64.args [new file with mode: 0644]
tests/qemuxml2argvdata/qemuxml2argv-x86-kvm-32-on-64.xml [new file with mode: 0644]
tests/qemuxml2argvtest.c

diff --git a/tests/qemuxml2argvdata/qemuxml2argv-x86-kvm-32-on-64.args b/tests/qemuxml2argvdata/qemuxml2argv-x86-kvm-32-on-64.args
new file mode 100644 (file)
index 0000000..5b644b0
--- /dev/null
@@ -0,0 +1,21 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-x86_64 \
+-name kvm \
+-S \
+-machine pc,accel=kvm \
+-cpu qemu32 \
+-m 4096 \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid d091ea82-29e6-2e34-3005-f02617b36e87 \
+-nographic \
+-nodefaults \
+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-kvm/monitor.sock,server,\
+nowait \
+-mon chardev=charmonitor,id=monitor,mode=readline \
+-no-acpi \
+-boot c
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-x86-kvm-32-on-64.xml b/tests/qemuxml2argvdata/qemuxml2argv-x86-kvm-32-on-64.xml
new file mode 100644 (file)
index 0000000..37f53bf
--- /dev/null
@@ -0,0 +1,13 @@
+<domain type='kvm'>
+  <name>kvm</name>
+  <uuid>d091ea82-29e6-2e34-3005-f02617b36e87</uuid>
+  <memory unit='KiB'>4194304</memory>
+  <os>
+    <type arch='i686'>hvm</type>
+  </os>
+  <devices>
+    <emulator>/usr/bin/qemu-system-x86_64</emulator>
+    <controller type='usb' model='none'/>
+    <memballoon model='none'/>
+  </devices>
+</domain>
index 9938052310af73f3c2e2e8185e1da6c000396675..77cfe8d28fd135cf7d50482d5efc05fa14b1002f 100644 (file)
@@ -709,6 +709,7 @@ mymain(void)
     DO_TEST("kvm", QEMU_CAPS_MACHINE_OPT);
     DO_TEST("default-kvm-host-arch", QEMU_CAPS_MACHINE_OPT);
     DO_TEST("default-qemu-host-arch", QEMU_CAPS_MACHINE_OPT);
+    DO_TEST("x86-kvm-32-on-64", QEMU_CAPS_MACHINE_OPT);
     DO_TEST("boot-cdrom", NONE);
     DO_TEST("boot-network", NONE);
     DO_TEST("boot-floppy", NONE);