qemu: Fix KVM features with QEMU 4.1

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>
This commit is contained in:
Jiri Denemark 2019-07-26 16:34:55 +02:00
parent 9e6172937f
commit 4c62ed6068
2 changed files with 2 additions and 2 deletions

View 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

View 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);
}