qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RFC 1/2] block: add configs for the zoned format driver


From: Sam Li
Subject: [RFC 1/2] block: add configs for the zoned format driver
Date: Mon, 19 Dec 2022 17:08:39 +0800

To configure a zoned format driver, it has following arguments:
device size, zoned model, zone size, number of conventional zones,
number of sequential zones, max append sectors, max open zones,
and max_active_zones.

Signed-off-by: Sam Li <faithilikerun@gmail.com>
---
 block/meson.build                |  1 +
 include/block/block_int-common.h |  7 +++++
 qapi/block-core.json             | 44 +++++++++++++++++++++++++++++---
 3 files changed, 49 insertions(+), 3 deletions(-)

diff --git a/block/meson.build b/block/meson.build
index 90011a2805..ab83d0f644 100644
--- a/block/meson.build
+++ b/block/meson.build
@@ -44,6 +44,7 @@ block_ss.add(files(
   'vmdk.c',
   'vpc.c',
   'write-threshold.c',
+  'zoned.c',
 ), zstd, zlib, gnutls)
 
 softmmu_ss.add(when: 'CONFIG_TCG', if_true: files('blkreplay.c'))
diff --git a/include/block/block_int-common.h b/include/block/block_int-common.h
index 4ae595849e..be9f6e1c03 100644
--- a/include/block/block_int-common.h
+++ b/include/block/block_int-common.h
@@ -61,6 +61,13 @@
 #define BLOCK_OPT_DATA_FILE_RAW     "data_file_raw"
 #define BLOCK_OPT_COMPRESSION_TYPE  "compression_type"
 #define BLOCK_OPT_EXTL2             "extended_l2"
+#define BLOCK_OPT_Z_TYPE            "zoned"
+#define BLOCK_OPT_Z_ZSIZE           "zone_size"
+#define BLOCK_OPT_Z_NR_COV          "zone_nr_conv"
+#define BLOCK_OPT_Z_NR_SEQ          "zone_nr_seq"
+#define BLOCK_OPT_Z_MAS             "max_append_sectors"
+#define BLOCK_OPT_Z_MAZ             "max_active_zones"
+#define BLOCK_OPT_Z_MOZ             "max_open_zones"
 
 #define BLOCK_PROBE_BUF_SIZE        512
 
diff --git a/qapi/block-core.json b/qapi/block-core.json
index d86ad0907b..00d9164806 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -363,7 +363,7 @@
 #       0.14 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg',
 #       'file', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device',
 #       'http', 'https', 'luks', 'nbd', 'parallels', 'qcow',
-#       'qcow2', 'raw', 'vdi', 'vmdk', 'vpc', 'vvfat'
+#       'qcow2', 'raw', 'vdi', 'vmdk', 'vpc', 'vvfat', 'zoned'
 #       2.2: 'archipelago' added, 'cow' dropped
 #       2.3: 'host_floppy' deprecated
 #       2.5: 'host_floppy' dropped
@@ -2958,7 +2958,7 @@
             'luks', 'nbd', 'nfs', 'null-aio', 'null-co', 'nvme',
             { 'name': 'nvme-io_uring', 'if': 'CONFIG_BLKIO' },
             'parallels', 'preallocate', 'qcow', 'qcow2', 'qed', 'quorum',
-            'raw', 'rbd',
+            'raw', 'rbd', 'zoned',
             { 'name': 'replication', 'if': 'CONFIG_REPLICATION' },
             'ssh', 'throttle', 'vdi', 'vhdx',
             { 'name': 'virtio-blk-vfio-pci', 'if': 'CONFIG_BLKIO' },
@@ -4227,6 +4227,20 @@
   'base': 'BlockdevOptionsGenericFormat',
   'data': { '*offset': 'int', '*size': 'int' } }
 
+##
+# @BlockdevOptionsZoned:
+#
+# Driver specific block device options for the zoned driver.
+#
+# @offset: position where the block device starts
+# @size: the assumed size of the device
+#
+# Since: 2.9
+##
+{ 'struct': 'BlockdevOptionsZoned',
+  'base': 'BlockdevOptionsGenericFormat',
+  'data': { '*offset': 'int', '*size': 'int'} }
+
 ##
 # @BlockdevOptionsThrottle:
 #
@@ -4419,6 +4433,7 @@
       'vmdk':       'BlockdevOptionsGenericCOWFormat',
       'vpc':        'BlockdevOptionsGenericFormat',
       'vvfat':      'BlockdevOptionsVVFAT',
+      'zoned':      'BlockdevOptionsZoned',
       'zoned_host_device': { 'type': 'BlockdevOptionsFile',
                              'if': 'CONFIG_BLKZONED' }
   } }
@@ -4980,6 +4995,28 @@
             '*subformat':           'BlockdevVpcSubformat',
             '*force-size':          'bool' } }
 
+##
+# @BlockdevCreateOptionsZoned:
+#
+# Driver specific image creation options for zoned device.
+#
+# @file: Node to create the image format on
+# @size: Size of the virtual disk in bytes
+#
+# Since: 7.2
+##
+{ 'struct': 'BlockdevCreateOptionsZoned',
+  'data': { 'file':                 'BlockdevRef',
+            'size':                 'size',
+            'zone-size':            'size',
+            'zoned':                'int',
+            'zone-nr-conv':           'int',
+            'zone-nr-seq':            'int',
+            'max-open-zones':         'int',
+            'max-active-zones':       'int',
+            'max-append-sectors':     'int'}}
+
+
 ##
 # @BlockdevCreateOptions:
 #
@@ -5007,7 +5044,8 @@
       'vdi':            'BlockdevCreateOptionsVdi',
       'vhdx':           'BlockdevCreateOptionsVhdx',
       'vmdk':           'BlockdevCreateOptionsVmdk',
-      'vpc':            'BlockdevCreateOptionsVpc'
+      'vpc':            'BlockdevCreateOptionsVpc',
+      'zoned':          'BlockdevCreateOptionsZoned'
   } }
 
 ##
-- 
2.38.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]