[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/7] block: Remove dead code
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH 1/7] block: Remove dead code |
Date: |
Thu, 27 Oct 2011 10:23:48 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:7.0) Gecko/20110927 Thunderbird/7.0 |
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
- [Qemu-devel] [PATCH 0/7] block: Collection of unrelated simple fixes, Kevin Wolf, 2011/10/26
- [Qemu-devel] [PATCH 1/7] block: Remove dead code, Kevin Wolf, 2011/10/26
- [Qemu-devel] [PATCH 2/7] block: Fix bdrv_open use after free, Kevin Wolf, 2011/10/26
- [Qemu-devel] [PATCH 4/7] ide: Fix off-by-one error in array index check, Kevin Wolf, 2011/10/26
- [Qemu-devel] [PATCH 5/7] vmdk: Fix use of uninitialised value, Kevin Wolf, 2011/10/26
- [Qemu-devel] [PATCH 6/7] vmdk: Improve error handling, Kevin Wolf, 2011/10/26
- [Qemu-devel] [PATCH 7/7] vmdk: Fix possible segfaults, Kevin Wolf, 2011/10/26
- [Qemu-devel] [PATCH 3/7] qcow: Fix bdrv_write_compressed error handling, Kevin Wolf, 2011/10/26