diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 64d2d7105071b669a435d9abc1be8c07db14ae8e..5cf383aaea3138dbe433047ddc3ea1e4098a9f6b 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -9324,18 +9324,16 @@ qemuBuildRedirdevCommandLine(virLogManagerPtr logManager,
}
-static int
+static void
qemuBuildDomainLoaderCommandLine(virCommandPtr cmd,
- virDomainDefPtr def,
- virQEMUCapsPtr qemuCaps)
+ virDomainDefPtr def)
{
- int ret = -1;
virDomainLoaderDefPtr loader = def->os.loader;
virBuffer buf = VIR_BUFFER_INITIALIZER;
int unit = 0;
if (!loader)
- return 0;
+ return;
switch ((virDomainLoader) loader->type) {
case VIR_DOMAIN_LOADER_TYPE_ROM:
@@ -9344,12 +9342,6 @@ qemuBuildDomainLoaderCommandLine(virCommandPtr cmd,
break;
case VIR_DOMAIN_LOADER_TYPE_PFLASH:
- if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_NO_ACPI) &&
- def->features[VIR_DOMAIN_FEATURE_ACPI] != VIR_TRISTATE_SWITCH_ON) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("ACPI must be enabled in order to use UEFI"));
- goto cleanup;
- }
if (loader->secure == VIR_TRISTATE_BOOL_YES) {
virCommandAddArgList(cmd,
@@ -9387,10 +9379,7 @@ qemuBuildDomainLoaderCommandLine(virCommandPtr cmd,
break;
}
- ret = 0;
- cleanup:
virBufferFreeAndReset(&buf);
- return ret;
}
@@ -9827,8 +9816,7 @@ qemuBuildCommandLine(virQEMUDriverPtr driver,
if (qemuBuildCpuCommandLine(cmd, driver, def, qemuCaps) < 0)
goto error;
- if (qemuBuildDomainLoaderCommandLine(cmd, def, qemuCaps) < 0)
- goto error;
+ qemuBuildDomainLoaderCommandLine(cmd, def);
if (!migrateURI && !snapshot && qemuDomainAlignMemorySizes(def) < 0)
goto error;
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index b733505d0bbd552d45f3b660995ed3dafa60c084..a3bb7dbc9a255fd2b792ea40c77f3d866d0649f6 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -2884,6 +2884,26 @@ qemuDomainDefValidate(const virDomainDef *def,
goto cleanup;
}
+ /* On x86, UEFI requires ACPI */
+ if (def->os.loader &&
+ def->os.loader->type == VIR_DOMAIN_LOADER_TYPE_PFLASH &&
+ ARCH_IS_X86(def->os.arch) &&
+ def->features[VIR_DOMAIN_FEATURE_ACPI] != VIR_TRISTATE_SWITCH_ON) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("UEFI requires ACPI on this architecture"));
+ goto cleanup;
+ }
+
+ /* On aarch64, ACPI requires UEFI */
+ if (def->features[VIR_DOMAIN_FEATURE_ACPI] == VIR_TRISTATE_SWITCH_ON &&
+ def->os.arch == VIR_ARCH_AARCH64 &&
+ (!def->os.loader ||
+ def->os.loader->type != VIR_DOMAIN_LOADER_TYPE_PFLASH)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("ACPI requires UEFI on this architecture"));
+ goto cleanup;
+ }
+
if (def->os.loader &&
def->os.loader->secure == VIR_TRISTATE_BOOL_YES) {
/* These are the QEMU implementation limitations. But we
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-aavmf-virtio-mmio.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-aavmf-virtio-mmio.args
index bf4b2f79362fdeb0bb8cc9eb2aa9e688bc9b48fd..68fb61b1e4c65d86228bf3054cb98f880d357fd5 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-aavmf-virtio-mmio.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-aavmf-virtio-mmio.args
@@ -16,6 +16,7 @@ QEMU_AUDIO_DRV=none \
-nodefconfig \
-nodefaults \
-monitor unix:/tmp/lib/domain--1-aarch64test/monitor.sock,server,nowait \
+-no-acpi \
-boot c \
-kernel /aarch64.kernel \
-initrd /aarch64.initrd \
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-aavmf-virtio-mmio.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-aavmf-virtio-mmio.xml
index 8c7428cf82e6dba9b799057b1f8c9db056cf43d1..5d7217307b9af4fee2e5cebb8e61da2694141553 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-aavmf-virtio-mmio.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-aavmf-virtio-mmio.xml
@@ -13,7 +13,6 @@
-
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-cpu-passthrough.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-cpu-passthrough.args
index 52d2112b8492627bae8efa7f0c21010493bca093..9c8c001f1adaba990545e9beebf33819160d4c2d 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-cpu-passthrough.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-cpu-passthrough.args
@@ -16,6 +16,7 @@ QEMU_AUDIO_DRV=none \
-nodefconfig \
-nodefaults \
-monitor unix:/tmp/lib/domain--1-aarch64test/monitor.sock,server,nowait \
+-no-acpi \
-boot c \
-drive file=/aarch64.raw,format=raw,if=none,id=drive-virtio-disk0 \
-device virtio-blk-device,drive=drive-virtio-disk0,id=virtio-disk0
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-cpu-passthrough.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-cpu-passthrough.xml
index 4cdf387f36d02e5cda2bc00e7c629e1008bc9e76..0dda095049740e7d80fc20f54f86b4f96984aff1 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-cpu-passthrough.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-cpu-passthrough.xml
@@ -8,7 +8,6 @@
hvm
-
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-video-virtio-gpu-pci.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-video-virtio-gpu-pci.args
index 76ee977a3ca2cc56f149a66a978032fba13aa1fa..2f8c51610bebd3147d3c02680c858572daa442d3 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-video-virtio-gpu-pci.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-video-virtio-gpu-pci.args
@@ -16,6 +16,7 @@ QEMU_AUDIO_DRV=none \
-nodefconfig \
-nodefaults \
-monitor unix:/tmp/lib/domain--1-aarch64-vgpu/monitor.sock,server,nowait \
+-no-acpi \
-device ioh3420,port=0x8,chassis=1,id=pci.1,bus=pcie.0,multifunction=on,\
addr=0x1 \
-device ioh3420,port=0x9,chassis=2,id=pci.2,bus=pcie.0,multifunction=on,\
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-video-virtio-gpu-pci.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-video-virtio-gpu-pci.xml
index 4b52a731b043610a94015e14b76104e2afd7f6c3..d9a012893296d26cead6d58262ab1be30d7b992e 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-video-virtio-gpu-pci.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-video-virtio-gpu-pci.xml
@@ -7,9 +7,6 @@
hvm
-
-
-
cortex-a57
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-2.6-virtio-pci-default.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-2.6-virtio-pci-default.args
index df03c6e025b33499a30093ae9a239ae293d700df..e99d412a7e536b880688ad7b53ed80135b1bf8f5 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-2.6-virtio-pci-default.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-2.6-virtio-pci-default.args
@@ -16,6 +16,7 @@ QEMU_AUDIO_DRV=none \
-nodefconfig \
-nodefaults \
-monitor unix:/tmp/lib/domain--1-aarch64test/monitor.sock,server,nowait \
+-no-acpi \
-boot c \
-kernel /aarch64.kernel \
-initrd /aarch64.initrd \
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-2.6-virtio-pci-default.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-2.6-virtio-pci-default.xml
index e745101f13b9d4f457f03425948a840940f0d716..43bc0089c943453633515e7446e86a2cbc309d74 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-2.6-virtio-pci-default.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-2.6-virtio-pci-default.xml
@@ -12,7 +12,6 @@
earlyprintk console=ttyAMA0,115200n8 rw root=/dev/vda rootwait
-
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-default-nic.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-default-nic.args
index 29f65f6b991b3a7641be44547b5dfbfeed183dc3..47d77618b97e339807c41652272ec2704b742f1b 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-default-nic.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-default-nic.args
@@ -17,6 +17,7 @@ QEMU_AUDIO_DRV=none \
-nodefaults \
-monitor unix:/tmp/lib/domain--1-aarch64-virt-default/monitor.sock,server,\
nowait \
+-no-acpi \
-boot c \
-kernel /aarch64.kernel \
-initrd /aarch64.initrd \
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-default-nic.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-default-nic.xml
index 3a6f098d0767378e012137b510baf7f07e724633..17ddc9096bee8ac2f3af362ad0189aad499f1ae5 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-default-nic.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-default-nic.xml
@@ -4,9 +4,6 @@
1048576
1048576
1
-
-
-
cortex-a53
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-virtio.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-virtio.args
index b5b010ca41c3896ccb147a3ae84a626152bbbb96..5fef3b48826f9d8bb29eebf4ab8be35f019ca0ce 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-virtio.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-virtio.args
@@ -16,6 +16,7 @@ QEMU_AUDIO_DRV=none \
-nodefconfig \
-nodefaults \
-monitor unix:/tmp/lib/domain--1-aarch64test/monitor.sock,server,nowait \
+-no-acpi \
-boot c \
-kernel /aarch64.kernel \
-initrd /aarch64.initrd \
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-virtio.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-virtio.xml
index ad34615128a5d9dc71f9363c16f9653f4d584388..2692e61c4289afaf2d84e8faec14fae12e3d2ef5 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-virtio.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-virtio.xml
@@ -12,7 +12,6 @@
earlyprintk console=ttyAMA0,115200n8 rw root=/dev/vda rootwait
-
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-default.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-default.args
index 46ac51d506dd0d40410f057b4f9081685a32c94e..23a5fffd09cf4cfcacae4bee019bfa6b441f1d34 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-default.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-default.args
@@ -16,6 +16,7 @@ QEMU_AUDIO_DRV=none \
-nodefconfig \
-nodefaults \
-monitor unix:/tmp/lib/domain--1-aarch64test/monitor.sock,server,nowait \
+-no-acpi \
-boot c \
-kernel /aarch64.kernel \
-initrd /aarch64.initrd \
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-default.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-default.xml
index 2a84a96698cae1e30c946581bd326064a4791b6a..72bf0c95c3d8a0c9980b6cd3e7fe9e91a1d81b48 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-default.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-default.xml
@@ -12,7 +12,6 @@
earlyprintk console=ttyAMA0,115200n8 rw root=/dev/vda rootwait
-
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-manual-addresses.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-manual-addresses.args
index 06403996e28803391c7b5ff0cc03e4c35c2b2646..54244fdcf73e5f5f25778ad2ec613913d98168c6 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-manual-addresses.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-manual-addresses.args
@@ -16,6 +16,7 @@ QEMU_AUDIO_DRV=none \
-nodefconfig \
-nodefaults \
-monitor unix:/tmp/lib/domain--1-aarch64test/monitor.sock,server,nowait \
+-no-acpi \
-boot c \
-kernel /aarch64.kernel \
-initrd /aarch64.initrd \
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-manual-addresses.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-manual-addresses.xml
index 5e1b494ed7c56f5934877175260dc1ed1731cb3e..fee32588f73d0f734cb9893b49c839f55d224b89 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-manual-addresses.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-manual-addresses.xml
@@ -13,7 +13,6 @@
-
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-balloon-mmio-deflate.args b/tests/qemuxml2argvdata/qemuxml2argv-balloon-mmio-deflate.args
index 10d1362581a2e1c92b35cc21f2eb892fef597e7e..e568e3c3934e0c9e0856dace515e032a9e397daa 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-balloon-mmio-deflate.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-balloon-mmio-deflate.args
@@ -16,6 +16,7 @@ QEMU_AUDIO_DRV=none \
-nodefconfig \
-nodefaults \
-monitor unix:/tmp/lib/domain--1-aarch64test/monitor.sock,server,nowait \
+-no-acpi \
-boot c \
-kernel /aarch64.kernel \
-initrd /aarch64.initrd \
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-balloon-mmio-deflate.xml b/tests/qemuxml2argvdata/qemuxml2argv-balloon-mmio-deflate.xml
index 1b5b48c429337f93e53b0295586c00d6771e527b..49b7d2c60560a63722dfd39ef12f5379b4ef895b 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-balloon-mmio-deflate.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-balloon-mmio-deflate.xml
@@ -12,7 +12,6 @@
earlyprintk console=ttyAMA0,115200n8 rw root=/dev/vda rootwait
-
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-aavmf-virtio-mmio.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-aavmf-virtio-mmio.xml
index bea65990e7443c45d5072576086ef3cc359a3e9d..9e728300e567cf4196f4867c2de6523d3f02172b 100644
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-aavmf-virtio-mmio.xml
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-aavmf-virtio-mmio.xml
@@ -13,7 +13,6 @@
-
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-video-virtio-gpu-pci.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-video-virtio-gpu-pci.xml
index 2c765e7c356837d8305c9bce3c5c21dc8b4005e4..8590f485ed9a1e930f658abe1c8bc6a89ca3a8a4 100644
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-video-virtio-gpu-pci.xml
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-video-virtio-gpu-pci.xml
@@ -8,7 +8,6 @@
hvm
-
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-virtio-pci-default.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-virtio-pci-default.xml
index 88a6a6a0c27461d104fefda18e2d0de50a4afef9..e5496424b338891d44731ef8be369888d93944c3 100644
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-virtio-pci-default.xml
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-virtio-pci-default.xml
@@ -13,7 +13,6 @@
-
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-virtio-pci-manual-addresses.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-virtio-pci-manual-addresses.xml
index 83cf0d1f51230d1233e903075f5e90041ddfbc09..83d8dcc4a7c58434940f74215c6458e9e37c7779 100644
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-virtio-pci-manual-addresses.xml
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-virtio-pci-manual-addresses.xml
@@ -13,7 +13,6 @@
-