6d3351
From 2281fa3a645d077431375a77eacf53ba878101b7 Mon Sep 17 00:00:00 2001
6d3351
Message-Id: <2281fa3a645d077431375a77eacf53ba878101b7@dist-git>
6d3351
From: Andrea Bolognani <abologna@redhat.com>
6d3351
Date: Tue, 4 Apr 2017 14:59:32 +0200
6d3351
Subject: [PATCH] tests: Test ACPI, UEFI requirements
6d3351
6d3351
Make sure every combination of ACPI and UEFI works, or fails to
6d3351
work, as expected.
6d3351
6d3351
(cherry picked from commit deb38c4503597a8e0b3e74c6112ef28a15b072c8)
6d3351
6d3351
Downstream changes:
6d3351
6d3351
 * tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-nouefi.args,
6d3351
   tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-uefi.args,
6d3351
   tests/qemuxml2argvdata/qemuxml2argv-q35-noacpi-nouefi.args:
6d3351
6d3351
   - add RTM and HLE flags to Haswell CPU so that the test
6d3351
     suite can pass.
6d3351
6d3351
Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1429509
6d3351
6d3351
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
6d3351
---
6d3351
 .../qemuxml2argv-aarch64-acpi-nouefi.args          | 22 +++++++++++++++++++++
6d3351
 .../qemuxml2argv-aarch64-acpi-nouefi.xml           | 22 +++++++++++++++++++++
6d3351
 .../qemuxml2argv-aarch64-acpi-uefi.args            | 22 +++++++++++++++++++++
6d3351
 .../qemuxml2argv-aarch64-acpi-uefi.xml             | 21 ++++++++++++++++++++
6d3351
 .../qemuxml2argv-aarch64-noacpi-nouefi.args        | 22 +++++++++++++++++++++
6d3351
 .../qemuxml2argv-aarch64-noacpi-nouefi.xml         | 19 ++++++++++++++++++
6d3351
 .../qemuxml2argv-aarch64-noacpi-uefi.args          | 23 ++++++++++++++++++++++
6d3351
 .../qemuxml2argv-aarch64-noacpi-uefi.xml           | 18 +++++++++++++++++
6d3351
 .../qemuxml2argv-q35-acpi-nouefi.args              | 21 ++++++++++++++++++++
6d3351
 .../qemuxml2argv-q35-acpi-nouefi.xml               | 22 +++++++++++++++++++++
6d3351
 .../qemuxml2argv-q35-acpi-uefi.args                | 22 +++++++++++++++++++++
6d3351
 .../qemuxml2argv-q35-acpi-uefi.xml                 | 21 ++++++++++++++++++++
6d3351
 .../qemuxml2argv-q35-noacpi-nouefi.args            | 22 +++++++++++++++++++++
6d3351
 .../qemuxml2argv-q35-noacpi-nouefi.xml             | 19 ++++++++++++++++++
6d3351
 .../qemuxml2argv-q35-noacpi-uefi.xml               | 18 +++++++++++++++++
6d3351
 tests/qemuxml2argvtest.c                           | 14 +++++++++++++
6d3351
 16 files changed, 328 insertions(+)
