qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v6 01/20] block: Add .bdrv_co_block_status() cal


From: Fam Zheng
Subject: Re: [Qemu-devel] [PATCH v6 01/20] block: Add .bdrv_co_block_status() callback
Date: Fri, 29 Dec 2017 10:35:55 +0800
User-agent: Mutt/1.9.1 (2017-09-22)

On Thu, 12/07 14:30, Eric Blake wrote:
> We are gradually moving away from sector-based interfaces, towards
> byte-based. Now that the block layer exposes byte-based allocation,
> it's time to tackle the drivers.  Add a new callback that operates
> on as small as byte boundaries. Subsequent patches will then update
> individual drivers, then finally remove .bdrv_co_get_block_status().
> 
> The new code also passes through the 'want_zero' hint, which will
> allow subsequent patches to further optimize callers that only care
> about how much of the image is allocated (want_zero is false),
> rather than full details about runs of zeroes and which offsets the
> allocation actually maps to (want_zero is true).  As part of this
> effort, fix another part of the documentation: the claim in commit
> 4c41cb4 that BDRV_BLOCK_ALLOCATED is short for 'DATA || ZERO' is a
> lie at the block layer (see commit e88ae2264), even though it is
> how the bit is computed from the driver layer.  After all, there
> are intentionally cases where we return ZERO but not ALLOCATED at
> the block layer, when we know that a read sees zero because the
> backing file is too short.  Note that the driver interface is thus
> slightly different than the public interface with regards to which
> bits will be set, and what guarantees are provided on input.
> 
> We also add an assertion that any driver using the new callback will
> make progress (the only time pnum will be 0 is if the block layer
> already handled an out-of-bounds request, or if there is an error);
> the old driver interface did not provide this guarantee, which
> could lead to some inf-loops in drastic corner-case failures.
> 
> Signed-off-by: Eric Blake <address@hidden>
> 
> ---
> v6: drop now-useless rounding of mid-sector end-of-file hole [Kevin],
> better documentation of 'want_zero' [Kevin]

Reviewed-by: Fam Zheng <address@hidden>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]