mirror of https://gitee.com/openkylin/qemu.git
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>
This commit is contained in:
parent
e023b2e244
commit
3a389e7926
1
block.c
1
block.c
|
@ -977,6 +977,7 @@ void bdrv_append(BlockDriverState *bs_new, BlockDriverState *bs_top)
|
||||||
tmp = *bs_new;
|
tmp = *bs_new;
|
||||||
|
|
||||||
/* there are some fields that need to stay on the top layer: */
|
/* there are some fields that need to stay on the top layer: */
|
||||||
|
tmp.open_flags = bs_top->open_flags;
|
||||||
|
|
||||||
/* dev info */
|
/* dev info */
|
||||||
tmp.dev_ops = bs_top->dev_ops;
|
tmp.dev_ops = bs_top->dev_ops;
|
||||||
|
|
Loading…
Reference in New Issue