On 22.12.19 12:36, Alberto Garcia wrote: > qcow2 images with subclusters have 128-bit L2 entries. The first 64 > bits contain the same information as traditional images and the last > 64 bits form a bitmap with the status of each individual subcluster. > > Because of that we cannot assume that L2 entries are sizeof(uint64_t) > anymore. This function returns the proper value for the image. > > Signed-off-by: Alberto Garcia > --- > block/qcow2-cluster.c | 12 ++++++------ > block/qcow2-refcount.c | 14 ++++++++------ > block/qcow2.c | 8 ++++---- > block/qcow2.h | 9 +++++++++ > 4 files changed, 27 insertions(+), 16 deletions(-) Assuming qcow2_calc_prealloc_size() and qcow2_measure are fixed up in patch 26: Reviewed-by: Max Reitz