Sam Li <faithilike...@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 <faithilike...@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: