[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [Qemu-devel] [PATCH qom-cpu 7/9] target-i386: Use FeatureWord loop on filter_features_for_kvm()



On 04/22/2013 01:00 PM, Eduardo Habkost wrote:
> Instead of open-coding the filtering code for each feature word, change
> the existing code to use the feature_word_info array, that have exactly
> the same CPUID eax/ecx/register values for each feature word.
> 
> Signed-off-by: Eduardo Habkost <ehabkost redhat com>
> ---
>  target-i386/cpu.c | 24 +++++++-----------------
>  1 file changed, 7 insertions(+), 17 deletions(-)
> 

> +    for (w = 0; w < FEATURE_WORDS; w++) {
> +        FeatureWordInfo *wi = &feature_word_info[w];
> +        env->features[w] &= kvm_arch_get_supported_cpuid(s, wi->cpuid_eax,
> +                                                            wi->cpuid_ecx,
> +                                                            wi->cpuid_reg);

Indentation is unusual, but the resulting alignment is nicer than having
'wi->' flush under 's'.  I would have written the call in four lines
instead of 3, but that's not essential.

Reviewed-by: Eric Blake <eblake redhat com>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]