qemu-block
[Top][All Lists]
Advanced

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

[RFC v4 9/9] qapi: add support for zoned host device


From: Sam Li
Subject: [RFC v4 9/9] qapi: add support for zoned host device
Date: Tue, 12 Jul 2022 10:13:45 +0800

---
 block/file-posix.c   | 8 +++++++-
 qapi/block-core.json | 7 +++++--
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/block/file-posix.c b/block/file-posix.c
index e9ad1d8e1e..4e0aa02acf 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -3737,6 +3737,12 @@ static void hdev_parse_filename(const char *filename, 
QDict *options,
     bdrv_parse_filename_strip_prefix(filename, "host_device:", options);
 }
 
+static void zoned_host_device_parse_filename(const char *filename, QDict 
*options,
+                                Error **errp)
+{
+    bdrv_parse_filename_strip_prefix(filename, "zoned_host_device:", options);
+}
+
 static bool hdev_is_sg(BlockDriverState *bs)
 {
 
@@ -3975,7 +3981,7 @@ static BlockDriver bdrv_zoned_host_device = {
         .is_zoned = true,
         .bdrv_needs_filename = true,
         .bdrv_probe_device  = hdev_probe_device,
-        .bdrv_parse_filename = hdev_parse_filename,
+        .bdrv_parse_filename = zoned_host_device_parse_filename,
         .bdrv_file_open     = hdev_open,
         .bdrv_close         = raw_close,
         .bdrv_reopen_prepare = raw_reopen_prepare,
diff --git a/qapi/block-core.json b/qapi/block-core.json
index 2173e7734a..ab05c2ef99 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -2955,7 +2955,8 @@
             'luks', 'nbd', 'nfs', 'null-aio', 'null-co', 'nvme', 'parallels',
             'preallocate', 'qcow', 'qcow2', 'qed', 'quorum', 'raw', 'rbd',
             { 'name': 'replication', 'if': 'CONFIG_REPLICATION' },
-            'ssh', 'throttle', 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat' ] }
+            'ssh', 'throttle', 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat',
+            { 'name': 'zoned_host_device', 'if': 'HAVE_HOST_BLOCK_DEVICE' } ] }
 
 ##
 # @BlockdevOptionsFile:
@@ -4329,7 +4330,9 @@
       'vhdx':       'BlockdevOptionsGenericFormat',
       'vmdk':       'BlockdevOptionsGenericCOWFormat',
       'vpc':        'BlockdevOptionsGenericFormat',
-      'vvfat':      'BlockdevOptionsVVFAT'
+      'vvfat':      'BlockdevOptionsVVFAT',
+      'zoned_host_device': { 'type': 'BlockdevOptionsFile',
+                             'if': 'HAVE_HOST_BLOCK_DEVICE' }
   } }
 
 ##
-- 
2.36.1




reply via email to

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