summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDunrong Huang <riegamaths@gmail.com>2013-10-03 01:31:27 +0800
committerStefan Hajnoczi <stefanha@redhat.com>2013-10-07 13:23:19 +0200
commitd4cea8dfb99153803164915c7a1109549ad3da9c (patch)
tree36f1e04b40596f3ef157a329800c9d95dcc61334
parent5c1fa87708d5f226bfd96e8eef8c905fb6895ae3 (diff)
downloadqemu-d4cea8dfb99153803164915c7a1109549ad3da9c.tar.gz
qemu-d4cea8dfb99153803164915c7a1109549ad3da9c.tar.bz2
qemu-d4cea8dfb99153803164915c7a1109549ad3da9c.zip
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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/block.c b/block.c
index e2d9936227..d7ca37e6ad 100644
--- a/block.c
+++ b/block.c
@@ -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;