qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 12/30] block: another bdrv_append fix


From: Kevin Wolf
Subject: [Qemu-devel] [PATCH 12/30] block: another bdrv_append fix
Date: Thu, 10 May 2012 13:49:16 +0200

From: Paolo Bonzini <address@hidden>

bdrv_append must also copy open_flags to the top, because the snapshot
has BDRV_O_NO_BACKING set.  This causes interesting results if you
later use drive-reopen (not upstream) to reopen the image, and lose
the backing file in the process.

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

diff --git a/block.c b/block.c
index 87600a5..6dc0d44 100644
--- a/block.c
+++ b/block.c
@@ -977,6 +977,7 @@ void bdrv_append(BlockDriverState *bs_new, BlockDriverState 
*bs_top)
     tmp = *bs_new;
 
     /* there are some fields that need to stay on the top layer: */
+    tmp.open_flags        = bs_top->open_flags;
 
     /* dev info */
     tmp.dev_ops           = bs_top->dev_ops;
-- 
1.7.6.5




reply via email to

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