See patches for rationale. Peter Krempa (4): virBitmapNewCopy: Honor sizes of either bitmap when doing memcpy() virbitmap: Extract and reuse buffer size calculation into a function util: virbitmap: Extract clearing of unused bits at the end of the last unit util: bitmap: Rewrite virBitmapShrink using new helpers src/util/virbitmap.c | 84 +++++++++++++++++++++----------------------- 1 file changed, 40 insertions(+), 44 deletions(-) -- 2.47.0