[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH v12 03/10] qcow2: Correctly report status of pre
Re: [Qemu-block] [PATCH v12 03/10] qcow2: Correctly report status of preallocated zero clusters
Fri, 5 May 2017 22:24:23 +0200
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0.1
On 04.05.2017 05:07, Eric Blake wrote:
> We were throwing away the preallocation information associated with
> zero clusters. But we should be matching the well-defined semantics
> in bdrv_get_block_status(), where (BDRV_BLOCK_ZERO |
> BDRV_BLOCK_OFFSET_VALID) informs the user which offset is reserved,
> while still reminding the user that reading from that offset is
> likely to read garbage.
> count_contiguous_clusters_by_type() is now used only for unallocated
> cluster runs, hence it gets renamed and tightened.
> Making this change lets us see which portions of an image are zero
> but preallocated, when using qemu-img map --output=json. The
> --output=human side intentionally ignores all zero clusters, whether
> or not they are preallocated.
> The fact that there is no change to qemu-iotests './check -qcow2'
> merely means that we aren't yet testing this aspect of qemu-img;
> a later patch will add a test.
> Signed-off-by: Eric Blake <address@hidden>
> v12: rename helper function
> v11: reserved for blkdebug half of v10
> v10: new patch
> block/qcow2-cluster.c | 45 +++++++++++++++++++++++++++++++++++----------
> 1 file changed, 35 insertions(+), 10 deletions(-)
Reviewed-by: Max Reitz <address@hidden>
Description: OpenPGP digital signature