qemu-devel
[Top][All Lists]
Advanced

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

Re: [RFC v5 09/11] qemu-io: add zoned block device operations.


From: Stefan Hajnoczi
Subject: Re: [RFC v5 09/11] qemu-io: add zoned block device operations.
Date: Mon, 1 Aug 2022 11:48:47 -0400

On Sun, 31 Jul 2022 at 21:42, Sam Li <faithilikerun@gmail.com> wrote:
>
> Add zoned storage commands of the device: zone_report(zrp), zone_open(zo),
> zone_close(zc), zone_reset(zrs), zone_finish(zf).
>
> For example, to test zone_report, use following command:
> $ ./build/qemu-io --image-opts driver=zoned_host_device, filename=/dev/nullb0
> -c "zrp offset nr_zones"
>
> Signed-off-by: Sam Li <faithilikerun@gmail.com>
> ---
>  block/io.c     |  24 ++-------
>  qemu-io-cmds.c | 144 +++++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 148 insertions(+), 20 deletions(-)
>
> diff --git a/block/io.c b/block/io.c
> index a4625fb0e1..de9ec1d740 100644
> --- a/block/io.c
> +++ b/block/io.c
> @@ -3209,19 +3209,11 @@ int bdrv_co_zone_report(BlockDriverState *bs, int64_t 
> offset,
>      IO_CODE();
>
>      bdrv_inc_in_flight(bs);
> -    if (!drv || (!drv->bdrv_co_zone_report)) {
> +    if (!drv || !drv->bdrv_co_zone_report) {
>          co.ret = -ENOTSUP;
>          goto out;
>      }
> -
> -    if (drv->bdrv_co_zone_report) {
> -        co.ret = drv->bdrv_co_zone_report(bs, offset, nr_zones, zones);
> -    } else {
> -        co.ret = -ENOTSUP;
> -        goto out;
> -        qemu_coroutine_yield();
> -    }
> -
> +    co.ret = drv->bdrv_co_zone_report(bs, offset, nr_zones, zones);
>  out:
>      bdrv_dec_in_flight(bs);
>      return co.ret;
> @@ -3237,19 +3229,11 @@ int bdrv_co_zone_mgmt(BlockDriverState *bs, 
> BlockZoneOp op,
>      IO_CODE();
>
>      bdrv_inc_in_flight(bs);
> -    if (!drv || (!drv->bdrv_co_zone_mgmt)) {
> +    if (!drv || !drv->bdrv_co_zone_mgmt) {
>          co.ret = -ENOTSUP;
>          goto out;
>      }
> -
> -    if (drv->bdrv_co_zone_mgmt) {
> -        co.ret = drv->bdrv_co_zone_mgmt(bs, op, offset, len);
> -    } else {
> -        co.ret = -ENOTSUP;
> -        goto out;
> -        qemu_coroutine_yield();
> -    }
> -
> +    co.ret = drv->bdrv_co_zone_mgmt(bs, op, offset, len);
>  out:
>      bdrv_dec_in_flight(bs);
>      return co.ret;

Please squash these changes into the earlier patch that introduced
these functions.

Otherwise:

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>



reply via email to

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