[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 01/17] block: do not rely on open_flags for bdrv_is_

From: Paolo Bonzini
Subject: [Qemu-devel] [PATCH 01/17] block: do not rely on open_flags for bdrv_is_snapshot
Date: Tue, 13 Dec 2011 13:37:04 +0100

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

(Instead, bdrv_commit uses the backing file's open_flags and those
flags never include any of BDRV_O_SNAPSHOT, BDRV_O_NO_BACKING

We will fix the open_flags soon.  In the meanwhile, do not rely
on open_flags including BDRV_O_SNAPSHOT.

Signed-off-by: Paolo Bonzini <address@hidden>
 block.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/block.c b/block.c
index 56c7981..a96f080 100644
--- a/block.c
+++ b/block.c
@@ -2463,7 +2463,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)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]