From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59964) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SRlmD-0007yO-LP for qemu-devel@nongnu.org; Tue, 08 May 2012 10:52:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SRlm7-0007VG-FA for qemu-devel@nongnu.org; Tue, 08 May 2012 10:52:33 -0400 Received: from mail-pz0-f47.google.com ([209.85.210.47]:52083) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SRlm7-0007Sn-6K for qemu-devel@nongnu.org; Tue, 08 May 2012 10:52:27 -0400 Received: by mail-pz0-f47.google.com with SMTP id h21so8313251dal.34 for ; Tue, 08 May 2012 07:52:26 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Tue, 8 May 2012 16:51:43 +0200 Message-Id: <1336488722-13120-4-git-send-email-pbonzini@redhat.com> In-Reply-To: <1336488722-13120-1-git-send-email-pbonzini@redhat.com> References: <1336488722-13120-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 1.1 03/22] 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: qemu-devel@nongnu.org Cc: kwolf@redhat.com, stefanha@linux.vnet.ibm.com 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 --- block.c | 2 ++ 1 file changed, 2 insertions(+) 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.10.1