From 00b610c8e94bb0adfcaf65aa8c7fa8c8c74856a5 Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Tue, 10 Jul 2012 12:02:10 +0200 Subject: [PATCH] Fix /domain/features setting in qemuParseCommandLine Commit 5e6ce1 moved down detection of the ACPI feature in qemuParseCommandLine. However, when ACPI is detected, it clears all feature flags in def->features to only set ACPI. This used to be fine because this was the first place were def->features was set, but after the move this is no longer necessarily true because this block comes before the ACPI check: if (strstr(def->emulator, "kvm")) { def->virtType = VIR_DOMAIN_VIRT_KVM; def->features |= (1 << VIR_DOMAIN_FEATURE_PAE); } Since def is allocated in qemuParseCommandLine using VIR_ALLOC, we can always use |= when modifying def->features (cherry picked from commit 626dd5180e472c0b4c0c5fb7072358743ca63653) --- src/qemu/qemu_command.c | 2 +- tests/qemuxml2argvdata/qemuxml2argv-kvmclock.xml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 4d518b23fc..1cdc6d27b6 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7435,7 +7435,7 @@ virDomainDefPtr qemuParseCommandLine(virCapsPtr caps, goto no_memory; if (STREQ(def->os.arch, "i686")||STREQ(def->os.arch, "x86_64")) - def->features = (1 << VIR_DOMAIN_FEATURE_ACPI) + def->features |= (1 << VIR_DOMAIN_FEATURE_ACPI) /*| (1 << VIR_DOMAIN_FEATURE_APIC)*/; #define WANT_VALUE() \ const char *val = progargv[++i]; \ diff --git a/tests/qemuxml2argvdata/qemuxml2argv-kvmclock.xml b/tests/qemuxml2argvdata/qemuxml2argv-kvmclock.xml index 88fc2b8165..cc523870f6 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-kvmclock.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-kvmclock.xml @@ -8,6 +8,9 @@ hvm + + +