aboutsummaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorEmanuele Giuseppe Esposito <eesposit@redhat.com>2022-03-03 10:16:09 -0500
committerKevin Wolf <kwolf@redhat.com>2022-03-04 18:18:25 +0100
commit1581a70ddd0cd71a8520027d7136ed1e2f6bd19b (patch)
tree1959df08dca1a7e424448e52d4debdc7c5a97b74 /block.c
parent377cc15bf1994a176162a5f705ff32a38aa55e2c (diff)
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));