6d3351
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-aarch64-acpi-nouefi.args
6d3351
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-aarch64-acpi-nouefi.xml
6d3351
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-aarch64-acpi-uefi.args
6d3351
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-aarch64-acpi-uefi.xml
6d3351
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-aarch64-noacpi-nouefi.args
6d3351
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-aarch64-noacpi-nouefi.xml
6d3351
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-aarch64-noacpi-uefi.args
6d3351
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-aarch64-noacpi-uefi.xml
6d3351
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-nouefi.args
6d3351
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-nouefi.xml
6d3351
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-uefi.args
6d3351
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-uefi.xml
6d3351
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-q35-noacpi-nouefi.args
6d3351
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-q35-noacpi-nouefi.xml
6d3351
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-q35-noacpi-uefi.xml
6d3351
6d3351
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-acpi-nouefi.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-acpi-nouefi.args
6d3351
new file mode 100644
6d3351
index 000000000..5d9e1fb7c
6d3351
--- /dev/null
6d3351
+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-acpi-nouefi.args
6d3351
@@ -0,0 +1,22 @@
6d3351
+LC_ALL=C \
6d3351
+PATH=/bin \
6d3351
+HOME=/home/test \
6d3351
+USER=test \
6d3351
+LOGNAME=test \
6d3351
+QEMU_AUDIO_DRV=none \
6d3351
+/usr/bin/qemu-system-aarch64 \
6d3351
+-name guest \
6d3351
+-S \
6d3351
+-M virt \
6d3351
+-cpu host \
6d3351
+-m 1024 \
6d3351
+-smp 1,sockets=1,cores=1,threads=1 \
6d3351
+-uuid 496d7ea8-9739-544b-4ebd-ef08be936e8b \
6d3351
+-nographic \
6d3351
+-nodefconfig \
6d3351
+-nodefaults \
6d3351
+-monitor unix:/tmp/lib/domain--1-guest/monitor.sock,server,nowait \
6d3351
+-boot c \
6d3351
+-kernel /var/lib/libvirt/images/guest.vmlinux \
6d3351
+-initrd /var/lib/libvirt/images/guest.initramfs \
6d3351
+-append 'console=ttyAMA0 rw root=/dev/vda rootwait'
6d3351
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-acpi-nouefi.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-acpi-nouefi.xml
6d3351
new file mode 100644
6d3351
index 000000000..cda1b1bdc
6d3351
--- /dev/null
6d3351
+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-acpi-nouefi.xml
6d3351
@@ -0,0 +1,22 @@
6d3351
+<domain type='qemu'>
6d3351
+  <name>guest</name>
6d3351
+  <uuid>496d7ea8-9739-544b-4ebd-ef08be936e8b</uuid>
6d3351
+  <memory unit='KiB'>1048576</memory>
6d3351
+  <vcpu placement='static'>1</vcpu>
6d3351
+  <os>
6d3351
+    <type arch='aarch64' machine='virt'>hvm</type>
6d3351
+    <kernel>/var/lib/libvirt/images/guest.vmlinuz</kernel>
6d3351
+    <initrd>/var/lib/libvirt/images/guest.initramfs</initrd>
6d3351
+    <cmdline>console=ttyAMA0 rw root=/dev/vda rootwait</cmdline>
6d3351
+  </os>
6d3351
+  <features>
6d3351
+    <acpi/>
6d3351
+  </features>
6d3351
+  <cpu mode='custom'>
6d3351
+    <model>cortex-a57</model>
6d3351
+  </cpu>
6d3351
+  <devices>
6d3351
+    <emulator>/usr/bin/qemu-system-aarch64</emulator>
6d3351
+    <memballoon model='none'/>
6d3351
+  </devices>
6d3351
+</domain>
6d3351
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-acpi-uefi.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-acpi-uefi.args
6d3351
new file mode 100644
6d3351
index 000000000..36371ba02
6d3351
--- /dev/null
6d3351
+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-acpi-uefi.args
6d3351
@@ -0,0 +1,22 @@
6d3351
+LC_ALL=C \
6d3351
+PATH=/bin \
6d3351
+HOME=/home/test \
6d3351
+USER=test \
6d3351
+LOGNAME=test \
6d3351
+QEMU_AUDIO_DRV=none \
6d3351
+/usr/bin/qemu-system-aarch64 \
6d3351
+-name guest \
6d3351
+-S \
6d3351
+-M virt \
6d3351
+-cpu cortex-a57 \
6d3351
+-drive file=/usr/share/AAVMF/AAVMF_CODE.fd,if=pflash,format=raw,unit=0,\
6d3351
+readonly=on \
6d3351
+-drive file=/var/lib/libvirt/qemu/nvram/guest_VARS.fd,if=pflash,format=raw,\
6d3351
+unit=1 \
6d3351
+-m 1024 \
6d3351
+-smp 1,sockets=1,cores=1,threads=1 \
6d3351
+-uuid 496d7ea8-9739-544b-4ebd-ef08be936e8b \
6d3351
+-nographic \
6d3351
+-nodefaults \
6d3351
+-monitor unix:/tmp/lib/domain--1-guest/monitor.sock,server,nowait \
6d3351
+-boot c
6d3351
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-acpi-uefi.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-acpi-uefi.xml
6d3351
new file mode 100644
6d3351
index 000000000..5de2eb5d3
6d3351
--- /dev/null
6d3351
+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-acpi-uefi.xml
6d3351
@@ -0,0 +1,21 @@
6d3351
+<domain type='qemu'>
6d3351
+  <name>guest</name>
6d3351
+  <uuid>496d7ea8-9739-544b-4ebd-ef08be936e8b</uuid>
6d3351
+  <memory unit='KiB'>1048576</memory>
6d3351
+  <vcpu placement='static'>1</vcpu>
6d3351
+  <os>
6d3351
+    <type arch='aarch64' machine='virt'>hvm</type>
6d3351
+    <loader readonly='yes' type='pflash'>/usr/share/AAVMF/AAVMF_CODE.fd</loader>
6d3351
+    <nvram>/var/lib/libvirt/qemu/nvram/guest_VARS.fd</nvram>
6d3351
+  </os>
6d3351
+  <features>
6d3351
+    <acpi/>
6d3351
+  </features>
6d3351
+  <cpu mode='custom'>
6d3351
+    <model>cortex-a57</model>
6d3351
+  </cpu>
6d3351
+  <devices>
6d3351
+    <emulator>/usr/bin/qemu-system-aarch64</emulator>
6d3351
+    <memballoon model='none'/>
6d3351
+  </devices>
6d3351
+</domain>
6d3351
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-noacpi-nouefi.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-noacpi-nouefi.args
6d3351
new file mode 100644
6d3351
index 000000000..301eda89e
6d3351
--- /dev/null
6d3351
+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-noacpi-nouefi.args
6d3351
@@ -0,0 +1,22 @@
6d3351
+LC_ALL=C \
6d3351
+PATH=/bin \
6d3351
+HOME=/home/test \
6d3351
+USER=test \
6d3351
+LOGNAME=test \
6d3351
+QEMU_AUDIO_DRV=none \
6d3351
+/usr/bin/qemu-system-aarch64 \
6d3351
+-name guest \
6d3351
+-S \
6d3351
+-M virt \
6d3351
+-cpu cortex-a57 \
6d3351
+-m 1024 \
6d3351
+-smp 1,sockets=1,cores=1,threads=1 \
6d3351
+-uuid 496d7ea8-9739-544b-4ebd-ef08be936e8b \
6d3351
+-nographic \
6d3351
+-nodefaults \
6d3351
+-monitor unix:/tmp/lib/domain--1-guest/monitor.sock,server,nowait \
6d3351
+-no-acpi \
6d3351
+-boot c \
6d3351
+-kernel /var/lib/libvirt/images/guest.vmlinuz \
6d3351
+-initrd /var/lib/libvirt/images/guest.initramfs \
6d3351
+-append 'console=ttyAMA0 rw root=/dev/vda rootwait'
6d3351
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-noacpi-nouefi.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-noacpi-nouefi.xml
6d3351
new file mode 100644
6d3351
index 000000000..e8551ed2d
6d3351
--- /dev/null
6d3351
+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-noacpi-nouefi.xml
6d3351
@@ -0,0 +1,19 @@
6d3351
+<domain type='qemu'>
6d3351
+  <name>guest</name>
6d3351
+  <uuid>496d7ea8-9739-544b-4ebd-ef08be936e8b</uuid>
6d3351
+  <memory unit='KiB'>1048576</memory>
6d3351
+  <vcpu placement='static'>1</vcpu>
6d3351
+  <os>
6d3351
+    <type arch='aarch64' machine='virt'>hvm</type>
6d3351
+    <kernel>/var/lib/libvirt/images/guest.vmlinuz</kernel>
6d3351
+    <initrd>/var/lib/libvirt/images/guest.initramfs</initrd>
6d3351
+    <cmdline>console=ttyAMA0 rw root=/dev/vda rootwait</cmdline>
6d3351
+  </os>
6d3351
+  <cpu mode='custom'>
6d3351
+    <model>cortex-a57</model>
6d3351
+  </cpu>
6d3351
+  <devices>
6d3351
+    <emulator>/usr/bin/qemu-system-aarch64</emulator>
6d3351
+    <memballoon model='none'/>
6d3351
+  </devices>
6d3351
+</domain>
6d3351
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-noacpi-uefi.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-noacpi-uefi.args
6d3351
new file mode 100644
6d3351
index 000000000..c62de750f
6d3351
--- /dev/null
6d3351
+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-noacpi-uefi.args
6d3351
@@ -0,0 +1,23 @@
6d3351
+LC_ALL=C \
6d3351
+PATH=/bin \
6d3351
+HOME=/home/test \
6d3351
+USER=test \
6d3351
+LOGNAME=test \
6d3351
+QEMU_AUDIO_DRV=none \
6d3351
+/usr/bin/qemu-system-aarch64 \
6d3351
+-name guest \
6d3351
+-S \
6d3351
+-M virt \
6d3351
+-cpu cortex-a57 \
6d3351
+-drive file=/usr/share/AAVMF/AAVMF_CODE.fd,if=pflash,format=raw,unit=0,\
6d3351
+readonly=on \
6d3351
+-drive file=/var/lib/libvirt/qemu/nvram/guest_VARS.fd,if=pflash,format=raw,\
6d3351
+unit=1 \
6d3351
+-m 1024 \
6d3351
+-smp 1,sockets=1,cores=1,threads=1 \
6d3351
+-uuid 496d7ea8-9739-544b-4ebd-ef08be936e8b \
6d3351
+-nographic \
6d3351
+-nodefaults \
6d3351
+-monitor unix:/tmp/lib/domain--1-guest/monitor.sock,server,nowait \
6d3351
+-no-acpi \
6d3351
+-boot c
6d3351
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-noacpi-uefi.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-noacpi-uefi.xml
6d3351
new file mode 100644
6d3351
index 000000000..e66b805da
6d3351
--- /dev/null
6d3351
+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-noacpi-uefi.xml
6d3351
@@ -0,0 +1,18 @@
6d3351
+<domain type='qemu'>
6d3351
+  <name>guest</name>
6d3351
+  <uuid>496d7ea8-9739-544b-4ebd-ef08be936e8b</uuid>
6d3351
+  <memory unit='KiB'>1048576</memory>
6d3351
+  <vcpu placement='static'>1</vcpu>
6d3351
+  <os>
6d3351
+    <type arch='aarch64' machine='virt'>hvm</type>
6d3351
+    <loader readonly='yes' type='pflash'>/usr/share/AAVMF/AAVMF_CODE.fd</loader>
6d3351
+    <nvram>/var/lib/libvirt/qemu/nvram/guest_VARS.fd</nvram>
6d3351
+  </os>
6d3351
+  <cpu mode='custom'>
6d3351
+    <model>cortex-a57</model>
6d3351
+  </cpu>
6d3351
+  <devices>
6d3351
+    <emulator>/usr/bin/qemu-system-aarch64</emulator>
6d3351
+    <memballoon model='none'/>
6d3351
+  </devices>
6d3351
+</domain>
6d3351
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-nouefi.args b/tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-nouefi.args
6d3351
new file mode 100644
6d3351
index 000000000..531520b0a
6d3351
--- /dev/null
6d3351
+++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-nouefi.args
6d3351
@@ -0,0 +1,21 @@
6d3351
+LC_ALL=C \
6d3351
+PATH=/bin \
6d3351
+HOME=/home/test \
6d3351
+USER=test \
6d3351
+LOGNAME=test \
6d3351
+QEMU_AUDIO_DRV=none \
6d3351
+/usr/bin/qemu-system-x86_64 \
6d3351
+-name guest \
6d3351
+-S \
6d3351
+-M q35 \
6d3351
+-cpu Haswell,+rtm,+hle \
6d3351
+-m 1024 \
6d3351
+-smp 1,sockets=1,cores=1,threads=1 \
6d3351
+-uuid 496d7ea8-9739-544b-4ebd-ef08be936e8b \
6d3351
+-nographic \
6d3351
+-nodefaults \
6d3351
+-monitor unix:/tmp/lib/domain--1-guest/monitor.sock,server,nowait \
6d3351
+-boot c \
6d3351
+-kernel /var/lib/libvirt/images/guest.vmlinuz \
6d3351
+-initrd /var/lib/libvirt/images/guest.initramfs \
6d3351
+-append 'rw root=/dev/vda rootwait'
6d3351
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-nouefi.xml b/tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-nouefi.xml
6d3351
new file mode 100644
6d3351
index 000000000..7d735f99c
6d3351
--- /dev/null
6d3351
+++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-nouefi.xml
6d3351
@@ -0,0 +1,22 @@
6d3351
+<domain type='qemu'>
6d3351
+  <name>guest</name>
6d3351
+  <uuid>496d7ea8-9739-544b-4ebd-ef08be936e8b</uuid>
6d3351
+  <memory unit='KiB'>1048576</memory>
6d3351
+  <vcpu placement='static'>1</vcpu>
6d3351
+  <os>
6d3351
+    <type arch='x86_64' machine='q35'>hvm</type>
6d3351
+    <kernel>/var/lib/libvirt/images/guest.vmlinuz</kernel>
6d3351
+    <initrd>/var/lib/libvirt/images/guest.initramfs</initrd>
6d3351
+    <cmdline>rw root=/dev/vda rootwait</cmdline>
6d3351
+  </os>
6d3351
+  <features>
6d3351
+    <acpi/>
6d3351
+  </features>
6d3351
+  <cpu mode='custom'>
6d3351
+    <model>Haswell</model>
6d3351
+  </cpu>
6d3351
+  <devices>
6d3351
+    <emulator>/usr/bin/qemu-system-x86_64</emulator>
6d3351
+    <memballoon model='none'/>
6d3351
+  </devices>
6d3351
+</domain>
6d3351
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-uefi.args b/tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-uefi.args
6d3351
new file mode 100644
6d3351
index 000000000..4dd99676e
6d3351
--- /dev/null
6d3351
+++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-uefi.args
6d3351
@@ -0,0 +1,22 @@
6d3351
+LC_ALL=C \
6d3351
+PATH=/bin \
6d3351
+HOME=/home/test \
6d3351
+USER=test \
6d3351
+LOGNAME=test \
6d3351
+QEMU_AUDIO_DRV=none \
6d3351
+/usr/bin/qemu-system-x86_64 \
6d3351
+-name guest \
6d3351
+-S \
6d3351
+-M q35 \
6d3351
+-cpu Haswell,+rtm,+hle \
6d3351
+-drive file=/usr/share/OVMF/OVMF_CODE.fd,if=pflash,format=raw,unit=0,\
6d3351
+readonly=on \
6d3351
+-drive file=/var/lib/libvirt/qemu/nvram/guest_VARS.fd,if=pflash,format=raw,\
6d3351
+unit=1 \
6d3351
+-m 1024 \
6d3351
+-smp 1,sockets=1,cores=1,threads=1 \
6d3351
+-uuid 496d7ea8-9739-544b-4ebd-ef08be936e8b \
6d3351
+-nographic \
6d3351
+-nodefaults \
6d3351
+-monitor unix:/tmp/lib/domain--1-guest/monitor.sock,server,nowait \
6d3351
+-boot c
6d3351
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-uefi.xml b/tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-uefi.xml
6d3351
new file mode 100644
6d3351
index 000000000..4eb5a466e
6d3351
--- /dev/null
6d3351
+++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-uefi.xml
6d3351
@@ -0,0 +1,21 @@
6d3351
+<domain type='qemu'>
6d3351
+  <name>guest</name>
6d3351
+  <uuid>496d7ea8-9739-544b-4ebd-ef08be936e8b</uuid>
6d3351
+  <memory unit='KiB'>1048576</memory>
6d3351
+  <vcpu placement='static'>1</vcpu>
6d3351
+  <os>
6d3351
+    <type arch='x86_64' machine='q35'>hvm</type>
6d3351
+    <loader readonly='yes' type='pflash'>/usr/share/OVMF/OVMF_CODE.fd</loader>
6d3351
+    <nvram>/var/lib/libvirt/qemu/nvram/guest_VARS.fd</nvram>
6d3351
+  </os>
6d3351
+  <features>
6d3351
+    <acpi/>
6d3351
+  </features>
6d3351
+  <cpu mode='custom'>
6d3351
+    <model>Haswell</model>
6d3351
+  </cpu>
6d3351
+  <devices>
6d3351
+    <emulator>/usr/bin/qemu-system-x86_64</emulator>
6d3351
+    <memballoon model='none'/>
6d3351
+  </devices>
6d3351
+</domain>
6d3351
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-noacpi-nouefi.args b/tests/qemuxml2argvdata/qemuxml2argv-q35-noacpi-nouefi.args
6d3351
new file mode 100644
6d3351
index 000000000..4d7cdfbe3
6d3351
--- /dev/null
6d3351
+++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-noacpi-nouefi.args
6d3351
@@ -0,0 +1,22 @@
6d3351
+LC_ALL=C \
6d3351
+PATH=/bin \
6d3351
+HOME=/home/test \
6d3351
+USER=test \
6d3351
+LOGNAME=test \
6d3351
+QEMU_AUDIO_DRV=none \
6d3351
+/usr/bin/qemu-system-x86_64 \
6d3351
+-name guest \
6d3351
+-S \
6d3351
+-M q35 \
6d3351
+-cpu Haswell,+rtm,+hle \
6d3351
+-m 1024 \
6d3351
+-smp 1,sockets=1,cores=1,threads=1 \
6d3351
+-uuid 496d7ea8-9739-544b-4ebd-ef08be936e8b \
6d3351
+-nographic \
6d3351
+-nodefaults \
6d3351
+-monitor unix:/tmp/lib/domain--1-guest/monitor.sock,server,nowait \
6d3351
+-no-acpi \
6d3351
+-boot c \
6d3351
+-kernel /var/lib/libvirt/images/guest.vmlinuz \
6d3351
+-initrd /var/lib/libvirt/images/guest.initramfs \
6d3351
+-append 'rw root=/dev/vda rootwait'
6d3351
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-noacpi-nouefi.xml b/tests/qemuxml2argvdata/qemuxml2argv-q35-noacpi-nouefi.xml
6d3351
new file mode 100644
6d3351
index 000000000..163b424ea
6d3351
--- /dev/null
6d3351
+++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-noacpi-nouefi.xml
6d3351
@@ -0,0 +1,19 @@
6d3351
+<domain type='qemu'>
6d3351
+  <name>guest</name>
6d3351
+  <uuid>496d7ea8-9739-544b-4ebd-ef08be936e8b</uuid>
6d3351
+  <memory unit='KiB'>1048576</memory>
6d3351
+  <vcpu placement='static'>1</vcpu>
6d3351
+  <os>
6d3351
+    <type arch='x86_64' machine='q35'>hvm</type>
6d3351
+    <kernel>/var/lib/libvirt/images/guest.vmlinuz</kernel>
6d3351
+    <initrd>/var/lib/libvirt/images/guest.initramfs</initrd>
6d3351
+    <cmdline>rw root=/dev/vda rootwait</cmdline>
6d3351
+  </os>
6d3351
+  <cpu mode='custom'>
6d3351
+    <model>Haswell</model>
6d3351
+  </cpu>
6d3351
+  <devices>
6d3351
+    <emulator>/usr/bin/qemu-system-x86_64</emulator>
6d3351
+    <memballoon model='none'/>
6d3351
+  </devices>
6d3351
+</domain>
6d3351
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-noacpi-uefi.xml b/tests/qemuxml2argvdata/qemuxml2argv-q35-noacpi-uefi.xml
6d3351
new file mode 100644
6d3351
index 000000000..91c83c808
6d3351
--- /dev/null
6d3351
+++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-noacpi-uefi.xml
6d3351
@@ -0,0 +1,18 @@
6d3351
+<domain type='qemu'>
6d3351
+  <name>guest</name>
6d3351
+  <uuid>496d7ea8-9739-544b-4ebd-ef08be936e8b</uuid>
6d3351
+  <memory unit='KiB'>1048576</memory>
6d3351
+  <vcpu placement='static'>1</vcpu>
6d3351
+  <os>
6d3351
+    <type arch='x86_64' machine='q35'>hvm</type>
6d3351
+    <loader readonly='yes' type='pflash'>/usr/share/OVMF/OVMF_CODE.fd</loader>
6d3351
+    <nvram>/var/lib/libvirt/qemu/nvram/guest_VARS.fd</nvram>
6d3351
+  </os>
6d3351
+  <cpu mode='custom'>
6d3351
+    <model>Haswell</model>
6d3351
+  </cpu>
6d3351
+  <devices>
6d3351
+    <emulator>/usr/bin/qemu-system-x86_64</emulator>
6d3351
+    <memballoon model='none'/>
6d3351
+  </devices>
6d3351
+</domain>
6d3351
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
6d3351
index 5c0e1e8ab..cfd6dcd55 100644
6d3351
--- a/tests/qemuxml2argvtest.c
6d3351
+++ b/tests/qemuxml2argvtest.c
6d3351
@@ -757,6 +757,13 @@ mymain(void)
6d3351
             QEMU_CAPS_MACHINE_OPT,
