block: use correct filename

The content filename point to may be erased by qemu_opts_absorb_qdict()
in raw_open_common() in drv->bdrv_file_open()

So it's better to use bs->filename.

Signed-off-by: Dunrong Huang <riegamaths@gmail.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
Dunrong Huang 2013-10-03 01:31:27 +08:00 committed by Stefan Hajnoczi
parent 5c1fa87708
commit d4cea8dfb9

View File

@ -824,8 +824,8 @@ static int bdrv_open_common(BlockDriverState *bs, BlockDriverState *file,
#ifndef _WIN32
if (bs->is_temporary) {
assert(filename != NULL);
unlink(filename);
assert(bs->filename[0] != '\0');
unlink(bs->filename);
}
#endif
return 0;