qemu: Always enable GIC on ARM virt machines

GIC is always available to ARM virt machines, and the domain XML should
reflect this fact.
This commit is contained in:
Andrea Bolognani 2016-02-03 19:49:27 +01:00
parent 5b2c2a1023
commit bd23695055
5 changed files with 18 additions and 0 deletions

View File

@ -1249,6 +1249,20 @@ qemuDomainDefAddDefaultDevices(virDomainDefPtr def,
static void static void
qemuDomainDefEnableDefaultFeatures(virDomainDefPtr def) qemuDomainDefEnableDefaultFeatures(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 */ /* Default to GIC v2 if no version was specified */
if (def->features[VIR_DOMAIN_FEATURE_GIC] == VIR_TRISTATE_SWITCH_ON && if (def->features[VIR_DOMAIN_FEATURE_GIC] == VIR_TRISTATE_SWITCH_ON &&
def->gic_version == VIR_GIC_VERSION_NONE) def->gic_version == VIR_GIC_VERSION_NONE)

View File

@ -16,6 +16,7 @@
<acpi/> <acpi/>
<apic/> <apic/>
<pae/> <pae/>
<gic version='2'/>
</features> </features>
<cpu mode='custom' match='exact'> <cpu mode='custom' match='exact'>
<model fallback='allow'>cortex-a53</model> <model fallback='allow'>cortex-a53</model>

View File

@ -16,6 +16,7 @@
<acpi/> <acpi/>
<apic/> <apic/>
<pae/> <pae/>
<gic version='2'/>
</features> </features>
<cpu mode='custom' match='exact'> <cpu mode='custom' match='exact'>
<model fallback='allow'>cortex-a53</model> <model fallback='allow'>cortex-a53</model>

View File

@ -16,6 +16,7 @@
<acpi/> <acpi/>
<apic/> <apic/>
<pae/> <pae/>
<gic version='2'/>
</features> </features>
<cpu mode='custom' match='exact'> <cpu mode='custom' match='exact'>
<model fallback='allow'>cortex-a53</model> <model fallback='allow'>cortex-a53</model>

View File

@ -16,6 +16,7 @@
<acpi/> <acpi/>
<apic/> <apic/>
<pae/> <pae/>
<gic version='2'/>
</features> </features>
<cpu mode='custom' match='exact'> <cpu mode='custom' match='exact'>
<model fallback='allow'>cortex-a53</model> <model fallback='allow'>cortex-a53</model>