Re: [PATCH 1/3] util: Add a helper to check if all bits of a bitmap are clear

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

 



On 02/04/13 18:52, 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(...)".

I want to check if the bitmap is all zero. Obviously !virBitmapIsAllSet
can't do it.


If you're going to have a AllClear(), then why not change those !
callers to use AllClear()...

I only wonder about the last comparison - it's the "-1" logic that
throws me off especially since the IsAllSet() code is doing a comparison.

It also stands to reason that tests/virbitmaptest.c could add new tests
to ensure you did get the logic right.

Agreed. I didn't notice this. Will add.

Osier

--
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]