summaryrefslogtreecommitdiffstats
path: root/block.c
diff options
context:
space:
mode:
authorKevin Wolf2014-04-25 19:04:55 +0200
committerKevin Wolf2014-04-30 11:05:00 +0200
commitf1f25a2e2ea0cd3cdc7d01f2e0afbc4aef6fb853 (patch)
tree6d693540b7cca30374f3ff5a66c79766b532ba67 /block.c
parentRevert "block: another bdrv_append fix" (diff)
downloadqemu-f1f25a2e2ea0cd3cdc7d01f2e0afbc4aef6fb853.tar.gz
qemu-f1f25a2e2ea0cd3cdc7d01f2e0afbc4aef6fb853.tar.xz
qemu-f1f25a2e2ea0cd3cdc7d01f2e0afbc4aef6fb853.zip
block: Fix open_flags in bdrv_reopen()
Use the same function as bdrv_open() for determining what the right flags for bs->file are. Without doing this, a reopen means that bs->file loses BDRV_O_CACHE_WB or BDRV_O_UNMAP if bs doesn't have it as well. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'block.c')
-rw-r--r--block.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/block.c b/block.c
index 9f6f07e75c..b749d31ad4 100644
--- a/block.c
+++ b/block.c
@@ -1525,8 +1525,11 @@ BlockReopenQueue *bdrv_reopen_queue(BlockReopenQueue *bs_queue,
QSIMPLEQ_INIT(bs_queue);
}
+ /* bdrv_open() masks this flag out */
+ flags &= ~BDRV_O_PROTOCOL;
+
if (bs->file) {
- bdrv_reopen_queue(bs_queue, bs->file, flags);
+ bdrv_reopen_queue(bs_queue, bs->file, bdrv_inherited_flags(flags));
}
bs_entry = g_new0(BlockReopenQueueEntry, 1);