xenconfig: set HVM pae/apic/acpi/ default to 1

According to xm.config manual, HVM pae|apic|acpi feature default
is 1 (enabled). But in conversion from xm config to libvirt xml,
if xm config doesn't contain pae|apic|acpi, it sets default value
to 0, this causes some problems in HVM guest.

Update parser codes to set HVM pae|apic|acpi default value to 1
to match xm config convension.

Signed-off-by: Chunyan Liu <cyliu@suse.com>
This commit is contained in:
Chunyan Liu 2014-12-23 14:36:04 +08:00 committed by Jim Fehlig
parent 4f524212ce
commit 90ed3bd0aa

View File

@ -512,17 +512,17 @@ xenParseCPUFeatures(virConfPtr conf, virDomainDefPtr def)
return -1; return -1;
if (STREQ(def->os.type, "hvm")) { if (STREQ(def->os.type, "hvm")) {
if (xenConfigGetBool(conf, "pae", &val, 0) < 0) if (xenConfigGetBool(conf, "pae", &val, 1) < 0)
return -1; return -1;
else if (val) else if (val)
def->features[VIR_DOMAIN_FEATURE_PAE] = VIR_TRISTATE_SWITCH_ON; def->features[VIR_DOMAIN_FEATURE_PAE] = VIR_TRISTATE_SWITCH_ON;
if (xenConfigGetBool(conf, "acpi", &val, 0) < 0) if (xenConfigGetBool(conf, "acpi", &val, 1) < 0)
return -1; return -1;
else if (val) else if (val)
def->features[VIR_DOMAIN_FEATURE_ACPI] = VIR_TRISTATE_SWITCH_ON; def->features[VIR_DOMAIN_FEATURE_ACPI] = VIR_TRISTATE_SWITCH_ON;
if (xenConfigGetBool(conf, "apic", &val, 0) < 0) if (xenConfigGetBool(conf, "apic", &val, 1) < 0)
return -1; return -1;
else if (val) else if (val)