qemu-devel
[Top][All Lists]
Advanced

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

[PATCH 2/7] block/blkio: add "simple" creation support


From: Stefan Hajnoczi
Subject: [PATCH 2/7] block/blkio: add "simple" creation support
Date: Tue, 25 Jul 2023 10:19:10 -0400

Some block drivers do not support image creation. This is inconvenient
for test cases, which usually want to create an image before testing
various I/O requests.

Use bdrv_co_create_opts_simple(), which initializes a pre-existing image
instead of creating a new image, so that tests will be able to work with
libblkio-based block drivers.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 block/blkio.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/block/blkio.c b/block/blkio.c
index a0240a5bcc..28d11325e6 100644
--- a/block/blkio.c
+++ b/block/blkio.c
@@ -1032,6 +1032,8 @@ static void blkio_refresh_limits(BlockDriverState *bs, 
Error **errp)
     .instance_size           = sizeof(BDRVBlkioState), \
     .bdrv_file_open          = blkio_file_open, \
     .bdrv_close              = blkio_close, \
+    .bdrv_co_create_opts     = bdrv_co_create_opts_simple, \
+    .create_opts             = &bdrv_create_opts_simple, \
     .bdrv_co_getlength       = blkio_co_getlength, \
     .bdrv_co_truncate        = blkio_truncate, \
     .bdrv_co_get_info        = blkio_co_get_info, \
-- 
2.41.0




reply via email to

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