* [Qemu-devel] [PATCH] block: use correct filename for error report
@ 2013-09-24 10:14 Dunrong Huang
2013-09-24 12:12 ` Max Reitz
2013-10-02 9:48 ` Stefan Hajnoczi
0 siblings, 2 replies; 5+ messages in thread
From: Dunrong Huang @ 2013-09-24 10:14 UTC (permalink / raw)
To: qemu-devel; +Cc: Kevin Wolf, Stefan Hajnoczi
The content filename point to will 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 ea4956d..9cd78a1 100644
--- a/block.c
+++ b/block.c
@@ -808,8 +808,8 @@ static int bdrv_open_common(BlockDriverState *bs, BlockDriverState *file,
if (ret < 0) {
if (error_is_set(&local_err)) {
error_propagate(errp, local_err);
- } else if (filename) {
- error_setg_errno(errp, -ret, "Could not open '%s'", filename);
+ } else if (bs->filename[0]) {
+ error_setg_errno(errp, -ret, "Could not open '%s'", bs->filename);
} else {
error_setg_errno(errp, -ret, "Could not open image");
}
--
1.8.3.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] block: use correct filename for error report
2013-09-24 10:14 [Qemu-devel] [PATCH] block: use correct filename for error report Dunrong Huang
@ 2013-09-24 12:12 ` Max Reitz
2013-09-30 9:20 ` Dunrong Huang
2013-10-02 9:48 ` Stefan Hajnoczi
1 sibling, 1 reply; 5+ messages in thread
From: Max Reitz @ 2013-09-24 12:12 UTC (permalink / raw)
To: Dunrong Huang; +Cc: Kevin Wolf, qemu-devel, Stefan Hajnoczi
On 2013-09-24 12:14, Dunrong Huang wrote:
> The content filename point to will 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] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] block: use correct filename for error report
2013-09-24 12:12 ` Max Reitz
@ 2013-09-30 9:20 ` Dunrong Huang
0 siblings, 0 replies; 5+ messages in thread
From: Dunrong Huang @ 2013-09-30 9:20 UTC (permalink / raw)
To: Max Reitz; +Cc: Kevin Wolf, qemu-devel, Stefan Hajnoczi, Stefan Hajnoczi
[-- Attachment #1: Type: text/plain, Size: 553 bytes --]
ping?
On Tue, Sep 24, 2013 at 8:12 PM, Max Reitz <mreitz@redhat.com> wrote:
> On 2013-09-24 12:14, Dunrong Huang wrote:
>
>> The content filename point to will 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>
>
--
Best Regards,
Dunrong Huang
Homepage: http://mathslinux.org
[-- Attachment #2: Type: text/html, Size: 1294 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] block: use correct filename for error report
2013-09-24 10:14 [Qemu-devel] [PATCH] block: use correct filename for error report Dunrong Huang
2013-09-24 12:12 ` Max Reitz
@ 2013-10-02 9:48 ` Stefan Hajnoczi
2013-10-02 13:39 ` Dunrong Huang
1 sibling, 1 reply; 5+ messages in thread
From: Stefan Hajnoczi @ 2013-10-02 9:48 UTC (permalink / raw)
To: Dunrong Huang; +Cc: Kevin Wolf, qemu-devel, Stefan Hajnoczi
On Tue, Sep 24, 2013 at 06:14:01PM +0800, Dunrong Huang wrote:
> The content filename point to will 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(-)
The same issue affects the rest of the function:
#ifndef _WIN32
if (bs->is_temporary) {
assert(filename != NULL);
unlink(filename);
}
#endif
Do you want to send a separate patch to fix this?
Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block
Stefan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] block: use correct filename for error report
2013-10-02 9:48 ` Stefan Hajnoczi
@ 2013-10-02 13:39 ` Dunrong Huang
0 siblings, 0 replies; 5+ messages in thread
From: Dunrong Huang @ 2013-10-02 13:39 UTC (permalink / raw)
To: Stefan Hajnoczi; +Cc: Kevin Wolf, qemu-devel, Stefan Hajnoczi
[-- Attachment #1: Type: text/plain, Size: 871 bytes --]
On Wed, Oct 2, 2013 at 5:48 PM, Stefan Hajnoczi <stefanha@gmail.com> wrote:
> On Tue, Sep 24, 2013 at 06:14:01PM +0800, Dunrong Huang wrote:
> > The content filename point to will 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(-)
>
> The same issue affects the rest of the function:
>
> #ifndef _WIN32
> if (bs->is_temporary) {
> assert(filename != NULL);
> unlink(filename);
> }
> #endif
>
> Do you want to send a separate patch to fix this?
>
Sure.
>
> Thanks, applied to my block tree:
> https://github.com/stefanha/qemu/commits/block
>
> Stefan
>
--
Best Regards,
Dunrong Huang
Homepage: http://mathslinux.org
[-- Attachment #2: Type: text/html, Size: 1769 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-10-02 13:39 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-24 10:14 [Qemu-devel] [PATCH] block: use correct filename for error report Dunrong Huang
2013-09-24 12:12 ` Max Reitz
2013-09-30 9:20 ` Dunrong Huang
2013-10-02 9:48 ` Stefan Hajnoczi
2013-10-02 13:39 ` Dunrong Huang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).