block: Mark bdrv_co_eject/lock_medium() and callers GRAPH_RDLOCK

This adds GRAPH_RDLOCK annotations to declare that callers of
bdrv_co_eject() and bdrv_co_lock_medium() need to hold a reader lock for
the graph.

Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20230203152202.49054-20-kwolf@redhat.com>
Reviewed-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
Kevin Wolf 2023-02-03 16:21:58 +01:00
parent c73ff92c9d
commit 79a292e5ec
7 changed files with 23 additions and 10 deletions

View file

@ -213,13 +213,15 @@ cor_co_pwritev_compressed(BlockDriverState *bs, int64_t offset, int64_t bytes,
}
static void coroutine_fn cor_co_eject(BlockDriverState *bs, bool eject_flag)
static void coroutine_fn GRAPH_RDLOCK
cor_co_eject(BlockDriverState *bs, bool eject_flag)
{
bdrv_co_eject(bs->file->bs, eject_flag);
}
static void coroutine_fn cor_co_lock_medium(BlockDriverState *bs, bool locked)
static void coroutine_fn GRAPH_RDLOCK
cor_co_lock_medium(BlockDriverState *bs, bool locked)
{
bdrv_co_lock_medium(bs->file->bs, locked);
}