diff options
author | Kevin Wolf <kwolf@redhat.com> | 2023-09-29 16:51:47 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2023-10-12 16:31:33 +0200 |
commit | 4026f1c4f320aa072fa4cd299545cbc97315e246 (patch) | |
tree | 04e245a6c7399739f81c44f25ac930c236dcdecb /block/qcow2.c | |
parent | c0fc5123ad33158f6f289a896b568b9adce7d1f2 (diff) | |
download | qemu-4026f1c4f320aa072fa4cd299545cbc97315e246.zip qemu-4026f1c4f320aa072fa4cd299545cbc97315e246.tar.gz qemu-4026f1c4f320aa072fa4cd299545cbc97315e246.tar.bz2 |
block: Mark bdrv_get_parent_name() and callers GRAPH_RDLOCK
This adds GRAPH_RDLOCK annotations to declare that callers of
bdrv_get_parent_name() need to hold a reader lock for the graph
because it accesses the parents list of a node.
For some places, we know that they will hold the lock, but we don't have
the GRAPH_RDLOCK annotations yet. In this case, add assume_graph_lock()
with a FIXME comment. These places will be removed once everything is
properly annotated.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-ID: <20230929145157.45443-13-kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/qcow2.c')
-rw-r--r-- | block/qcow2.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/block/qcow2.c b/block/qcow2.c index 6e9c731..4780cb9 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -2737,6 +2737,8 @@ static int qcow2_inactivate(BlockDriverState *bs) int ret, result = 0; Error *local_err = NULL; + assume_graph_lock(); /* FIXME */ + qcow2_store_persistent_dirty_bitmaps(bs, true, &local_err); if (local_err != NULL) { result = -EINVAL; @@ -5945,6 +5947,8 @@ void qcow2_signal_corruption(BlockDriverState *bs, bool fatal, int64_t offset, char *message; va_list ap; + assume_graph_lock(); /* FIXME */ + fatal = fatal && bdrv_is_writable(bs); if (s->signaled_corruption && |