qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Li Qiang <liq3ea@gmail.com>, pbonzini@redhat.com, f4bug@amsat.org
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2] vl.c: print error message if load fw_cfg file failed
Date: Tue, 9 Oct 2018 07:52:20 +0200	[thread overview]
Message-ID: <7a26945a-d94f-98db-7ae2-0d4c089ab975@redhat.com> (raw)
In-Reply-To: <1539052760-11730-1-git-send-email-liq3ea@gmail.com>

Hi Li,

On 09/10/2018 04:39, Li Qiang wrote:
> It makes sense to print the error message while reading
> file failed.

OK

> 
> Change since v1:
> free error

Changes are useful for reviewer, but not in the git history.
You can have them automatically stripped if you place them below the
next '---' separator.

Hopefully the maintainer taking this patch can clean this up.

> 
> Signed-off-by: Li Qiang <liq3ea@gmail.com>
> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---

Here goes comment not worth to stay forever in git history:

  Since v1: ...

>  vl.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/vl.c b/vl.c
> index 4e25c78..69fc77c 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -2207,8 +2207,10 @@ static int parse_fw_cfg(void *opaque, QemuOpts *opts, Error **errp)
>          size = strlen(str); /* NUL terminator NOT included in fw_cfg blob */
>          buf = g_memdup(str, size);
>      } else {
> -        if (!g_file_get_contents(file, &buf, &size, NULL)) {
> -            error_report("can't load %s", file);
> +        GError *error = NULL;
> +        if (!g_file_get_contents(file, &buf, &size, &error)) {
> +            error_report("can't load %s, %s", file, error->message);

If you ever respin, you can help Markus [1] effort using:

            error_setg(errp, "can't load %s, %s", file, error->message);

Else your patch will clash with [2].

> +            g_error_free(error);
>              return -1;
>          }
>      }
> 

Regards,

Phil.

[1] https://lists.gnu.org/archive/html/qemu-devel/2018-10/msg01394.html
[2] https://lists.gnu.org/archive/html/qemu-devel/2018-10/msg01406.html

  reply	other threads:[~2018-10-09  5:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-09  2:39 [Qemu-devel] [PATCH v2] vl.c: print error message if load fw_cfg file failed Li Qiang
2018-10-09  5:52 ` Philippe Mathieu-Daudé [this message]
2018-10-09  5:58   ` Li Qiang
2018-10-09 13:04     ` Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7a26945a-d94f-98db-7ae2-0d4c089ab975@redhat.com \
    --to=philmd@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=liq3ea@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).