[libvirt] [PATCH 1/2] Add simple bitmap operations to utils

Stefan Berger stefanb at linux.vnet.ibm.com
Mon May 17 20:24:55 UTC 2010


On Mon, 2010-05-17 at 14:05 -0600, Eric Blake wrote:
> On 05/17/2010 12:09 PM, Jim Fehlig wrote:

> 
> > +{
> > +    virBitmap bit = bitmap[VIR_BITMAP_UNIT_OFFSET(b)] &
> > +          (1 << VIR_BITMAP_BIT_OFFSET(b));
> 
> Should these interfaces add sanity checks that b is in range (that is,
> smaller than the original allocated size)?  Do we want to support
> dynamically-growing bitsets?

Right, should hold the number of elements it has. I think range checking
would be a good idea.

   Stefan





More information about the libvir-list mailing list