From: Sam Li <faithilikerun@gmail.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-devel@nongnu.org, Kevin Wolf <kwolf@redhat.com>,
dmitry.fomichev@wdc.com, Hanna Reitz <hreitz@redhat.com>,
Eric Blake <eblake@redhat.com>,
hare@suse.de, qemu-block@nongnu.org, stefanha@redhat.com,
dlemoal@kernel.org
Subject: Re: [PATCH v3 2/4] qcow2: add configurations for zoned format extension
Date: Mon, 18 Sep 2023 22:52:10 +0800 [thread overview]
Message-ID: <CAAAx-8JZctx5_HUOh6Ur-ttPNOBGebBitH=5Zw2iC-e0jw9xbA@mail.gmail.com> (raw)
In-Reply-To: <875y47czdx.fsf@pond.sub.org>
Markus Armbruster <armbru@redhat.com> 于2023年9月18日周一 22:46写道:
>
> Sam Li <faithilikerun@gmail.com> writes:
>
> > Markus Armbruster <armbru@redhat.com> 于2023年9月1日周五 19:08写道:
> >>
> >> 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 profile" is gone in v3.
> >>
> >> > zone model, zone size, zone capacity, number of conventional
> >> > zones, limits on zone resources (max append sectors, max open
> >> > zones, and max_active_zones).
> >> >
> >> > 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 nr_conv_zones=0 -o
> >> > max_append_sectors=512 -o max_open_zones=0 -o max_active_zones=0
> >> > -o zone_model=1
> >> >
> >> > Signed-off-by: Sam Li <faithilikerun@gmail.com>
> >>
> >> [...]
> >>
> >> > diff --git a/qapi/block-core.json b/qapi/block-core.json
> >> > index 2b1d493d6e..0d8f9e0a88 100644
> >> > --- a/qapi/block-core.json
> >> > +++ b/qapi/block-core.json
> >> > @@ -5021,6 +5021,27 @@
> >> > # @compression-type: The image cluster compression method
> >> > # (default: zlib, since 5.1)
> >> > #
> >> > +# @zone-model: Zoned device model, 1 for host-managed and 0 for
> >>
> >> Why is this encoded as a number?
> >>
> >> If it's fundamentally a flag, use bool.
> >>
> >> If more models could appear in the future, make it an enum.
> >>
> >
> > Yes, it is an enum.
> >
> > typedef enum BlockZoneModel {
> > BLK_Z_NONE = 0x0, /* Regular block device */
> > BLK_Z_HM = 0x1, /* Host-managed zoned block device */
> > BLK_Z_HA = 0x2, /* Host-aware zoned block device */
> > } BlockZoneModel;
>
> Please make it an enum in the QAPI schema, too.
I see.
>
> >> > +# non-zoned devices (default: 0, since 8.0)
> >>
> >> Since 8.2. More of the same below.
> >>
> >> > +#
> >> > +# @zone-size: Total number of logical blocks within zones in bytes
> >> > +# (since 8.0)
> >> > +#
> >> > +# @zone-capacity: The number of usable logical blocks within zones
> >> > +# in bytes. A zone capacity is always smaller or equal to the
> >> > +# zone size. (since 8.0)
> >>
> >> Two spaces between sentences for consistency, please.
> >>
> >> > +#
> >> > +# @nr-conv-zones: The number of conventional zones of the zoned device
> >> > +# (since 8.0)
> >>
> >> I think @conventional-zones would be more obvious.
> >>
> >> > +#
> >> > +# @max-open-zones: The maximal allowed open zones (since 8.0)
> >>
> >> Maybe "The maximum number of open zones".
> >>
> >> > +#
> >> > +# @max-active-zones: The limit of the zones that have the implicit
> >> > +# open, explicit open or closed state (since 8.0)
> >>
> >> Maybe "The maximum number of zones in the implicit open, explicit open
> >> or closed state".
> >>
> >> > +#
> >> > +# @max-append-sectors: The maximal data size in sectors of a zone
> >> > +# append request that can be issued to the device. (since 8.0)
> >>
> >> What's the sector size, and how can the user determine it? Why can't we
> >> use bytes here?
> >
> > The sector size is 512 bytes.
>
> Needs to be documented.
>
> I believe bytes would be easier to document, which makes me suspect
> they'd be the simpler interface.
>
> > It's more for conventional use.
>
> I'm afraid I don't understand this part. Do I have to?
Not necessarily. I adopt the name from zoned storage part of virtio spec.
+If the VIRTIO_BLK_F_ZONED feature is negotiated, then in
+\field{virtio_blk_zoned_characteristics},
+\begin{itemize}
+\item \field{zone_sectors} value is expressed in 512-byte sectors.
+\item \field{max_append_sectors} value is expressed in 512-byte sectors.
+\item \field{write_granularity} value is expressed in bytes.
+\end{itemize}
>
> >> > +#
> >> > # Since: 2.12
> >> > ##
> >> > { 'struct': 'BlockdevCreateOptionsQcow2',
> >> > @@ -5037,7 +5058,14 @@
> >> > '*preallocation': 'PreallocMode',
> >> > '*lazy-refcounts': 'bool',
> >> > '*refcount-bits': 'int',
> >> > - '*compression-type':'Qcow2CompressionType' } }
> >> > + '*compression-type':'Qcow2CompressionType',
> >> > + '*zone-model': 'uint8',
> >> > + '*zone-size': 'size',
> >> > + '*zone-capacity': 'size',
> >> > + '*nr-conv-zones': 'uint32',
> >> > + '*max-open-zones': 'uint32',
> >> > + '*max-active-zones': 'uint32',
> >> > + '*max-append-sectors': 'uint32' } }
> >> >
> >> > ##
> >> > # @BlockdevCreateOptionsQed:
> >>
>
next prev parent reply other threads:[~2023-09-18 14:53 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-28 15:09 [PATCH v3 0/4] Add full zoned storage emulation to qcow2 driver Sam Li
2023-08-28 15:09 ` [PATCH v3 1/4] docs/qcow2: add the zoned format feature Sam Li
2023-09-06 20:26 ` Stefan Hajnoczi
2023-08-28 15:09 ` [PATCH v3 2/4] qcow2: add configurations for zoned format extension Sam Li
2023-09-01 11:07 ` Markus Armbruster
2023-09-18 8:24 ` Sam Li
2023-09-18 14:46 ` Markus Armbruster
2023-09-18 14:52 ` Sam Li [this message]
2023-09-13 20:12 ` Stefan Hajnoczi
2023-09-18 8:55 ` Sam Li
2023-08-28 15:09 ` [PATCH v3 3/4] qcow2: add zoned emulation capability Sam Li
2023-09-13 21:11 ` Stefan Hajnoczi
2023-08-28 15:09 ` [PATCH v3 4/4] iotests: test the zoned format feature for qcow2 file Sam Li
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='CAAAx-8JZctx5_HUOh6Ur-ttPNOBGebBitH=5Zw2iC-e0jw9xbA@mail.gmail.com' \
--to=faithilikerun@gmail.com \
--cc=armbru@redhat.com \
--cc=dlemoal@kernel.org \
--cc=dmitry.fomichev@wdc.com \
--cc=eblake@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).