6d3351
             QEMU_CAPS_MACHINE_SMM_OPT,
6d3351
             QEMU_CAPS_VIRTIO_SCSI);
6d3351
+
6d3351
+    /* Make sure all combinations of ACPI and UEFI behave as expected */
6d3351
+    DO_TEST("q35-acpi-uefi", NONE);
6d3351
+    DO_TEST_PARSE_ERROR("q35-noacpi-uefi", NONE);
6d3351
+    DO_TEST("q35-noacpi-nouefi", NONE);
6d3351
+    DO_TEST("q35-acpi-nouefi", NONE);
6d3351
+
6d3351
     DO_TEST("clock-utc", QEMU_CAPS_NODEFCONFIG);
6d3351
     DO_TEST("clock-localtime", NONE);
6d3351
     DO_TEST("clock-localtime-basis-localtime", QEMU_CAPS_RTC);
6d3351
@@ -2316,6 +2323,13 @@ mymain(void)
6d3351
     DO_TEST_FAILURE("aarch64-kvm-32-on-64",
6d3351
             QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_DEVICE_VIRTIO_MMIO,
6d3351
             QEMU_CAPS_KVM);
6d3351
+
6d3351
+    /* Make sure all combinations of ACPI and UEFI behave as expected */
6d3351
+    DO_TEST("aarch64-acpi-uefi", NONE);
6d3351
+    DO_TEST("aarch64-noacpi-uefi", NONE);
6d3351
+    DO_TEST("aarch64-noacpi-nouefi", NONE);
6d3351
+    DO_TEST_PARSE_ERROR("aarch64-acpi-nouefi", NONE);
6d3351
+
6d3351
     qemuTestSetHostArch(driver.caps, VIR_ARCH_NONE);
6d3351
 
6d3351
     DO_TEST("kvm-pit-delay", QEMU_CAPS_KVM_PIT_TICK_POLICY);
6d3351
-- 
6d3351
2.12.2
6d3351