* [Qemu-devel] [PATCH] fw_cfg: print error message when reading splashfile failed
@ 2018-10-24 5:12 Li Qiang
2018-10-24 11:30 ` Laszlo Ersek
2018-10-24 23:00 ` Philippe Mathieu-Daudé
0 siblings, 2 replies; 5+ messages in thread
From: Li Qiang @ 2018-10-24 5:12 UTC (permalink / raw)
To: lersek, peter.maydell, pbonzini; +Cc: qemu-devel, Li Qiang
Also remove unnecessary 'res' variable.
Signed-off-by: Li Qiang <liq3ea@gmail.com>
---
hw/nvram/fw_cfg.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
index 946f765..f4a52d8 100644
--- a/hw/nvram/fw_cfg.c
+++ b/hw/nvram/fw_cfg.c
@@ -68,15 +68,14 @@ static char *read_splashfile(char *filename, gsize *file_sizep,
int *file_typep)
{
GError *err = NULL;
- gboolean res;
gchar *content;
int file_type;
unsigned int filehead;
int bmp_bpp;
- res = g_file_get_contents(filename, &content, file_sizep, &err);
- if (res == FALSE) {
- error_report("failed to read splash file '%s'", filename);
+ if (!g_file_get_contents(filename, &content, file_sizep, &err)) {
+ error_report("failed to read splash file '%s', %s",
+ filename, err->message);
g_error_free(err);
return NULL;
}
--
1.8.3.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] fw_cfg: print error message when reading splashfile failed
2018-10-24 5:12 [Qemu-devel] [PATCH] fw_cfg: print error message when reading splashfile failed Li Qiang
@ 2018-10-24 11:30 ` Laszlo Ersek
2018-10-24 23:00 ` Philippe Mathieu-Daudé
1 sibling, 0 replies; 5+ messages in thread
From: Laszlo Ersek @ 2018-10-24 11:30 UTC (permalink / raw)
To: Li Qiang, peter.maydell, pbonzini; +Cc: qemu-devel
On 10/24/18 07:12, Li Qiang wrote:
> Also remove unnecessary 'res' variable.
>
> Signed-off-by: Li Qiang <liq3ea@gmail.com>
> ---
> hw/nvram/fw_cfg.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
> index 946f765..f4a52d8 100644
> --- a/hw/nvram/fw_cfg.c
> +++ b/hw/nvram/fw_cfg.c
> @@ -68,15 +68,14 @@ static char *read_splashfile(char *filename, gsize *file_sizep,
> int *file_typep)
> {
> GError *err = NULL;
> - gboolean res;
> gchar *content;
> int file_type;
> unsigned int filehead;
> int bmp_bpp;
>
> - res = g_file_get_contents(filename, &content, file_sizep, &err);
> - if (res == FALSE) {
> - error_report("failed to read splash file '%s'", filename);
> + if (!g_file_get_contents(filename, &content, file_sizep, &err)) {
> + error_report("failed to read splash file '%s', %s",
> + filename, err->message);
> g_error_free(err);
> return NULL;
> }
>
Seems to be OK, according to
<https://developer.gnome.org/glib/stable/glib-Error-Reporting.html#glib-Error-Reporting.description>.
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] fw_cfg: print error message when reading splashfile failed
2018-10-24 5:12 [Qemu-devel] [PATCH] fw_cfg: print error message when reading splashfile failed Li Qiang
2018-10-24 11:30 ` Laszlo Ersek
@ 2018-10-24 23:00 ` Philippe Mathieu-Daudé
2018-10-31 15:36 ` Markus Armbruster
1 sibling, 1 reply; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-10-24 23:00 UTC (permalink / raw)
To: Li Qiang, lersek, peter.maydell, pbonzini; +Cc: qemu-devel
On 24/10/18 7:12, Li Qiang wrote:
> Also remove unnecessary 'res' variable.
>
> Signed-off-by: Li Qiang <liq3ea@gmail.com>
> ---
> hw/nvram/fw_cfg.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
> index 946f765..f4a52d8 100644
> --- a/hw/nvram/fw_cfg.c
> +++ b/hw/nvram/fw_cfg.c
> @@ -68,15 +68,14 @@ static char *read_splashfile(char *filename, gsize *file_sizep,
> int *file_typep)
> {
> GError *err = NULL;
> - gboolean res;
> gchar *content;
> int file_type;
> unsigned int filehead;
> int bmp_bpp;
>
> - res = g_file_get_contents(filename, &content, file_sizep, &err);
> - if (res == FALSE) {
> - error_report("failed to read splash file '%s'", filename);
> + if (!g_file_get_contents(filename, &content, file_sizep, &err)) {
> + error_report("failed to read splash file '%s', %s",
Can you use a column like the rest of the codebase?
i.e.: "failed to read splash file '%s': %s"
The maintainer taking this patch can do this minor change, so:
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> + filename, err->message);
> g_error_free(err);
> return NULL;
> }
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] fw_cfg: print error message when reading splashfile failed
2018-10-24 23:00 ` Philippe Mathieu-Daudé
@ 2018-10-31 15:36 ` Markus Armbruster
2018-11-01 6:15 ` Li Qiang
0 siblings, 1 reply; 5+ messages in thread
From: Markus Armbruster @ 2018-10-31 15:36 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: Li Qiang, lersek, peter.maydell, pbonzini, qemu-devel
Philippe Mathieu-Daudé <philmd@redhat.com> writes:
> On 24/10/18 7:12, Li Qiang wrote:
>> Also remove unnecessary 'res' variable.
>>
>> Signed-off-by: Li Qiang <liq3ea@gmail.com>
>> ---
>> hw/nvram/fw_cfg.c | 7 +++----
>> 1 file changed, 3 insertions(+), 4 deletions(-)
>>
>> diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
>> index 946f765..f4a52d8 100644
>> --- a/hw/nvram/fw_cfg.c
>> +++ b/hw/nvram/fw_cfg.c
>> @@ -68,15 +68,14 @@ static char *read_splashfile(char *filename, gsize *file_sizep,
>> int *file_typep)
>> {
>> GError *err = NULL;
>> - gboolean res;
>> gchar *content;
>> int file_type;
>> unsigned int filehead;
>> int bmp_bpp;
>> - res = g_file_get_contents(filename, &content, file_sizep,
>> &err);
>> - if (res == FALSE) {
>> - error_report("failed to read splash file '%s'", filename);
>> + if (!g_file_get_contents(filename, &content, file_sizep, &err)) {
>> + error_report("failed to read splash file '%s', %s",
>
> Can you use a column like the rest of the codebase?
>
> i.e.: "failed to read splash file '%s': %s"
Yes, please.
Also, my remark on your "[PATCH] vl.c: print error message if loading
fw_cfg file failed" applies to this patch as well. Please improve the
commit message.
> The maintainer taking this patch can do this minor change, so:
> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>
>> + filename, err->message);
>> g_error_free(err);
>> return NULL;
>> }
>>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] fw_cfg: print error message when reading splashfile failed
2018-10-31 15:36 ` Markus Armbruster
@ 2018-11-01 6:15 ` Li Qiang
0 siblings, 0 replies; 5+ messages in thread
From: Li Qiang @ 2018-11-01 6:15 UTC (permalink / raw)
To: Markus Armbruster
Cc: philmd, Laszlo Ersek, Peter Maydell, Paolo Bonzini, Qemu Developers
Hello all,
I have sent out another patch.
As the email's subject and commit message changed,
I'm not sure is it suitable to add Philippe and Laszlo's R-b tag.
Thanks,
Li Qiang
Markus Armbruster <armbru@redhat.com> 于2018年10月31日周三 下午11:36写道:
> Philippe Mathieu-Daudé <philmd@redhat.com> writes:
>
> > On 24/10/18 7:12, Li Qiang wrote:
> >> Also remove unnecessary 'res' variable.
> >>
> >> Signed-off-by: Li Qiang <liq3ea@gmail.com>
> >> ---
> >> hw/nvram/fw_cfg.c | 7 +++----
> >> 1 file changed, 3 insertions(+), 4 deletions(-)
> >>
> >> diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
> >> index 946f765..f4a52d8 100644
> >> --- a/hw/nvram/fw_cfg.c
> >> +++ b/hw/nvram/fw_cfg.c
> >> @@ -68,15 +68,14 @@ static char *read_splashfile(char *filename, gsize
> *file_sizep,
> >> int *file_typep)
> >> {
> >> GError *err = NULL;
> >> - gboolean res;
> >> gchar *content;
> >> int file_type;
> >> unsigned int filehead;
> >> int bmp_bpp;
> >> - res = g_file_get_contents(filename, &content, file_sizep,
> >> &err);
> >> - if (res == FALSE) {
> >> - error_report("failed to read splash file '%s'", filename);
> >> + if (!g_file_get_contents(filename, &content, file_sizep, &err)) {
> >> + error_report("failed to read splash file '%s', %s",
> >
> > Can you use a column like the rest of the codebase?
> >
> > i.e.: "failed to read splash file '%s': %s"
>
> Yes, please.
>
> Also, my remark on your "[PATCH] vl.c: print error message if loading
> fw_cfg file failed" applies to this patch as well. Please improve the
> commit message.
>
> > The maintainer taking this patch can do this minor change, so:
> > Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> >
> >> + filename, err->message);
> >> g_error_free(err);
> >> return NULL;
> >> }
> >>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-11-01 6:16 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-24 5:12 [Qemu-devel] [PATCH] fw_cfg: print error message when reading splashfile failed Li Qiang
2018-10-24 11:30 ` Laszlo Ersek
2018-10-24 23:00 ` Philippe Mathieu-Daudé
2018-10-31 15:36 ` Markus Armbruster
2018-11-01 6:15 ` Li Qiang
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.