aboutsummaryrefslogtreecommitdiff
path: root/block/snapshot-access.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/snapshot-access.c')
-rw-r--r--block/snapshot-access.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/block/snapshot-access.c b/block/snapshot-access.c
index 7c45739eb1..84d0d13f86 100644
--- a/block/snapshot-access.c
+++ b/block/snapshot-access.c
@@ -85,6 +85,9 @@ static int snapshot_access_open(BlockDriverState *bs, QDict *options, int flags,
bdrv_open_child(NULL, options, "file", bs, &child_of_bds,
BDRV_CHILD_DATA | BDRV_CHILD_PRIMARY,
false, errp);
+
+ GRAPH_RDLOCK_GUARD_MAINLOOP();
+
if (!bs->file) {
return -EINVAL;
}