mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 05:17:54 +03:00
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.
This commit is contained in:
parent
cdfc3d7cb8
commit
bf924e8e1b
@ -1317,5 +1317,6 @@ virBitmapShrink(virBitmapPtr map,
|
||||
return -1;
|
||||
|
||||
map->map_len = nl;
|
||||
map->map_alloc = nl;
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user