static int blkreplay_snapshot_goto(BlockDriverState *bs,
const char *snapshot_id)
{
- return bdrv_snapshot_goto(bs->file->bs, snapshot_id, NULL);
+ BlockDriverState *file_bs;
+
+ bdrv_graph_rdlock_main_loop();
+ file_bs = bs->file->bs;
+ bdrv_graph_rdunlock_main_loop();
+
+ return bdrv_snapshot_goto(file_bs, snapshot_id, NULL);
}
static BlockDriver bdrv_blkreplay = {