Re: [libvirt] [PATCHv3 1/4] bitmap: add virBitmapCountBits

2012-10-25 Thread Eric Blake
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

Re: [libvirt] [PATCHv3 1/4] bitmap: add virBitmapCountBits

2012-10-25 Thread Eric Blake
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

Re: [libvirt] [PATCHv3 1/4] bitmap: add virBitmapCountBits

2012-10-25 Thread Viktor Mihajlovski
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

[libvirt] [PATCHv3 1/4] bitmap: add virBitmapCountBits

2012-10-24 Thread Eric Blake
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