From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:52077) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RJLCe-00056K-Vd for qemu-devel@nongnu.org; Thu, 27 Oct 2011 04:20:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RJLCe-0001KU-08 for qemu-devel@nongnu.org; Thu, 27 Oct 2011 04:20:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48263) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RJLCd-0001KQ-NU for qemu-devel@nongnu.org; Thu, 27 Oct 2011 04:20:43 -0400 Message-ID: <4EA91514.5020709@redhat.com> Date: Thu, 27 Oct 2011 10:23:48 +0200 From: Kevin Wolf MIME-Version: 1.0 References: <1319632282-22725-1-git-send-email-kwolf@redhat.com> <1319632282-22725-2-git-send-email-kwolf@redhat.com> <20111027073712.GE32287@stefanha-thinkpad.localdomain> In-Reply-To: <20111027073712.GE32287@stefanha-thinkpad.localdomain> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/7] block: Remove dead code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-devel@nongnu.org Am 27.10.2011 09:37, schrieb Stefan Hajnoczi: > On Wed, Oct 26, 2011 at 02:31:16PM +0200, Kevin Wolf wrote: >> @@ -2039,11 +2039,7 @@ const char *bdrv_get_encrypted_filename(BlockDriverState *bs) >> void bdrv_get_backing_filename(BlockDriverState *bs, >> char *filename, int filename_size) >> { >> - if (!bs->backing_file) { >> - pstrcpy(filename, filename_size, ""); >> - } else { >> - pstrcpy(filename, filename_size, bs->backing_file); >> - } >> + pstrcpy(filename, filename_size, bs->backing_file); >> } > > I think this points to another problem: > > bs->backing_file[] is never cleared across bdrv_close()/bdrv_open(). > > If we open an image file that uses a backing file, then close the > BlockDriverState, and then open a file which does not use a backing file > we're left with the old backing file! Ouch! Care to send a fix? Did you check if there are more fields in BlockDriverState that should be cleared? Kevin