From 4ec8df0183d0906ae6704d65ef6d8082c970ecdf Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Fri, 3 Feb 2023 16:21:55 +0100 Subject: block: Mark bdrv_co_create() and callers GRAPH_RDLOCK This adds GRAPH_RDLOCK annotations to declare that callers of bdrv_co_create() need to hold a reader lock for the graph. Signed-off-by: Emanuele Giuseppe Esposito Signed-off-by: Kevin Wolf Message-Id: <20230203152202.49054-17-kwolf@redhat.com> Reviewed-by: Emanuele Giuseppe Esposito Signed-off-by: Kevin Wolf --- block.c | 1 + 1 file changed, 1 insertion(+) (limited to 'block.c') diff --git a/block.c b/block.c index 31f13092cb..484f48ae2d 100644 --- a/block.c +++ b/block.c @@ -533,6 +533,7 @@ int coroutine_fn bdrv_co_create(BlockDriver *drv, const char *filename, int ret; GLOBAL_STATE_CODE(); ERRP_GUARD(); + assert_bdrv_graph_readable(); if (!drv->bdrv_co_create_opts) { error_setg(errp, "Driver '%s' does not support image creation", -- cgit 1.4.1