qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 13/14] block: keep flags an image was opened with


From: Uri Lublin
Subject: [Qemu-devel] [PATCH 13/14] block: keep flags an image was opened with
Date: Tue, 17 Mar 2009 22:40:51 +0200

Can be used to close and reopen images.

Can be used to check if BDRV_O_BACKING is on (a backing file).
Keep it in a single place instead of keeping it in
two places (also in block-qcow2.c)

Signed-off-by: Uri Lublin <address@hidden>
---
 block.c     |    2 ++
 block_int.h |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/block.c b/block.c
index 8d92d9e..a938ed7 100644
--- a/block.c
+++ b/block.c
@@ -358,6 +358,8 @@ int bdrv_open2(BlockDriverState *bs, const char *filename, 
int flags,
     bs->encrypted = 0;
     bs->valid_key = 0;
 
+    bs->open_flags = flags;
+
     if (flags & BDRV_O_SNAPSHOT) {
         BlockDriverState *bs1;
         int64_t total_size;
diff --git a/block_int.h b/block_int.h
index 2206178..715bbad 100644
--- a/block_int.h
+++ b/block_int.h
@@ -124,6 +124,8 @@ struct BlockDriverState {
     int is_temporary;
     int media_changed;
 
+    int open_flags; /* flags the image was opened with */
+
     BlockDriverState *backing_hd;
     /* async read/write emulation */
 
-- 
1.6.0.6





reply via email to

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