On 10/25/2012 10:46 AM, Eric Blake wrote:
>>> +
>>> +/* Ensure tail bits are clear. */
>>> +if (tail)
>>> +bitmap->map[bitmap->map_len - 1] &=
>>> +-1UL >> (VIR_BITMAP_BITS_PER_UNIT - tail);
>> Probably not necessary, as the bitmap is initialized to zero.
>
> Absolutel
On 10/25/2012 08:35 AM, Viktor Mihajlovski wrote:
> On 10/25/2012 03:36 AM, Eric Blake wrote:
>> Sometimes it's handy to know how many bits are set.
>>
>> * src/util/bitmap.h (virBitmapCountBits): New prototype.
>> (virBitmapNextSetBit): Use correct type.
>> * src/util/bitmap.c (virBitmapNextSetBit
On 10/25/2012 03:36 AM, Eric Blake wrote:
Sometimes it's handy to know how many bits are set.
* src/util/bitmap.h (virBitmapCountBits): New prototype.
(virBitmapNextSetBit): Use correct type.
* src/util/bitmap.c (virBitmapNextSetBit): Likewise.
(virBitmapCountBits): New function.
* src/libvirt_p
Sometimes it's handy to know how many bits are set.
* src/util/bitmap.h (virBitmapCountBits): New prototype.
(virBitmapNextSetBit): Use correct type.
* src/util/bitmap.c (virBitmapNextSetBit): Likewise.
(virBitmapCountBits): New function.
* src/libvirt_private.syms (bitmap.h): Export it.
* tests/v