]> xenbits.xensource.com Git - libvirt.git/commit
util: bitmap: Fix value of 'map_alloc' when shrinking bitmap
authorPeter Krempa <pkrempa@redhat.com>
Mon, 5 Feb 2018 12:36:57 +0000 (13:36 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 5 Feb 2018 15:08:26 +0000 (16:08 +0100)
commitbf924e8e1be03982b0006e05b4faa3a645a45578
tree556115470aca551b08287a21d618c9adcf2fe949
parentcdfc3d7cb81112b9d6098ef6aabe7d489614d66e
util: bitmap: Fix value of 'map_alloc' when shrinking bitmap

The virBitmap code uses VIR_RESIZE_N to do quadratic scaling, which
means that along with the number of requested map elements we also need
to keep the number of actually allocated elements for the scaling
algorithm to work properly.

The shrinking code did not fix 'map_alloc' thus virResizeN might
actually not expand the bitmap properly after called on a previously
shrunk bitmap.
src/util/virbitmap.c