All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: Li Qiang <liq3ea@163.com>, pbonzini@redhat.com
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] vl.c: print error message if load fw_cfg file failed
Date: Sun, 7 Oct 2018 19:48:44 +0200	[thread overview]
Message-ID: <be443eb3-742d-08c6-492c-058331ec14b0@amsat.org> (raw)
In-Reply-To: <20181007043335.23631-1-liq3ea@163.com>

On 10/7/18 6:33 AM, Li Qiang wrote:
> It makes sense to print the error message while reading
> file failed.
> 
> Signed-off-by: Li Qiang <liq3ea@163.com>
> ---
>  vl.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/vl.c b/vl.c
> index cc55fe04a2..3db410e771 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -2207,8 +2207,9 @@ 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);

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

>              return -1;
>          }
>      }
>

  reply	other threads:[~2018-10-07 17:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-07  4:33 [Qemu-devel] [PATCH] vl.c: print error message if load fw_cfg file failed Li Qiang
2018-10-07 17:48 ` Philippe Mathieu-Daudé [this message]
2018-10-08 16:36   ` Philippe Mathieu-Daudé

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=be443eb3-742d-08c6-492c-058331ec14b0@amsat.org \
    --to=f4bug@amsat.org \
    --cc=liq3ea@163.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 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.