diff options
author | Dunrong Huang <riegamaths@gmail.com> | 2013-10-03 01:31:27 +0800 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2013-10-07 13:23:19 +0200 |
commit | d4cea8dfb99153803164915c7a1109549ad3da9c (patch) | |
tree | 36f1e04b40596f3ef157a329800c9d95dcc61334 | |
parent | 5c1fa87708d5f226bfd96e8eef8c905fb6895ae3 (diff) |
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>
-rw-r--r-- | block.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; |