mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
block: do not reuse the backing file across bdrv_close/bdrv_open
This is another bug caused by not doing a full cleanup of the BDS across close/open. This was found with mirroring by Shaolong Hu, but it can probably be reproduced also with eject or change. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
3a389e7926
commit
a275fa42fa
1 changed files with 2 additions and 0 deletions
2
block.c
2
block.c
|
@ -878,6 +878,8 @@ void bdrv_close(BlockDriverState *bs)
|
|||
bs->opaque = NULL;
|
||||
bs->drv = NULL;
|
||||
bs->copy_on_read = 0;
|
||||
bs->backing_file[0] = '\0';
|
||||
bs->backing_format[0] = '\0';
|
||||
|
||||
if (bs->file != NULL) {
|
||||
bdrv_close(bs->file);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue