diff mbox

[27/26] block: another bdrv_append fix

Message ID 1334676731-31757-1-git-send-email-pbonzini@redhat.com
State New
Headers show

Commit Message

Paolo Bonzini April 17, 2012, 3:32 p.m. UTC
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 <pbonzini@redhat.com>
---
        A last minute addition...

 block.c |    1 +
 1 file changed, 1 insertion(+)
diff mbox

Patch

diff --git a/block.c b/block.c
index 1f4f476..9c7d896 100644
--- a/block.c
+++ b/block.c
@@ -934,6 +934,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;