The qemu-iotests test suite requires filename parsing because it does
not use image options syntax everywhere. Add it now so that later
patches can enable qemu-iotests for the io_uring block driver.

The blkio.c code has other libblkio-based drivers that could benefit
from filename parsing too. Leave them for now because I am not yet ready
to add qemu-iotests support for them.

Suggested-by: Hanna Czenczek <hre...@redhat.com>
Suggested-by: Kevin Wolf <kw...@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefa...@redhat.com>
---
 block/blkio.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/block/blkio.c b/block/blkio.c
index 1798648134..a0240a5bcc 100644
--- a/block/blkio.c
+++ b/block/blkio.c
@@ -603,6 +603,12 @@ static void blkio_unregister_buf(BlockDriverState *bs, 
void *host, size_t size)
     }
 }
 
+static void blkio_io_uring_parse_filename(const char *filename, QDict *options,
+                                          Error **errp)
+{
+    bdrv_parse_filename_strip_prefix(filename, "io_uring:", options);
+}
+
 static int blkio_io_uring_open(BlockDriverState *bs, QDict *options, int flags,
                                Error **errp)
 {
@@ -1049,6 +1055,7 @@ static BlockDriver bdrv_io_uring = {
     .format_name         = "io_uring",
     .protocol_name       = "io_uring",
     .bdrv_needs_filename = true,
+    .bdrv_parse_filename = blkio_io_uring_parse_filename,
     BLKIO_DRIVER_COMMON
 };
 
-- 
2.41.0


Reply via email to