qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: qemu-block@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>,
	Hanna Reitz <hreitz@redhat.com>, Kevin Wolf <kwolf@redhat.com>
Subject: [PATCH 1/7] block/blkio: add io_uring: filename parsing
Date: Tue, 25 Jul 2023 10:19:09 -0400	[thread overview]
Message-ID: <20230725141915.386364-2-stefanha@redhat.com> (raw)
In-Reply-To: <20230725141915.386364-1-stefanha@redhat.com>

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 <hreitz@redhat.com>
Suggested-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@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	other threads:[~2023-07-25 14:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-25 14:19 [PATCH 0/7] iotests: add -io_uring support Stefan Hajnoczi
2023-07-25 14:19 ` Stefan Hajnoczi [this message]
2023-07-25 14:19 ` [PATCH 2/7] block/blkio: add "simple" creation support Stefan Hajnoczi
2023-07-25 14:19 ` [PATCH 3/7] iotests: string substitution order in _filter_img_create_filenames Stefan Hajnoczi
2023-07-25 14:19 ` [PATCH 4/7] iotests: filter img create backing_file when IMGPROTO is modified Stefan Hajnoczi
2023-07-25 14:19 ` [PATCH 5/7] iotests: add -io_uring support Stefan Hajnoczi
2023-07-25 14:19 ` [PATCH 6/7] iotests: add io_uring to supported protocols in 012 Stefan Hajnoczi
2023-07-25 14:19 ` [PATCH 7/7] iotests: add io_uring to supported protocols in 052 Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230725141915.386364-2-stefanha@redhat.com \
    --to=stefanha@redhat.com \
    --cc=hreitz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).