The BDRV_O_SNAPSHOT flag is stored in open_flags but not passed to bdrv_open. This makes the usage of bs->open_flags wrong in bdrv_snapshot_goto.
(Instead, bdrv_commit uses the backing file's open_flags and those flags never include any of BDRV_O_SNAPSHOT, BDRV_O_NO_BACKING or BDRV_O_RDWR). We will fix the open_flags soon. In the meanwhile, do not rely on the fact that BDRV_O_SNAPSHOT is stored in open_flags. Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> --- block.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/block.c b/block.c index 3621d11..c5a85a2 100644 --- a/block.c +++ b/block.c @@ -2494,7 +2494,7 @@ int bdrv_can_snapshot(BlockDriverState *bs) int bdrv_is_snapshot(BlockDriverState *bs) { - return !!(bs->open_flags & BDRV_O_SNAPSHOT); + return bs->is_temporary; } BlockDriverState *bdrv_snapshots(void) -- 1.7.7.6