Markus Armbruster <arm...@redhat.com> 于2024年2月19日周一 13:05写道: > > One more thing... > > Markus Armbruster <arm...@redhat.com> writes: > > > I apologize for the delayed review.
No problems. Thanks for reviewing! > > > > Sam Li <faithilike...@gmail.com> writes: > > > >> 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 image with zoned format feature, use command like > >> this: > >> qemu-img create -f qcow2 zbc.qcow2 -o size=768M \ > >> -o zone.size=64M -o zone.capacity=64M -o zone.conventional_zones=0 \ > >> -o zone.max_append_bytes=4096 -o zone.max_open_zones=6 \ > >> -o zone.max_active_zones=8 -o zone.mode=host-managed > >> > >> Signed-off-by: Sam Li <faithilike...@gmail.com> > > > > [...] > > > >> diff --git a/qapi/block-core.json b/qapi/block-core.json > >> index ca390c5700..e2e0ec21a5 100644 > >> --- a/qapi/block-core.json > >> +++ b/qapi/block-core.json > >> @@ -5038,6 +5038,67 @@ > >> { 'enum': 'Qcow2CompressionType', > >> 'data': [ 'zlib', { 'name': 'zstd', 'if': 'CONFIG_ZSTD' } ] } > >> > >> +## > >> +# @Qcow2ZoneModel: > >> +# > >> +# Zoned device model used in qcow2 image file > >> +# > >> +# @host-managed: The host-managed model only allows sequential write over > >> the > >> +# device zones. > >> +# > >> +# Since 8.2 > >> +## > >> +{ 'enum': 'Qcow2ZoneModel', > >> + 'data': [ 'host-managed'] } > >> + > >> +## > >> +# @Qcow2ZoneHostManaged: > >> +# > >> +# The host-managed zone model. It only allows sequential writes. > >> +# > >> +# @size: Total number of bytes within zones. > > > > Default? It should be set by users. No default value provided. If it's unset then it is zero and an error will be returned. > > > >> +# > >> +# @capacity: The number of usable logical blocks within zones > >> +# in bytes. A zone capacity is always smaller or equal to the > >> +# zone size. > > > > Default? Same. > > > >> +# @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 and less than the zone capacity. > > > > Default? Same. For those values, I guess it could be set when users provide no information and still want a workable emulated zoned block device. > > > >> +# > >> +# Since 8.2 > >> +## > >> +{ 'struct': 'Qcow2ZoneHostManaged', > >> + 'data': { '*size': 'size', > >> + '*capacity': 'size', > >> + '*conventional-zones': 'uint32', > >> + '*max-open-zones': 'uint32', > >> + '*max-active-zones': 'uint32', > >> + '*max-append-bytes': 'size' } } > >> + > >> +## > >> +# @Qcow2ZoneCreateOptions: > >> +# > >> +# The zone device model for the qcow2 image. > > Please document member @mode. > > Fails to build since merge commit 61e7a0d27c1: > > qapi/block-core.json: In union 'Qcow2ZoneCreateOptions': > qapi/block-core.json:5135: member 'mode' lacks documentation > I see. Will update to the latest commit. > >> +# > >> +# Since 8.2 > >> +## > >> +{ 'union': 'Qcow2ZoneCreateOptions', > >> + 'base': { 'mode': 'Qcow2ZoneModel' }, > >> + 'discriminator': 'mode', > >> + 'data': { 'host-managed': 'Qcow2ZoneHostManaged' } } > >> + > >> ## > >> # @BlockdevCreateOptionsQcow2: > >> # > >> @@ -5080,6 +5141,9 @@ > >> # @compression-type: The image cluster compression method > >> # (default: zlib, since 5.1) > >> # > >> +# @zone: The zone device model modes. The default is that the device is > >> +# not zoned. (since 8.2) > >> +# > >> # Since: 2.12 > >> ## > >> { 'struct': 'BlockdevCreateOptionsQcow2', > >> @@ -5096,7 +5160,8 @@ > >> '*preallocation': 'PreallocMode', > >> '*lazy-refcounts': 'bool', > >> '*refcount-bits': 'int', > >> - '*compression-type':'Qcow2CompressionType' } } > >> + '*compression-type':'Qcow2CompressionType', > >> + '*zone': 'Qcow2ZoneCreateOptions' } } > >> > >> ## > >> # @BlockdevCreateOptionsQed: >