diff mbox

[v2] tests: add qemu x86 kvm 32-on-64 test

Message ID 57ec0b02fcac94aa470b8a1dbaeda08c5dffd4d0.1501776011.git.crobinso@redhat.com
State Accepted
Commit 21de51c3e26d2b5ca71f7891704b4f8cd8049b58
Headers show

Commit Message

Cole Robinson Aug. 3, 2017, 4 p.m. UTC
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

Signed-off-by: Cole Robinson <crobinso@redhat.com>

---
v2:
    Drop unnecessary qemu-kvm path usage

 .../qemuxml2argv-x86-kvm-32-on-64.args              | 21 +++++++++++++++++++++
 .../qemuxml2argv-x86-kvm-32-on-64.xml               | 13 +++++++++++++
 tests/qemuxml2argvtest.c                            |  1 +
 3 files changed, 35 insertions(+)
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-x86-kvm-32-on-64.args
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-x86-kvm-32-on-64.xml

-- 
2.13.3

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Comments

Ján Tomko Aug. 14, 2017, 3:28 p.m. UTC | #1
On Thu, Aug 03, 2017 at 12:00:42PM -0400, Cole Robinson wrote:
>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

>

>Signed-off-by: Cole Robinson <crobinso@redhat.com>

>---

>v2:

>    Drop unnecessary qemu-kvm path usage

>

> .../qemuxml2argv-x86-kvm-32-on-64.args              | 21 +++++++++++++++++++++

> .../qemuxml2argv-x86-kvm-32-on-64.xml               | 13 +++++++++++++

> tests/qemuxml2argvtest.c                            |  1 +

> 3 files changed, 35 insertions(+)

> create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-x86-kvm-32-on-64.args

> create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-x86-kvm-32-on-64.xml

>


ACK

Jan
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
diff mbox

Patch

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
index 000000000..5b644b0a6
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-x86-kvm-32-on-64.args
@@ -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
index 000000000..37f53bf2a
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-x86-kvm-32-on-64.xml
@@ -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>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index aa83013a2..f74d45ba0 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -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);