block: Mark bdrv_amend_options() and callers GRAPH_RDLOCK

This adds GRAPH_RDLOCK annotations to declare that callers of
bdrv_amend_options() need to hold a reader lock for the graph. This
removes an assume_graph_lock() call in crypto's implementation.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-ID: <20230929145157.45443-14-kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
Kevin Wolf 2023-09-29 16:51:48 +02:00
parent 4026f1c4f3
commit bd131d6705
4 changed files with 16 additions and 13 deletions

View file

@ -828,7 +828,7 @@ block_crypto_amend_options_generic_luks(BlockDriverState *bs,
errp);
}
static int
static int GRAPH_RDLOCK
block_crypto_amend_options_luks(BlockDriverState *bs,
QemuOpts *opts,
BlockDriverAmendStatusCB *status_cb,
@ -841,8 +841,6 @@ block_crypto_amend_options_luks(BlockDriverState *bs,
QCryptoBlockAmendOptions *amend_options = NULL;
int ret = -EINVAL;
assume_graph_lock(); /* FIXME */
assert(crypto);
assert(crypto->block);