[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v6 6/8] config: add check to block layer
From: |
Stefan Hajnoczi |
Subject: |
Re: [PATCH v6 6/8] config: add check to block layer |
Date: |
Sat, 6 Aug 2022 08:23:20 -0400 |
On Fri, Aug 05, 2022 at 03:57:49PM +0800, Sam Li wrote:
> Putting zoned/non-zoned BlockDrivers on top of each other is not
> allowed.
>
> Signed-off-by: Sam Li <faithilikerun@gmail.com>
> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
> block.c | 13 +++++++++++++
> block/file-posix.c | 1 +
> block/raw-format.c | 1 +
> include/block/block_int-common.h | 10 ++++++++++
> 4 files changed, 25 insertions(+)
>
> diff --git a/block.c b/block.c
> index bc85f46eed..8a259b158c 100644
> --- a/block.c
> +++ b/block.c
> @@ -7947,6 +7947,19 @@ void bdrv_add_child(BlockDriverState *parent_bs,
> BlockDriverState *child_bs,
> return;
> }
>
> + /*
> + * Non-zoned block drivers do not follow zoned storage constraints
> + * (i.e. sequential writes to zones). Refuse mixing zoned and non-zoned
> + * drivers in a graph.
> + */
> + if (!parent_bs->drv->supports_zoned_children && child_bs->drv->is_zoned)
> {
> + error_setg(errp, "Cannot add a %s child to a %s parent",
> + child_bs->drv->is_zoned ? "zoned" : "non-zoned",
> + parent_bs->drv->supports_zoned_children ?
> + "support zoned children" : "not support zoned children");
> + return;
> + }
This doesn't handle the case where a filter node (like I/O throttling)
is inserted above a raw block driver with a zoned_host_device child.
Can we replace child_bs->drv->is_zoned with child_bs->bl.zoned ==
BLK_Z_HM? I think the is_zoned field is unnecessary.
That way the block/raw-format.c .bdrv_refresh_limits() function can
propagate its child's zone block limits (including the zone model) and
this check will work correctly.
Stefan
signature.asc
Description: PGP signature
- Re: [PATCH v6 2/8] file-posix: introduce get_sysfs_long_val for the long sysfs attribute, (continued)
- [PATCH v6 3/8] file-posix: introduce get_sysfs_str_val for device zoned model, Sam Li, 2022/08/05
- [PATCH v6 4/8] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls, Sam Li, 2022/08/05
- [PATCH v6 5/8] raw-format: add zone operations to pass through requests, Sam Li, 2022/08/05
- [PATCH v6 6/8] config: add check to block layer, Sam Li, 2022/08/05
- Re: [PATCH v6 6/8] config: add check to block layer,
Stefan Hajnoczi <=
- [PATCH v6 7/8] qemu-iotests: test new zone operations, Sam Li, 2022/08/05
- [PATCH v6 8/8] docs/zoned-storage: add zoned device documentation, Sam Li, 2022/08/05