When a domain is configured to use GIC but no version has been
specified by the user, default to GIC v2.
---
src/qemu/qemu_domain.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 1895520..d120e15 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -1239,6 +1239,18 @@ qemuDomainDefAddDefaultDevices(virDomainDefPtr def,
static int
+qemuDomainDefAddDefaultFeatures(virDomainDefPtr def)
+{
+ /* 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)
+ def->gic_version = VIR_GIC_VERSION_2;
+
+ return 0;
+}
+
+
+static int
qemuCanonicalizeMachine(virDomainDefPtr def, virQEMUCapsPtr qemuCaps)
{
const char *canon;
@@ -1289,6 +1301,9 @@ qemuDomainDefPostParse(virDomainDefPtr def,
if (qemuCanonicalizeMachine(def, qemuCaps) < 0)
goto cleanup;
+ if (qemuDomainDefAddDefaultFeatures(def) < 0)
+ goto cleanup;
+
if (virSecurityManagerVerify(driver->securityManager, def) < 0)
goto cleanup;
--
2.5.0