Now after shrinking the qcow2 image, at the end of the image file, there might be a tail that probably will never be used. Although it will not bring any tangible benefit, we can cut the tail if it is. Yes, it will not free up disk space, but if the blocks were be allocated sequentially and the image is not heavily fragmented then the virtual size of the image file will be commensurate with the real size. It also doesn't look like a great plus.. Well, at least we can discuss it.
Pavel Butsykin (2): qcow2: fix return error code in qcow2_truncate() qcow2: truncate the tail of the image file after shrinking the image block/qcow2-refcount.c | 21 +++++++++++++++++++++ block/qcow2.c | 23 +++++++++++++++++++++-- block/qcow2.h | 1 + 3 files changed, 43 insertions(+), 2 deletions(-) -- 2.14.1