From: Markus Armbruster <armbru@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: Sam Li <faithilikerun@gmail.com>,
qemu-devel@nongnu.org, Kevin Wolf <kwolf@redhat.com>,
Hanna Reitz <hreitz@redhat.com>,
dlemoal@kernel.org, hare@suse.de, dmitry.fomichev@wdc.com,
stefanha@redhat.com, qemu-block@nongnu.org,
Markus Armbruster <armbru@redhat.com>
Subject: Re: [PATCH v5 2/4] qcow2: add configurations for zoned format extension
Date: Fri, 03 Nov 2023 10:08:05 +0100 [thread overview]
Message-ID: <878r7f19xm.fsf@pond.sub.org> (raw)
In-Reply-To: <i43illqyyzu7wbotuw2fbuft7izdmfo7jkwnds4yrigewachhw@7pudpozwjer5> (Eric Blake's message of "Mon, 30 Oct 2023 09:53:36 -0500")
Eric Blake <eblake@redhat.com> writes:
> On Mon, Oct 30, 2023 at 08:18:45PM +0800, Sam Li wrote:
>> To configure the zoned format feature on the qcow2 driver, it
>> requires settings as: the device size, zone model, zone size,
>> zone capacity, number of conventional zones, limits on zone
>> resources (max append bytes, 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 conventional_zones=0 -o
>> max_append_bytes=4096 -o max_open_zones=0 -o max_active_zones=0
>> -o zone_model=host-managed
>>
>> Signed-off-by: Sam Li <faithilikerun@gmail.com>
>>
>> fix config?
>
> Is this comment supposed to be part of the commit message? If not,...
>
>> ---
>
> ...place it here under the divider, so 'git am' won't include it, if there is nothing further to change on this patch.
[...]
>> +++ b/qapi/block-core.json
>> @@ -4981,6 +4981,21 @@
>> { 'enum': 'Qcow2CompressionType',
>> 'data': [ 'zlib', { 'name': 'zstd', 'if': 'CONFIG_ZSTD' } ] }
>>
>> +##
>> +# @Qcow2ZoneModel:
>> +#
>> +# Zoned device model used in qcow2 image file
>> +#
>> +# @non-zoned: non-zoned model is for regular block devices
>> +#
>> +# @host-managed: host-managed model only allows sequential write over the
>> +# device zones
>> +#
>> +# Since 8.2
>> +##
>> +{ 'enum': 'Qcow2ZoneModel',
>> + 'data': ['non-zoned', 'host-managed'] }
>> +
>> ##
>> # @BlockdevCreateOptionsQcow2:
>> #
>> @@ -5023,6 +5038,27 @@
>> # @compression-type: The image cluster compression method
>> # (default: zlib, since 5.1)
>> #
>> +# @zone-model: @Qcow2ZoneModel. The zone device model.
>> +# (default: non-zoned, since 8.2)
>> +#
>> +# @zone-size: Total number of bytes within zones (since 8.2)
>
> If @zone-model is "non-zoned", does it make sense to even allow
> @zone-size and friends? Should this use a QMP union, where you can
> pass in the remaining zone-* fields only when zone-model is set to
> host-managed?
Valid question; needs an answer.
>> +#
>> +# @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.2)
>> +#
>> +# @conventional-zones: The number of conventional zones of the
>> +# zoned device (since 8.2)
>> +#
>> +# @max-open-zones: The maximal number of open zones (since 8.2)
>> +#
>> +# @max-active-zones: The maximal number of zones in the implicit
>> +# open, explicit open or closed state (since 8.2)
>> +#
>> +# @max-append-bytes: The maximal number of bytes of a zone
>> +# append request that can be issued to the device. It must be
>> +# 512-byte aligned (since 8.2)
>> +#
>> # Since: 2.12
>> ##
>> { 'struct': 'BlockdevCreateOptionsQcow2',
>> @@ -5039,7 +5075,14 @@
>> '*preallocation': 'PreallocMode',
>> '*lazy-refcounts': 'bool',
>> '*refcount-bits': 'int',
>> - '*compression-type':'Qcow2CompressionType' } }
>> + '*compression-type':'Qcow2CompressionType',
>> + '*zone-model': 'Qcow2ZoneModel',
>> + '*zone-size': 'size',
>> + '*zone-capacity': 'size',
>> + '*conventional-zones': 'uint32',
>> + '*max-open-zones': 'uint32',
>> + '*max-active-zones': 'uint32',
>> + '*max-append-bytes': 'uint32' } }
>
> In other words, I'm envisioning something like an optional
> '*zone':'ZoneStruct', where:
>
> { 'struct': 'ZoneHostManaged',
> 'data': { 'size': 'size', '*capacity': 'size', ..., '*max-append-bytes': 'uint32' } }
> { 'union': 'ZoneStruct',
> 'base': { 'model': 'Qcow2ZoneModel' },
> 'discriminator': 'model',
> 'data': { 'non-zoned': {},
> 'host-managed': 'ZoneHostManaged' } }
>
> then over the wire, QMP can use the existing:
> { ..., "compression-type":"zstd" }
>
> as a synonym for the new but explicit non-zoned:
> { ..., "compression-type":"zstd", "zone":{"mode":"non-zoned"} }
I.e. @zone is optional, and defaults to {"mode": "non-zoned"}.
> and when we want to use zones, we pass:
> { ..., "compression-type":"zstd", "zone":{"mode":"host-managed", "size":16777216} }
>
> where you don't have to have zone- prefixing everywhere because it is
> instead contained in the smart union object where it is obvious from
> the 'mode' field what other fields should be present.
next prev parent reply other threads:[~2023-11-03 9:09 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-30 12:18 [PATCH v5 0/4] Add full zoned storage emulation to qcow2 driver Sam Li
2023-10-30 12:18 ` [PATCH v5 1/4] docs/qcow2: add the zoned format feature Sam Li
2023-10-30 14:04 ` Eric Blake
2023-10-30 14:19 ` Sam Li
2023-10-31 0:53 ` Damien Le Moal
2023-10-30 12:18 ` [PATCH v5 2/4] qcow2: add configurations for zoned format extension Sam Li
2023-10-30 14:53 ` Eric Blake
2023-10-30 15:01 ` Sam Li
2023-11-02 6:30 ` Stefan Hajnoczi
2023-11-03 9:08 ` Markus Armbruster [this message]
2023-11-16 18:01 ` Sam Li
2023-11-16 18:26 ` Sam Li
2023-11-02 10:19 ` Stefan Hajnoczi
2023-11-02 10:31 ` Stefan Hajnoczi
2023-11-16 17:55 ` Sam Li
2023-10-30 12:18 ` [PATCH v5 3/4] qcow2: add zoned emulation capability Sam Li
2023-10-30 12:18 ` [PATCH v5 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=878r7f19xm.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.