]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Default to GIC v2
authorAndrea Bolognani <abologna@redhat.com>
Wed, 3 Feb 2016 18:49:07 +0000 (19:49 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Tue, 16 Feb 2016 13:58:58 +0000 (14:58 +0100)
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

index 495c76b3c0a570ea16555cda94c18395bf59766e..7fbd5ef1430d21edb8f281c0198f68e4cf0224d2 100644 (file)
@@ -1239,6 +1239,23 @@ qemuDomainDefAddDefaultDevices(virDomainDefPtr def,
 }
 
 
+/**
+ * qemuDomainDefEnableDefaultFeatures:
+ * @def: domain definition
+ *
+ * Make sure that features that should be enabled by default are actually
+ * enabled and configure default values related to those features.
+ */
+static void
+qemuDomainDefEnableDefaultFeatures(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;
+}
+
+
 static int
 qemuCanonicalizeMachine(virDomainDefPtr def, virQEMUCapsPtr qemuCaps)
 {
@@ -1290,6 +1307,8 @@ qemuDomainDefPostParse(virDomainDefPtr def,
     if (qemuCanonicalizeMachine(def, qemuCaps) < 0)
         goto cleanup;
 
+    qemuDomainDefEnableDefaultFeatures(def);
+
     if (virSecurityManagerVerify(driver->securityManager, def) < 0)
         goto cleanup;