mirror of https://github.com/xemu-project/xemu.git
block: Fix bdrv_co_create_opts_simple() to open images with no_co_wrapper
bdrv_co_create_opts_simple() runs in a coroutine. Therefore it is not allowed to open images directly. Fix the call to use the corresponding no_co_wrapper instead. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Message-Id: <20230126172432.436111-13-kwolf@redhat.com> Reviewed-by: Emanuele Giuseppe Esposito <eesposit@redhat.com> Reviewed-by: Hanna Czenczek <hreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
6ef028519b
commit
be1a732c9a
4
block.c
4
block.c
|
@ -657,8 +657,8 @@ int coroutine_fn bdrv_co_create_opts_simple(BlockDriver *drv,
|
||||||
options = qdict_new();
|
options = qdict_new();
|
||||||
qdict_put_str(options, "driver", drv->format_name);
|
qdict_put_str(options, "driver", drv->format_name);
|
||||||
|
|
||||||
blk = blk_new_open(filename, NULL, options,
|
blk = blk_co_new_open(filename, NULL, options,
|
||||||
BDRV_O_RDWR | BDRV_O_RESIZE, errp);
|
BDRV_O_RDWR | BDRV_O_RESIZE, errp);
|
||||||
if (!blk) {
|
if (!blk) {
|
||||||
error_prepend(errp, "Protocol driver '%s' does not support image "
|
error_prepend(errp, "Protocol driver '%s' does not support image "
|
||||||
"creation, and opening the image failed: ",
|
"creation, and opening the image failed: ",
|
||||||
|
|
Loading…
Reference in New Issue