mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-29 13:01:52 -06:00
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>
This commit is contained in:
parent
7e3d98dd31
commit
f1f25a2e2e
1 changed files with 4 additions and 1 deletions
5
block.c
5
block.c
|
@ -1525,8 +1525,11 @@ BlockReopenQueue *bdrv_reopen_queue(BlockReopenQueue *bs_queue,
|
||||||
QSIMPLEQ_INIT(bs_queue);
|
QSIMPLEQ_INIT(bs_queue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* bdrv_open() masks this flag out */
|
||||||
|
flags &= ~BDRV_O_PROTOCOL;
|
||||||
|
|
||||||
if (bs->file) {
|
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);
|
bs_entry = g_new0(BlockReopenQueueEntry, 1);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue