]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Fix /domain/features setting in qemuParseCommandLine
authorChristophe Fergeau <cfergeau@redhat.com>
Tue, 10 Jul 2012 10:02:10 +0000 (12:02 +0200)
committerCole Robinson <crobinso@redhat.com>
Sun, 12 Aug 2012 23:23:51 +0000 (19:23 -0400)
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
tests/qemuxml2argvdata/qemuxml2argv-kvmclock.xml

index 4d518b23fc53ec44e6daa6c4d87c2cf2905179fa..1cdc6d27b6b7ff2da6157e6b4963c5083f9582ae 100644 (file)
@@ -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];                                   \
index 88fc2b81655c990164109e1674f916d02deaf286..cc523870f6de936479d613d59caabecc7e72dbbf 100644 (file)
@@ -8,6 +8,9 @@
     <type arch='i686' machine='pc'>hvm</type>
     <boot dev='network'/>
   </os>
+  <features>
+    <pae/>
+  </features>
   <clock offset='utc'>
     <timer name='kvmclock' present='no'/>
   </clock>