All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Sam Li <faithilikerun@gmail.com>
Cc: qemu-devel@nongnu.org,  hare@suse.de,
	 Hanna Reitz <hreitz@redhat.com>,
	dmitry.fomichev@wdc.com,  qemu-block@nongnu.org,
	 Kevin Wolf <kwolf@redhat.com>,  Eric Blake <eblake@redhat.com>,
	 stefanha@redhat.com, dlemoal@kernel.org
Subject: Re: [PATCH v2 2/4] qcow2: add configurations for zoned format extension
Date: Mon, 21 Aug 2023 15:13:44 +0200	[thread overview]
Message-ID: <87wmxobks7.fsf@pond.sub.org> (raw)
In-Reply-To: <20230814085802.61459-3-faithilikerun@gmail.com> (Sam Li's message of "Mon, 14 Aug 2023 16:58:00 +0800")

Sam Li <faithilikerun@gmail.com> writes:

> To configure the zoned format feature on the qcow2 driver, it
> requires following arguments: the device size, zoned profile,
> zoned model, zone size, zone capacity, number of conventional
> zones, limits on zone resources (max append sectors, max open
> zones, and max_active_zones). The zoned profile option is set
> to zns when using the qcow2 file as a ZNS drive.
>
> To create a qcow2 file with zoned format, use command like this:
> $ qemu-img create -f qcow2 test.qcow2 -o size=768M -o
> zone_size=64M -o zone_capacity=64M -o zone_nr_conv=0 -o
> max_append_sectors=512 -o max_open_zones=0 -o max_active_zones=0
>  -o zoned_profile=zbc/zns
>
> Signed-off-by: Sam Li <faithilikerun@gmail.com>

[...]

> diff --git a/qapi/block-core.json b/qapi/block-core.json
> index 2b1d493d6e..0c97ae678b 100644
> --- a/qapi/block-core.json
> +++ b/qapi/block-core.json
> @@ -5020,24 +5020,42 @@
>  #
>  # @compression-type: The image cluster compression method
>  #     (default: zlib, since 5.1)
> +# @zoned-profile: Two zoned device protocol options, zbc or zns
> +#                 (default: off, since 8.0)

When a 'str' thing accepts a fixed set of (string) values, it most
likely should be an enum instead.  Have you considered making
@zoned-profile one?

> +# @zone-size: The size of a zone of the zoned device (since 8.0)
> +# @zone-capacity: The capacity of a zone of the zoned device (since 8.0)

In bytes, I presume?

What's the difference between size and capacity?

> +# @zone-nr-conv: The number of conventional zones of the zoned device
> +#                (since 8.0)
> +# @max-open-zones: The maximal allowed open zones (since 8.0)
> +# @max-active-zones: The limit of the zones that have the implicit open,
> +#                    explicit open or closed state (since 8.0)

Naming...  if I understand the comment correctly, then @zone-nr-conv,
@max-open-zones, and @max-active-zones are all counting zones.  Rename
@zone-nr-conv to @conventional-zones?

> +# @max-append-sectors: The maximal sectors that is allowed to append write

I'm not sure I understand the explanation.  Elaborate for me?

> +#                      (since 8.0)

Please format like

   #
   # @zoned-profile: Two zoned device protocol options, zbc or zns
   #     (default: off, since 8.0)
   #
   # @zone-size: The size of a zone of the zoned device (since 8.0)
   #
   # @zone-capacity: The capacity of a zone of the zoned device
   #     (since 8.0)
   #
   # @zone-nr-conv: The number of conventional zones of the zoned device
   #     (since 8.0)
   #
   # @max-open-zones: The maximal allowed open zones (since 8.0)
   #
   # @max-active-zones: The limit of the zones that have the implicit
   #     open, explicit open or closed state (since 8.0)
   #
   # @max-append-sectors: The maximal sectors that is allowed to append
   #     write (since 8.0)

to blend in with recent commit a937b6aa739 (qapi: Reformat doc comments
to conform to current conventions).

>  #
>  # Since: 2.12
>  ##
>  { 'struct': 'BlockdevCreateOptionsQcow2',
> -  'data': { 'file':             'BlockdevRef',
> -            '*data-file':       'BlockdevRef',
> -            '*data-file-raw':   'bool',
> -            '*extended-l2':     'bool',
> -            'size':             'size',
> -            '*version':         'BlockdevQcow2Version',
> -            '*backing-file':    'str',
> -            '*backing-fmt':     'BlockdevDriver',
> -            '*encrypt':         'QCryptoBlockCreateOptions',
> -            '*cluster-size':    'size',
> -            '*preallocation':   'PreallocMode',
> -            '*lazy-refcounts':  'bool',
> -            '*refcount-bits':   'int',
> -            '*compression-type':'Qcow2CompressionType' } }
> +  'data': { 'file':                'BlockdevRef',
> +            '*data-file':          'BlockdevRef',
> +            '*data-file-raw':      'bool',
> +            '*extended-l2':        'bool',
> +            'size':                'size',
> +            '*version':            'BlockdevQcow2Version',
> +            '*backing-file':       'str',
> +            '*backing-fmt':        'BlockdevDriver',
> +            '*encrypt':            'QCryptoBlockCreateOptions',
> +            '*cluster-size':       'size',
> +            '*preallocation':      'PreallocMode',
> +            '*lazy-refcounts':     'bool',
> +            '*refcount-bits':      'int',
> +            '*compression-type':   'Qcow2CompressionType',

I'd keep the existing lines unchanged.  Not a demand.

> +            '*zoned-profile':      'str',
> +            '*zone-size':          'size',
> +            '*zone-capacity':      'size',
> +            '*zone-nr-conv':       'uint32',
> +            '*max-open-zones':     'uint32',
> +            '*max-active-zones':   'uint32',
> +            '*max-append-sectors': 'uint32'}}

