From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59834) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSRsd-0001S6-PA for qemu-devel@nongnu.org; Thu, 10 May 2012 07:50:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SSRsX-0006FJ-Ja for qemu-devel@nongnu.org; Thu, 10 May 2012 07:49:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27734) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSRsX-0006Eg-As for qemu-devel@nongnu.org; Thu, 10 May 2012 07:49:53 -0400 From: Kevin Wolf Date: Thu, 10 May 2012 13:49:17 +0200 Message-Id: <1336650574-12835-14-git-send-email-kwolf@redhat.com> In-Reply-To: <1336650574-12835-1-git-send-email-kwolf@redhat.com> References: <1336650574-12835-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH 13/30] block: do not reuse the backing file across bdrv_close/bdrv_open List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@nongnu.org From: Paolo Bonzini 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 files changed, 2 insertions(+), 0 deletions(-) diff --git a/block.c b/block.c index 6dc0d44..271f109 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); -- 1.7.6.5