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

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



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


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