]> xenbits.xensource.com Git - qemu-upstream-unstable.git/commitdiff
block: another bdrv_append fix
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 8 May 2012 14:51:42 +0000 (16:51 +0200)
committerKevin Wolf <kwolf@redhat.com>
Thu, 10 May 2012 08:32:12 +0000 (10:32 +0200)
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>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block.c

diff --git a/block.c b/block.c
index 87600a54dd92df09ab66534293b49bd6aba8d1ca..6dc0d4486eff8c2ef5a61992d719df61f60bd604 100644 (file)
--- 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;