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