qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 11/15] target-i386: Add property getter for CPU


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 11/15] target-i386: Add property getter for CPU model-id
Date: Thu, 19 Apr 2012 18:47:57 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1

On 04/19/2012 06:41 PM, Michael Roth wrote:

>> +    char *value;
>> +    int i;
>> +
>> +    value = g_malloc(48 + 1);
>> +    for (i = 0; i < 48; i++) {
>> +        value[i] = env->cpuid_model[i >> 2] >> (8 * (i & 3));
> 
> setter code is a bit difficult to parse but I think we need value[i] &= 0xff
> here

value[i] is a char.  Unless you're planning on compiling for a non-POSIX
system where char is more than 8 bits, value[i] &= 0xff is a no-op.

-- 
Eric Blake   address@hidden    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]