On 02/03/2016 03:26 PM, Andrea Bolognani wrote:
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;
See once on - we then have a version='host' and we're good to go.
Of course, as I'm typing I realize that we wouldn't print out
version='host' if it were the default... But that may not be a bad
thing - although we could.
Just throwing some ideas out. Obviously the series works as is, but you
were more involved in the qemu gic discussion so you can go with Cole's
ACK and I'm fine with that.
John
+ }
+ 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>