aboutsummaryrefslogtreecommitdiff
path: root/block/copy-before-write.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/copy-before-write.c')
-rw-r--r--block/copy-before-write.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/block/copy-before-write.c b/block/copy-before-write.c
index 8193d3a4cd..ad3b73cc4a 100644
--- a/block/copy-before-write.c
+++ b/block/copy-before-write.c
@@ -433,6 +433,8 @@ static int cbw_open(BlockDriverState *bs, QDict *options, int flags,
return -EINVAL;
}
+ GRAPH_RDLOCK_GUARD_MAINLOOP();
+
ctx = bdrv_get_aio_context(bs);
aio_context_acquire(ctx);