From a275fa42fa872828585e9e6a92f975e87776554b Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Tue, 8 May 2012 16:51:43 +0200 Subject: [PATCH] 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 Signed-off-by: Kevin Wolf --- block.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block.c b/block.c index 6dc0d4486e..271f109cbe 100644 --- a/block.c +++ b/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);