qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH v2 01/18] block: do not rely on open_flags for bdrv_


From: Paolo Bonzini
Subject: [Qemu-devel] [PATCH v2 01/18] block: do not rely on open_flags for bdrv_is_snapshot
Date: Thu, 26 Jan 2012 18:22:32 +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
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 <address@hidden>
---
 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





reply via email to

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