aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2023-05-04 13:57:32 +0200
committerKevin Wolf <kwolf@redhat.com>2023-05-10 14:16:53 +0200
commitda4afaff074e56b0fa0d25abf865784148018895 (patch)
tree4925a8d084e0d7f6356606aa1be88f3f43751e76 /include
parent0050c163ff6d8167e07c9fc4be7f728316140cb6 (diff)
downloadqemu-da4afaff074e56b0fa0d25abf865784148018895.zip
qemu-da4afaff074e56b0fa0d25abf865784148018895.tar.gz
qemu-da4afaff074e56b0fa0d25abf865784148018895.tar.bz2
block: Consistently call bdrv_activate() outside coroutine
Migration code can call bdrv_activate() in coroutine context, whereas other callers call it outside of coroutines. As it calls other code that is not supposed to run in coroutines, standardise on running outside of coroutines. This adds a no_co_wrapper to switch to the main loop before calling bdrv_activate(). Cc: qemu-stable@nongnu.org Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20230504115750.54437-3-kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/block/block-global-state.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/block/block-global-state.h b/include/block/block-global-state.h
index 399200a..2c312cc 100644
--- a/include/block/block-global-state.h
+++ b/include/block/block-global-state.h
@@ -166,7 +166,11 @@ int bdrv_amend_options(BlockDriverState *bs_new, QemuOpts *opts,
BlockDriverState *check_to_replace_node(BlockDriverState *parent_bs,
const char *node_name, Error **errp);
-int bdrv_activate(BlockDriverState *bs, Error **errp);
+int no_coroutine_fn bdrv_activate(BlockDriverState *bs, Error **errp);
+
+int coroutine_fn no_co_wrapper
+bdrv_co_activate(BlockDriverState *bs, Error **errp);
+
void bdrv_activate_all(Error **errp);
int bdrv_inactivate_all(void);