summary refs log tree commit diff stats
path: root/tests/unit/test-bdrv-graph-mod.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2023-09-11 11:46:12 +0200
committerKevin Wolf <kwolf@redhat.com>2023-09-20 17:46:01 +0200
commit3804e3cf540af25a01d0d418a5a1d4f78c2574ff (patch)
tree7a3fb1b6ec027501a297d2cacbe31e00ecaaa8c9 /tests/unit/test-bdrv-graph-mod.c
parentafdaeb9ea06ea641ccc4226964b8e278af5e7685 (diff)
downloadfocaccia-qemu-3804e3cf540af25a01d0d418a5a1d4f78c2574ff.tar.gz
focaccia-qemu-3804e3cf540af25a01d0d418a5a1d4f78c2574ff.zip
block: Mark bdrv_parent_perms_conflict() and callers GRAPH_RDLOCK
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>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-ID: <20230911094620.45040-14-kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'tests/unit/test-bdrv-graph-mod.c')
-rw-r--r--tests/unit/test-bdrv-graph-mod.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/unit/test-bdrv-graph-mod.c b/tests/unit/test-bdrv-graph-mod.c
index 621e616655..8609f7f42b 100644
--- a/tests/unit/test-bdrv-graph-mod.c
+++ b/tests/unit/test-bdrv-graph-mod.c
@@ -372,6 +372,9 @@ static void test_parallel_perm_update(void)
 
     /* Select fl1 as first child to be active */
     s->selected = c_fl1;
+
+    bdrv_graph_rdlock_main_loop();
+
     bdrv_child_refresh_perms(top, top->children.lh_first, &error_abort);
 
     assert(c_fl1->perm & BLK_PERM_WRITE);
@@ -391,6 +394,7 @@ static void test_parallel_perm_update(void)
     assert(c_fl1->perm & BLK_PERM_WRITE);
     assert(!(c_fl2->perm & BLK_PERM_WRITE));
 
+    bdrv_graph_rdunlock_main_loop();
     bdrv_unref(top);
 }