Skip to contentSkip to conversation

block: use correct filename

PATCH Applied Dunrong Huang 3 participants 3 messages Oct 2, 2013 – Oct 7, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 block.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
block.c +2 -2
index 93e113a..469d842 100644
@@ -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;
Signature · 1 line
1.7.12.4 (Apple Git-37)
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Dunrong Huang

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.

---
  block.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)