提交 5b2c2a10 编写于 作者: A Andrea Bolognani

qemu: Default to GIC v2

When a domain is configured to use GIC but no version has been
specified by the user, default to GIC v2.
上级 768b7ed2
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册