[libvirt] [PATCH] cpu: fix typo: rename __kvm_hv_spinlock to __kvm_hv_spinlocks

Jiri Denemark jdenemar at redhat.com
Tue Jan 31 11:54:03 UTC 2017


On Tue, Jan 31, 2017 at 13:59:37 +0300, Maxim Nestratov wrote:
> Corresponding hv cpu feature name is 'spinlocks' thus, we should have similar
> name with __kvm_hv_ prefix. Otherwise we have misleading warning:
> "host doesn't support hyperv 'spinlocks' feature" even when it's supported.
> 
> Signed-off-by: Maxim Nestratov <mnestratov at virtuozzo.com>
> ---
>  src/cpu/cpu_x86_data.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/cpu/cpu_x86_data.h b/src/cpu/cpu_x86_data.h
> index 4660ab6..4f3940b 100644
> --- a/src/cpu/cpu_x86_data.h
> +++ b/src/cpu/cpu_x86_data.h
> @@ -53,7 +53,7 @@ struct _virCPUx86CPUID {
>  # 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_SPINLOCK  "__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"

It took me a while to realized how this change can fix the issue. It's
because the strings associated with virDomainHyperv values are used to
construct these CPU features names and the names for this particular
feature didn't match. To avoid possible confusion in the future I'd
suggest adding a comment in cpu_x86_data.h saying the feature names must
match the strings for virDomainHyperv in domain_conf.c.

And while at it, I think you can
s/VIR_CPU_x86_KVM_HV_SPINLOCK/VIR_CPU_x86_KVM_HV_SPINLOCKS/ too.

Jirka




More information about the libvir-list mailing list