* [Qemu-devel] [PATCH] block: use correct filename
@ 2013-10-02 17:31 Dunrong Huang
2013-10-04 7:35 ` Max Reitz
2013-10-07 8:51 ` Stefan Hajnoczi
0 siblings, 2 replies; 3+ messages in thread
From: Dunrong Huang @ 2013-10-02 17:31 UTC (permalink / raw)
To: qemu-devel; +Cc: Kevin Wolf, Stefan Hajnoczi
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>
---
block.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/block.c b/block.c
index 93e113a..469d842 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;
--
1.7.12.4 (Apple Git-37)
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] block: use correct filename
2013-10-02 17:31 [Qemu-devel] [PATCH] block: use correct filename Dunrong Huang
@ 2013-10-04 7:35 ` Max Reitz
2013-10-07 8:51 ` Stefan Hajnoczi
1 sibling, 0 replies; 3+ messages in thread
From: Max Reitz @ 2013-10-04 7:35 UTC (permalink / raw)
To: Dunrong Huang; +Cc: Kevin Wolf, qemu-devel, Stefan Hajnoczi
On 2013-10-02 19:31, Dunrong Huang wrote:
> 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>
> ---
> block.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Max Reitz <mreitz@redhat.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] block: use correct filename
2013-10-02 17:31 [Qemu-devel] [PATCH] block: use correct filename Dunrong Huang
2013-10-04 7:35 ` Max Reitz
@ 2013-10-07 8:51 ` Stefan Hajnoczi
1 sibling, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2013-10-07 8:51 UTC (permalink / raw)
To: Dunrong Huang; +Cc: Kevin Wolf, qemu-devel, Stefan Hajnoczi
On Thu, Oct 03, 2013 at 01:31:27AM +0800, Dunrong Huang wrote:
> 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>
> ---
> block.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block
Stefan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-10-07 8:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-02 17:31 [Qemu-devel] [PATCH] block: use correct filename Dunrong Huang
2013-10-04 7:35 ` Max Reitz
2013-10-07 8:51 ` Stefan Hajnoczi
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.