[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 04/15] block-backend: replace bdrv_*_above with blk_*_abov
From: |
Kevin Wolf |
Subject: |
Re: [PATCH v5 04/15] block-backend: replace bdrv_*_above with blk_*_above |
Date: |
Wed, 23 Nov 2022 17:42:35 +0100 |
Am 23.11.2022 um 12:42 hat Emanuele Giuseppe Esposito geschrieben:
> Avoid mixing bdrv_* functions with blk_*, so create blk_* counterparts
> for bdrv_block_status_above and bdrv_is_allocated_above.
>
> Note that since bdrv_block_status_above only calls the g_c_w function
> bdrv_common_block_status_above and is marked as coroutine_fn, call
> directly bdrv_co_common_block_status_above() to avoid using a g_c_w.
This sentence is a bit confusing, because it talks about the blk_* side
of things, but doesn't mention it at all.
The same argument is true for is_allocated.
> Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> block/block-backend.c | 21 ++++++++++++++++++++
> block/commit.c | 4 ++--
> include/sysemu/block-backend-io.h | 9 +++++++++
> nbd/server.c | 32 +++++++++++++++----------------
> 4 files changed, 48 insertions(+), 18 deletions(-)
>
> diff --git a/block/block-backend.c b/block/block-backend.c
> index 742efa7955..03bed68e4f 100644
> --- a/block/block-backend.c
> +++ b/block/block-backend.c
> @@ -1424,6 +1424,27 @@ int coroutine_fn blk_co_pwritev(BlockBackend *blk,
> int64_t offset,
> return blk_co_pwritev_part(blk, offset, bytes, qiov, 0, flags);
> }
>
> +int coroutine_fn blk_co_block_status_above(BlockBackend *blk,
> + BlockDriverState *base,
> + int64_t offset, int64_t bytes,
> + int64_t *pnum, int64_t *map,
> + BlockDriverState **file)
> +{
> + IO_CODE();
> + return bdrv_co_block_status_above(blk_bs(blk), base, offset, bytes, pnum,
> + map, file);
> +}
> +
> +int coroutine_fn blk_is_allocated_above(BlockBackend *blk,
Any reason why you renamed only blk_co_block_status_above(), but not
this one into blk_co_is_allocated_above()?
> + BlockDriverState *base,
> + bool include_base, int64_t offset,
> + int64_t bytes, int64_t *pnum)
> +{
> + IO_CODE();
> + return bdrv_co_is_allocated_above(blk_bs(blk), base, include_base,
> offset,
> + bytes, pnum);
> +}
Kevin
- [PATCH v5 00/15] Still more coroutine and various fixes in block layer, Emanuele Giuseppe Esposito, 2022/11/23
- [PATCH v5 03/15] nbd/server.c: add missing coroutine_fn annotations, Emanuele Giuseppe Esposito, 2022/11/23
- [PATCH v5 04/15] block-backend: replace bdrv_*_above with blk_*_above, Emanuele Giuseppe Esposito, 2022/11/23
- Re: [PATCH v5 04/15] block-backend: replace bdrv_*_above with blk_*_above,
Kevin Wolf <=
- [PATCH v5 02/15] block-copy: add missing coroutine_fn annotations, Emanuele Giuseppe Esposito, 2022/11/23
- [PATCH v5 07/15] block: introduce QEMU_IN_COROUTINE macro, Emanuele Giuseppe Esposito, 2022/11/23
- [PATCH v5 10/15] block-coroutine-wrapper.py: introduce generated_co_wrapper_simple, Emanuele Giuseppe Esposito, 2022/11/23
- [PATCH v5 06/15] block: avoid duplicating filename string in bdrv_create, Emanuele Giuseppe Esposito, 2022/11/23
- [PATCH v5 05/15] block/vmdk: add missing coroutine_fn annotations, Emanuele Giuseppe Esposito, 2022/11/23