[libvirt] [PATCH 1/3] util: Add a helper to check if all bits of a bitmap are clear
Daniel P. Berrange
berrange at redhat.com
Tue Apr 2 10:56:13 UTC 2013
On Tue, Apr 02, 2013 at 06:52:22AM -0400, John Ferlan wrote:
> On 04/02/2013 01:42 AM, Osier Yang wrote:
> > ---
> > src/libvirt_private.syms | 1 +
> > src/util/virbitmap.c | 30 ++++++++++++++++++++++++++++++
> > src/util/virbitmap.h | 3 +++
> > 3 files changed, 34 insertions(+)
> >
>
> Since there already is a "virBitmapIsAllSet()" - why isn't it used? I
> see callers which do "if (virBitmapIsAllSet(...)" and "if
> (!virBitmapIsAllSet(...)".
>
> If you're going to have a AllClear(), then why not change those !
> callers to use AllClear()...
!virBitmapIsAllSet() is not the same as virBitmapIsAllClear().
!virBitmapIsAllSet() allows for [0 -> (n-1)] bits to be set,
whereas virBitmapIsAllClear() only allows for 0 bits to be
set.
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
More information about the libvir-list
mailing list