[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [Qemu-devel] [PATCH v2 02/15] block: Allow NULL file fo
From: |
Fam Zheng |
Subject: |
Re: [Qemu-block] [Qemu-devel] [PATCH v2 02/15] block: Allow NULL file for bdrv_get_block_status() |
Date: |
Tue, 4 Jul 2017 15:33:52 +0800 |
User-agent: |
Mutt/1.8.0 (2017-02-23) |
On Mon, 07/03 17:14, Eric Blake wrote:
> Not all callers care about which BDS owns the mapping for a given
> range of the file. This patch merely simplifies the callers by
> consolidating the logic in the common call point, while guaranteeing
> a non-NULL file to all the driver callbacks, for no semantic change.
> The only caller that does not care about pnum is bdrv_is_allocated,
> as invoked by vvfat; we can likewise add assertions that the rest
> of the stack does not have to worry about a NULL pnum.
>
> Furthermore, this will also set the stage for a future cleanup: when
> a caller does not care about which BDS owns an offset, it would be
> nice to allow the driver to optimize things to not have to return
> BDRV_BLOCK_OFFSET_VALID in the first place. In the case of fragmented
> allocation (for example, it's fairly easy to create a qcow2 image
> where consecutive guest addresses are not at consecutive host
> addresses), the current contract requires bdrv_get_block_status()
> to clamp *pnum to the limit where host addresses are no longer
> consecutive, but allowing a NULL file means that *pnum could be
> set to the full length of known-allocated data.
>
> Signed-off-by: Eric Blake <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
- Re: [Qemu-block] [Qemu-devel] [PATCH v2 01/15] block: add default implementations for bdrv_co_get_block_status(), (continued)
Re: [Qemu-block] [Qemu-devel] [PATCH v2 03/15] block: Add flag to avoid wasted work in bdrv_is_allocated(), Eric Blake, 2017/07/05
[Qemu-block] [PATCH v2 02/15] block: Allow NULL file for bdrv_get_block_status(), Eric Blake, 2017/07/03
- Re: [Qemu-block] [Qemu-devel] [PATCH v2 02/15] block: Allow NULL file for bdrv_get_block_status(),
Fam Zheng <=
[Qemu-block] [PATCH v2 04/15] block: Make bdrv_round_to_clusters() signature more useful, Eric Blake, 2017/07/03
[Qemu-block] [PATCH v2 05/15] qcow2: Switch is_zero_sectors() to byte-based, Eric Blake, 2017/07/03
[Qemu-block] [PATCH v2 06/15] block: Switch bdrv_make_zero() to byte-based, Eric Blake, 2017/07/03
[Qemu-block] [PATCH v2 07/15] qemu-img: Switch get_block_status() to byte-based, Eric Blake, 2017/07/03
[Qemu-block] [PATCH v2 08/15] block: Convert bdrv_get_block_status() to bytes, Eric Blake, 2017/07/03