Received: from eggs.gnu.org ([140.186.70.92]:34022) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RJL32-0007Js-Cz for qemu-devel@nongnu.org; Thu, 27 Oct 2011 04:10:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RJL30-0007wW-UR for qemu-devel@nongnu.org; Thu, 27 Oct 2011 04:10:48 -0400 Received: from mail-ey0-f173.google.com ([209.85.215.173]:39922) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RJL30-0007ua-NB for qemu-devel@nongnu.org; Thu, 27 Oct 2011 04:10:46 -0400 Received: by mail-ey0-f173.google.com with SMTP id 6so2486272eyh.4 for ; Thu, 27 Oct 2011 01:10:46 -0700 (PDT) Date: Thu, 27 Oct 2011 08:37:12 +0100 From: Stefan Hajnoczi Message-ID: <20111027073712.GE32287@stefanha-thinkpad.localdomain> References: <1319632282-22725-1-git-send-email-kwolf@redhat.com> <1319632282-22725-2-git-send-email-kwolf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1319632282-22725-2-git-send-email-kwolf@redhat.com> Subject: Re: [Qemu-devel] [PATCH 1/7] block: Remove dead code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org 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! Stefan