block: Mark bdrv_co_copy_range() GRAPH_RDLOCK

This adds GRAPH_RDLOCK annotations to declare that callers of
bdrv_co_copy_range() 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-15-kwolf@redhat.com>
Reviewed-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
Emanuele Giuseppe Esposito 2023-02-03 16:21:53 +01:00 committed by Kevin Wolf
parent eeb4777544
commit 742bf09b20
10 changed files with 66 additions and 77 deletions

View file

@ -4065,7 +4065,7 @@ static coroutine_fn int qcow2_co_pdiscard(BlockDriverState *bs,
return ret;
}
static int coroutine_fn
static int coroutine_fn GRAPH_RDLOCK
qcow2_co_copy_range_from(BlockDriverState *bs,
BdrvChild *src, int64_t src_offset,
BdrvChild *dst, int64_t dst_offset,
@ -4148,7 +4148,7 @@ out:
return ret;
}
static int coroutine_fn
static int coroutine_fn GRAPH_RDLOCK
qcow2_co_copy_range_to(BlockDriverState *bs,
BdrvChild *src, int64_t src_offset,
BdrvChild *dst, int64_t dst_offset,
@ -4161,7 +4161,6 @@ qcow2_co_copy_range_to(BlockDriverState *bs,
uint64_t host_offset;
QCowL2Meta *l2meta = NULL;
assume_graph_lock(); /* FIXME */
assert(!bs->encrypted);
qemu_co_mutex_lock(&s->lock);