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

Eric Blake eblake at redhat.com
Fri May 3 15:01:59 UTC 2013


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 at 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 at redhat.com>

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130503/705a0a89/attachment-0001.sig>


More information about the libvir-list mailing list