aboutsummaryrefslogtreecommitdiff
path: root/block/graph-lock.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/graph-lock.c')
-rw-r--r--block/graph-lock.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/block/graph-lock.c b/block/graph-lock.c
index e033c6d9ac..c4d9d2c274 100644
--- a/block/graph-lock.c
+++ b/block/graph-lock.c
@@ -259,3 +259,14 @@ void bdrv_graph_rdunlock_main_loop(void)
GLOBAL_STATE_CODE();
assert(!qemu_in_coroutine());
}
+
+void assert_bdrv_graph_readable(void)
+{
+ assert(qemu_in_main_thread() || reader_count());
+}
+
+void assert_bdrv_graph_writable(void)
+{
+ assert(qemu_in_main_thread());
+ assert(qatomic_read(&has_writer));
+}