[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 08/23] block: Switch bdrv_co_get_block_status
From: |
John Snow |
Subject: |
Re: [Qemu-devel] [PATCH v4 08/23] block: Switch bdrv_co_get_block_status() to byte-based |
Date: |
Tue, 26 Sep 2017 16:15:06 -0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 |
On 09/13/2017 12:03 PM, Eric Blake wrote:
> We are gradually converting to byte-based interfaces, as they are
> easier to reason about than sector-based. Convert another internal
> function (no semantic change); and as with its public counterpart,
> rename to bdrv_co_block_status() to make the compiler enforce that
> we catch all uses. For now, we assert that callers still pass
> aligned data, but ultimately, this will be the function where we
> hand off to a byte-based driver callback, and will eventually need
> to add logic to ensure we round calls according to the driver's
> request_alignment then touch up the result handed back to the
> caller, to start permitting a caller to pass unaligned offsets.
>
> Note that we are now prepared to accepts 'bytes' larger than INT_MAX;
> this is okay as long as we clamp things internally before violating
> any 32-bit limits, and makes no difference to how a client will
> use the information (clients looping over the entire file must
> already be prepared for consecutive calls to return the same status,
> as drivers are already free to return shorter-than-maximal status
> due to any other convenient split points, such as when the L2 table
> crosses cluster boundaries in qcow2).
>
> Signed-off-by: Eric Blake <address@hidden>
Reviewed-by: John Snow <address@hidden>
- [Qemu-devel] [PATCH v4 05/23] block: Switch bdrv_make_zero() to byte-based, (continued)
- [Qemu-devel] [PATCH v4 05/23] block: Switch bdrv_make_zero() to byte-based, Eric Blake, 2017/09/13
- [Qemu-devel] [PATCH v4 04/23] qcow2: Switch is_zero_sectors() to byte-based, Eric Blake, 2017/09/13
- [Qemu-devel] [PATCH v4 06/23] qemu-img: Switch get_block_status() to byte-based, Eric Blake, 2017/09/13
- [Qemu-devel] [PATCH v4 07/23] block: Convert bdrv_get_block_status() to bytes, Eric Blake, 2017/09/13
- [Qemu-devel] [PATCH v4 08/23] block: Switch bdrv_co_get_block_status() to byte-based, Eric Blake, 2017/09/13
- Re: [Qemu-devel] [PATCH v4 08/23] block: Switch bdrv_co_get_block_status() to byte-based,
John Snow <=
- [Qemu-devel] [PATCH v4 11/23] block: Switch bdrv_co_get_block_status_above() to byte-based, Eric Blake, 2017/09/13
- [Qemu-devel] [PATCH v4 10/23] block: Switch bdrv_common_block_status_above() to byte-based, Eric Blake, 2017/09/13
- [Qemu-devel] [PATCH v4 09/23] block: Switch BdrvCoGetBlockStatusData to byte-based, Eric Blake, 2017/09/13
- [Qemu-devel] [PATCH v4 14/23] qemu-img: Speed up compare on pre-allocated larger file, Eric Blake, 2017/09/13
- [Qemu-devel] [PATCH v4 15/23] qemu-img: Add find_nonzero(), Eric Blake, 2017/09/13