Re: [PATCH v4 2/9] New functions for virBitmap

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

 



On 09/18/2012 01:27 AM, Osier Yang wrote:
> On 2012年09月14日 15:46, Hu Tao wrote:
>> In many places we store bitmap info in a chunk of data
>> (pointed to by a char *), and have redundant codes to
>> set/unset bits. This patch extends virBitmap, and convert
>> those codes to use virBitmap in subsequent patches.
>> ---

>> +
>> +    memcpy(bitmap->map, data, len);
>> +    for (i = 0; i<  bitmap->map_len; i++)
>> +        bitmap->map[i] = le64toh(bitmap->map[i]);
> 
> 
> le64toh is not portable. Such as on mingw platform.

Agreed - gnulib does not yet provide it, so we need to open-code this
ourselves instead of relying on a non-standard function.

>> +    l = (unsigned long *)*data;
>> +    for (i = 0; i<  bitmap->map_len; i++, l++)
>> +        *l = htole64(*l);
> 
> Likewise.

Same here.


>> +
>> +    return ffsl(bits) - 1 + nl * VIR_BITMAP_BITS_PER_UNIT;
> 
> And ffsl.

But here, gnulib guarantees ffsl.  We just need to modify bootstrap.conf
to pull it in.

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

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]