[libvirt] [PATCH 26/34] util: bitmap: Introduce bitmap subtraction

Peter Krempa pkrempa at redhat.com
Fri Jan 29 15:58:28 UTC 2016


On Mon, Jan 18, 2016 at 18:05:12 -0500, John Ferlan wrote:
> On 01/14/2016 11:27 AM, Peter Krempa wrote:

[...]

> > 
> > +    virtTestCounterReset("test11-");
> > +    TESTBINARYOP("0", "0", "0,^0", test11);
> > +    TESTBINARYOP("0-3", "0", "1-3", test11);
> > +    TESTBINARYOP("0-3", "0,3", "1-2", test11);
> > +    TESTBINARYOP("0,^0", "0", "0,^0", test11);
> > +    TESTBINARYOP("0-3", "0-3", "0,^0", test11);
> > +    TESTBINARYOP("0-3", "0,^0", "0-3", test11);
> > +    TESTBINARYOP("0,2", "1,3", "0,2", test11);
> > +
> 
> 0,^0 is "interesting" considering patches 22 & 23

Well, that's a simple way how to describe a empty bitmap without any
hacks that should be used with virBitmapParse since that function
doesn't parse empty string as an empty bitmap.

> 
> Concept seems fine though... although I guess I'd "half expect" there
> would be a need for "Add" as well as "Subtract".

Not really. The code using this function doesn't add bits. It collects a
bitmap and removes processed entries.

> 

Peter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20160129/f069e70e/attachment-0001.sig>


More information about the libvir-list mailing list