From c3ee75e5aa26a359309599796a5a13efccfc974c Mon Sep 17 00:00:00 2001 From: Maxim Nestratov Date: Tue, 31 Jan 2017 17:12:13 +0300 Subject: [PATCH] cpu: fix typo: rename __kvm_hv_spinlock to __kvm_hv_spinlocks Strings associated with virDomainHyperv values in domain_conf.c are used to construct HyperV CPU features names to be compared with names defined in cpu_x86_data.h and the names for HyperV "spinlocks" feature don't match. This leads to a misleading warning: "host doesn't support hyperv 'spinlocks' feature" even when it's supported. Let's fix it and rename along with it VIR_CPU_x86_KVM_HV_SPINLOCK to VIR_CPU_x86_KVM_HV_SPINLOCKS. Signed-off-by: Maxim Nestratov --- src/cpu/cpu_x86.c | 4 ++-- src/cpu/cpu_x86_data.h | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 9e22f896e9..d9764a2603 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -100,7 +100,7 @@ KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_STIMER, 0x40000003, 0x00000008); KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_RELAXED, 0x40000003, 0x00000020); -KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_SPINLOCK, +KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_SPINLOCKS, 0x40000003, 0x00000022); KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_VAPIC, 0x40000003, 0x00000030); @@ -124,7 +124,7 @@ static virCPUx86Feature x86_kvm_features[] = KVM_FEATURE(VIR_CPU_x86_KVM_HV_SYNIC), KVM_FEATURE(VIR_CPU_x86_KVM_HV_STIMER), KVM_FEATURE(VIR_CPU_x86_KVM_HV_RELAXED), - KVM_FEATURE(VIR_CPU_x86_KVM_HV_SPINLOCK), + KVM_FEATURE(VIR_CPU_x86_KVM_HV_SPINLOCKS), KVM_FEATURE(VIR_CPU_x86_KVM_HV_VAPIC), KVM_FEATURE(VIR_CPU_x86_KVM_HV_VPINDEX), KVM_FEATURE(VIR_CPU_x86_KVM_HV_RESET), diff --git a/src/cpu/cpu_x86_data.h b/src/cpu/cpu_x86_data.h index 4660ab6821..b89110f16c 100644 --- a/src/cpu/cpu_x86_data.h +++ b/src/cpu/cpu_x86_data.h @@ -49,11 +49,17 @@ struct _virCPUx86CPUID { # define VIR_CPU_x86_KVM_PV_EOI "__kvm_pv_eoi" # define VIR_CPU_x86_KVM_PV_UNHALT "__kvm_pv_unhalt" # define VIR_CPU_x86_KVM_CLOCKSOURCE_STABLE_BIT "__kvm_clocksource_stable" + +/* + * The following HyperV feature names suffixes must exactly match corresponding + * ones defined for virDomainHyperv in domain_conf.c. + * E.g "__kvm_runtime" -> "runtime", "__kvm_hv_spinlocks" -> "spinlocks" etc. +*/ # define VIR_CPU_x86_KVM_HV_RUNTIME "__kvm_hv_runtime" # define VIR_CPU_x86_KVM_HV_SYNIC "__kvm_hv_synic" # define VIR_CPU_x86_KVM_HV_STIMER "__kvm_hv_stimer" # define VIR_CPU_x86_KVM_HV_RELAXED "__kvm_hv_relaxed" -# define VIR_CPU_x86_KVM_HV_SPINLOCK "__kvm_hv_spinlock" +# define VIR_CPU_x86_KVM_HV_SPINLOCKS "__kvm_hv_spinlocks" # define VIR_CPU_x86_KVM_HV_VAPIC "__kvm_hv_vapic" # define VIR_CPU_x86_KVM_HV_VPINDEX "__kvm_hv_vpindex" # define VIR_CPU_x86_KVM_HV_RESET "__kvm_hv_reset" -- GitLab