qemu-block
[Top][All Lists]
Advanced

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

Re: [RFC v4 9/9] qapi: add support for zoned host device


From: Damien Le Moal
Subject: Re: [RFC v4 9/9] qapi: add support for zoned host device
Date: Tue, 12 Jul 2022 16:48:11 +0900
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0

On 7/12/22 11:13, Sam Li wrote:
> ---
>  block/file-posix.c   | 8 +++++++-
>  qapi/block-core.json | 7 +++++--
>  2 files changed, 12 insertions(+), 3 deletions(-)
> 
> diff --git a/block/file-posix.c b/block/file-posix.c
> index e9ad1d8e1e..4e0aa02acf 100644
> --- a/block/file-posix.c
> +++ b/block/file-posix.c
> @@ -3737,6 +3737,12 @@ static void hdev_parse_filename(const char *filename, 
> QDict *options,
>      bdrv_parse_filename_strip_prefix(filename, "host_device:", options);
>  }
>  
> +static void zoned_host_device_parse_filename(const char *filename, QDict 
> *options,
> +                                Error **errp)
> +{
> +    bdrv_parse_filename_strip_prefix(filename, "zoned_host_device:", 
> options);
> +}
> +
>  static bool hdev_is_sg(BlockDriverState *bs)
>  {
>  
> @@ -3975,7 +3981,7 @@ static BlockDriver bdrv_zoned_host_device = {
>          .is_zoned = true,
>          .bdrv_needs_filename = true,
>          .bdrv_probe_device  = hdev_probe_device,
> -        .bdrv_parse_filename = hdev_parse_filename,
> +        .bdrv_parse_filename = zoned_host_device_parse_filename,
>          .bdrv_file_open     = hdev_open,
>          .bdrv_close         = raw_close,
>          .bdrv_reopen_prepare = raw_reopen_prepare,
> diff --git a/qapi/block-core.json b/qapi/block-core.json
> index 2173e7734a..ab05c2ef99 100644
> --- a/qapi/block-core.json
> +++ b/qapi/block-core.json
> @@ -2955,7 +2955,8 @@
>              'luks', 'nbd', 'nfs', 'null-aio', 'null-co', 'nvme', 'parallels',
>              'preallocate', 'qcow', 'qcow2', 'qed', 'quorum', 'raw', 'rbd',
>              { 'name': 'replication', 'if': 'CONFIG_REPLICATION' },
> -            'ssh', 'throttle', 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat' ] }
> +            'ssh', 'throttle', 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat',
> +            { 'name': 'zoned_host_device', 'if': 'HAVE_HOST_BLOCK_DEVICE' } 
> ] }

This needs to be something like:

{ 'name': 'zoned_host_device', 'if': 'CONFIG_BLKZONED' } ] }

And we need to make sure CONFIG_BLKZONED is defined if and only if we also
have HAVE_HOST_BLOCK_DEVICE.

>  
>  ##
>  # @BlockdevOptionsFile:
> @@ -4329,7 +4330,9 @@
>        'vhdx':       'BlockdevOptionsGenericFormat',
>        'vmdk':       'BlockdevOptionsGenericCOWFormat',
>        'vpc':        'BlockdevOptionsGenericFormat',
> -      'vvfat':      'BlockdevOptionsVVFAT'
> +      'vvfat':      'BlockdevOptionsVVFAT',
> +      'zoned_host_device': { 'type': 'BlockdevOptionsFile',
> +                             'if': 'HAVE_HOST_BLOCK_DEVICE' }

Same here I think.

>    } }
>  
>  ##


-- 
Damien Le Moal
Western Digital Research



reply via email to

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