]> git.ipfire.org Git - thirdparty/libvirt.git/commit
util: Introduce virBitmapShrink
authorMartin Kletzander <mkletzan@redhat.com>
Thu, 9 Nov 2017 15:12:33 +0000 (16:12 +0100)
committerMartin Kletzander <mkletzan@redhat.com>
Sat, 18 Nov 2017 09:45:10 +0000 (10:45 +0100)
commitbaca005367cf60743f67df44440fc316e6d20c19
tree498162c7a63278dc50406353a352f4d92b70be3d
parent449442c34d20753ca57852d9d7957dd7ba868fae
util: Introduce virBitmapShrink

Sometimes the size of the bitmap matters and it might not be guessed correctly
when parsing from some type of input.  For example virBitmapNewData() has Byte
granularity, virBitmapNewString() has nibble granularity and so on.
virBitmapParseUnlimited() can be tricked into creating huge bitmap that's not
needed (e.g.: "0-2,^99999999").  This function provides a way to shrink the
bitmap.  It is not supposed to free any memory.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
src/libvirt_private.syms
src/util/virbitmap.c
src/util/virbitmap.h