Keep the spaces around the } for consistency.  Yes, they're kind of
ugly.

>  
>  ##
>  # @BlockdevCreateOptionsQed:



  parent reply	other threads:[~2023-08-21 13:14 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-14  8:57 [PATCH v2 0/4] Add full zoned storage emulation to qcow2 driver Sam Li
2023-08-14  8:57 ` [PATCH v2 1/4] docs/qcow2: add the zoned format feature Sam Li
2023-08-14  8:58 ` [PATCH v2 2/4] qcow2: add configurations for zoned format extension Sam Li
2023-08-16 19:31   ` Stefan Hajnoczi
2023-08-21 13:13   ` Markus Armbruster [this message]
2023-08-28  9:05     ` Sam Li
2023-08-21 13:31   ` Stefan Hajnoczi
2023-08-28  9:22     ` Sam Li
2023-08-28 10:12       ` Damien Le Moal
2023-08-28 10:18         ` Sam Li
2023-08-28 10:22           ` Damien Le Moal
2023-08-28 10:40             ` Sam Li
2023-08-28 14:42     ` Sam Li
2023-08-14  8:58 ` [PATCH v2 3/4] qcow2: add zoned emulation capability Sam Li
2023-08-16 21:07   ` Stefan Hajnoczi
2023-08-22 19:48   ` Stefan Hajnoczi
2023-08-28 11:55     ` Sam Li
2023-08-29  6:06       ` Damien Le Moal
2023-08-29  6:27         ` Sam Li
2023-08-29  7:14           ` Damien Le Moal
2023-08-29  7:27             ` Sam Li
2023-08-14  8:58 ` [PATCH v2 4/4] iotests: test the zoned format feature for qcow2 file Sam Li
2023-08-22 19:50   ` Stefan Hajnoczi
2023-08-16  7:37 ` [PATCH v2 0/4] Add full zoned storage emulation to qcow2 driver Klaus Jensen
2023-08-16  8:14   ` Sam Li
2023-08-16 18:03     ` Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wmxobks7.fsf@pond.sub.org \
    --to=armbru@redhat.com \
    --cc=dlemoal@kernel.org \
    --cc=dmitry.fomichev@wdc.com \
    --cc=eblake@redhat.com \
    --cc=faithilikerun@gmail.com \
    --cc=hare@suse.de \
    --cc=hreitz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.