]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Fix KVM features with QEMU 4.1
authorJiri Denemark <jdenemar@redhat.com>
Fri, 26 Jul 2019 14:34:55 +0000 (16:34 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Mon, 29 Jul 2019 13:41:51 +0000 (15:41 +0200)
Originally the names of the KVM CPU features were only used internally
for looking up their CPUID bits. So we used "__kvm_" prefix for them to
make sure the names do not collide with normal CPU features stored in
our CPU map.

But with QEMU 4.1 we check which features were enabled or disabled by a
freshly started QEMU process using their names rather than their CPUID
bits (mostly because of MSR features). Thus we need to change our made
up internal names into the actual names used by QEMU.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Tested-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/cpu/cpu_x86_data.h
src/qemu/qemu_command.c

index 2607dd96b16903589ed4fb57a02b486f59689201..cc0c93dff012b3c2135780bbe4affea7c6da2afd 100644 (file)
@@ -43,7 +43,7 @@ struct _virCPUx86MSR {
 #define CPUX86_KVM      0x40000000
 #define CPUX86_EXTENDED 0x80000000
 
-#define VIR_CPU_x86_KVM_PV_UNHALT    "__kvm_pv_unhalt"
+#define VIR_CPU_x86_KVM_PV_UNHALT   "kvm_pv_unhalt"
 
 /*
  * The following HyperV feature names suffixes must exactly match corresponding
index 7b2cfa06831d57e3e2e4acc7c69eb681388202b8..fee51158a97d2d13599c7e73a0eb9e4143018c85 100644 (file)
@@ -7146,7 +7146,7 @@ qemuBuildCpuCommandLine(virCommandPtr cmd,
     }
 
     if (def->features[VIR_DOMAIN_FEATURE_PVSPINLOCK]) {
-        qemuBuildCpuFeature(qemuCaps, &buf, "kvm_pv_unhalt",
+        qemuBuildCpuFeature(qemuCaps, &buf, VIR_CPU_x86_KVM_PV_UNHALT,
                             def->features[VIR_DOMAIN_FEATURE_PVSPINLOCK] == VIR_TRISTATE_SWITCH_ON);
     }