aboutsummaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2023-09-11 11:46:16 +0200
committerKevin Wolf <kwolf@redhat.com>2023-09-20 17:46:01 +0200
commit733467a1e6067070a8b641f51675d0cb5b715a83 (patch)
tree47de8c6c05d8a99490dbccf94f21b385891bb11d /block.c
parent356f4ef611df18f6f8323a9fe6e6b4963272bf74 (diff)
downloadqemu-733467a1e6067070a8b641f51675d0cb5b715a83.zip
qemu-733467a1e6067070a8b641f51675d0cb5b715a83.tar.gz
qemu-733467a1e6067070a8b641f51675d0cb5b715a83.tar.bz2
block: Take graph rdlock in bdrv_drop_intermediate()
The function reads the parents list, so it needs to hold the graph lock. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Emanuele Giuseppe Esposito <eesposit@redhat.com> Message-ID: <20230911094620.45040-18-kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block.c')
-rw-r--r--block.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/block.c b/block.c
index 06d2a1b..e024a6c 100644
--- a/block.c
+++ b/block.c
@@ -5938,9 +5938,11 @@ int bdrv_drop_intermediate(BlockDriverState *top, BlockDriverState *base,
backing_file_str = base->filename;
}
+ bdrv_graph_rdlock_main_loop();
QLIST_FOREACH(c, &top->parents, next_parent) {
updated_children = g_slist_prepend(updated_children, c);
}
+ bdrv_graph_rdunlock_main_loop();
/*
* It seems correct to pass detach_subchain=true here, but it triggers