On 02/10/2015 01:28 PM, Max Reitz wrote: > Add a helper function for reallocating a refcount array, independent of > the refcount order. The newly allocated space is zeroed and the function > handles failed reallocations gracefully. > > The helper function will always align the buffer size to a cluster > boundary; if storing the refcounts in such an array in big endian byte > order, this makes it possible to write parts of the array directly as > refcount blocks into the image file. > > Signed-off-by: Max Reitz > --- > block/qcow2-refcount.c | 130 ++++++++++++++++++++++++++++++------------------- > 1 file changed, 81 insertions(+), 49 deletions(-) > Reviewed-by: Eric Blake -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org