summaryrefslogtreecommitdiffstats
path: root/block.c
diff options
context:
space:
mode:
authorEmanuele Giuseppe Esposito2022-03-03 16:16:09 +0100
committerKevin Wolf2022-03-04 18:18:25 +0100
commit1581a70ddd0cd71a8520027d7136ed1e2f6bd19b (patch)
tree1959df08dca1a7e424448e52d4debdc7c5a97b74 /block.c
parentblock/copy-before-write.h: global state API + assertions (diff)
downloadqemu-1581a70ddd0cd71a8520027d7136ed1e2f6bd19b.tar.gz
qemu-1581a70ddd0cd71a8520027d7136ed1e2f6bd19b.tar.xz
qemu-1581a70ddd0cd71a8520027d7136ed1e2f6bd19b.zip
block/coroutines: I/O and "I/O or GS" API
block coroutines functions run in different aiocontext, and are not protected by the BQL. Therefore are I/O. On the other side, generated_co_wrapper functions use BDRV_POLL_WHILE, meaning the caller can either be the main loop or a specific iothread. Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com> Message-Id: <20220303151616.325444-25-eesposit@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block.c')
-rw-r--r--block.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/block.c b/block.c
index d3b97c3569..b91f9b2d11 100644
--- a/block.c
+++ b/block.c
@@ -5454,6 +5454,7 @@ fail:
int coroutine_fn bdrv_co_check(BlockDriverState *bs,
BdrvCheckResult *res, BdrvCheckMode fix)
{
+ IO_CODE();
if (bs->drv == NULL) {
return -ENOMEDIUM;
}
@@ -6663,6 +6664,7 @@ int bdrv_activate(BlockDriverState *bs, Error **errp)
int coroutine_fn bdrv_co_invalidate_cache(BlockDriverState *bs, Error **errp)
{
Error *local_err = NULL;
+ IO_CODE();
assert(!(bs->open_flags & BDRV_O_INACTIVE));