diff options
author | Kevin Wolf <kwolf@redhat.com> | 2023-02-03 16:22:01 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2023-02-23 19:49:32 +0100 |
commit | 167f748d8c1300196ac55fe3eef5518bf7b1f949 (patch) | |
tree | d3f3fdaa356b73219a4f99782af20e93e9ec412f /block | |
parent | 48aef7944090fdddd6a89e07b790798cf31b56a4 (diff) |
block: Mark bdrv_*_dirty_bitmap() and callers GRAPH_RDLOCK
This adds GRAPH_RDLOCK annotations to declare that callers of
bdrv_*_dirty_bitmap() need to hold a reader lock for the graph.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20230203152202.49054-23-kwolf@redhat.com>
Reviewed-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/dirty-bitmap.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c index 1e7aee4010..13a1979755 100644 --- a/block/dirty-bitmap.c +++ b/block/dirty-bitmap.c @@ -394,6 +394,7 @@ int coroutine_fn bdrv_co_remove_persistent_dirty_bitmap(BlockDriverState *bs, const char *name, Error **errp) { + assert_bdrv_graph_readable(); if (bs->drv && bs->drv->bdrv_co_remove_persistent_dirty_bitmap) { return bs->drv->bdrv_co_remove_persistent_dirty_bitmap(bs, name, errp); } @@ -415,6 +416,7 @@ bdrv_co_can_store_new_dirty_bitmap(BlockDriverState *bs, const char *name, uint32_t granularity, Error **errp) { BlockDriver *drv = bs->drv; + assert_bdrv_graph_readable(); if (!drv) { error_setg_errno(errp, ENOMEDIUM, |