]> git.proxmox.com Git - mirror_qemu.git/commit
qcow2: Helper for refcount array reallocation
authorMax Reitz <mreitz@redhat.com>
Tue, 10 Feb 2015 20:28:49 +0000 (15:28 -0500)
committerKevin Wolf <kwolf@redhat.com>
Tue, 10 Mar 2015 13:02:21 +0000 (14:02 +0100)
commit5fee192efdfe2161d392491e6f68bffb406b18e1
tree43ce04767fac499dede19eec87c512e20d02dcfc
parent0e06528e980b8ac7695a219f8405d3cdc52a1381
qcow2: Helper for refcount array reallocation

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 <mreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/qcow2-refcount.c