qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/7] block: Remove dead code


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH 1/7] block: Remove dead code
Date: Thu, 27 Oct 2011 08:37:12 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]