summaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-05-08 16:51:42 +0200
committerKevin Wolf <kwolf@redhat.com>2012-05-10 10:32:12 +0200
commit3a389e7926750cba5c83f662b1941888b2bebc04 (patch)
treeccb80705b331227179348ff7337a26d4473f08bc /block.c
parente023b2e244ddcc25308309d20c6bfd037897b10c (diff)
downloadqemu-3a389e7926750cba5c83f662b1941888b2bebc04.tar.gz
qemu-3a389e7926750cba5c83f662b1941888b2bebc04.tar.bz2
qemu-3a389e7926750cba5c83f662b1941888b2bebc04.zip
block: another bdrv_append fix
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>
Diffstat (limited to 'block.c')
-rw-r--r--block.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/block.c b/block.c
index 87600a54dd..6dc0d4486e 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;