GIC is always available to ARM virt machines, and the domain XML should
reflect this fact.
---
src/qemu/qemu_domain.c | 14 ++++++++++++++
.../qemuxml2argv-aarch64-aavmf-virtio-mmio.xml | 1 +
2 files changed, 15 insertions(+)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index d120e15..5017cbb 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -1241,6 +1241,20 @@ qemuDomainDefAddDefaultDevices(virDomainDefPtr def,
static int
qemuDomainDefAddDefaultFeatures(virDomainDefPtr def)
{
+ switch (def->os.arch) {
+ case VIR_ARCH_ARMV7L:
+ case VIR_ARCH_AARCH64:
+ if (STREQ(def->os.machine, "virt") ||
+ STRPREFIX(def->os.machine, "virt-")) {
+ /* GIC is always available to ARM virt machines */
+ def->features[VIR_DOMAIN_FEATURE_GIC] = VIR_TRISTATE_SWITCH_ON;
+ }
+ break;
+
+ default:
+ break;
+ }
+
/* Default to GIC v2 if no version was specified */
if (def->features[VIR_DOMAIN_FEATURE_GIC] == VIR_TRISTATE_SWITCH_ON &&
def->gic_version == VIR_GIC_VERSION_NONE)
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-aavmf-virtio-mmio.xml
b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-aavmf-virtio-mmio.xml
index 4a31c8b..8c7428c 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-aavmf-virtio-mmio.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-aavmf-virtio-mmio.xml
@@ -16,6 +16,7 @@
<acpi/>
<apic/>
<pae/>
+ <gic version='2'/>
</features>
<cpu mode='custom' match='exact'>
<model fallback='allow'>cortex-a53</model>
--
2.5.0