[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2] vl.c: print error message if load fw_cfg fil
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH v2] vl.c: print error message if load fw_cfg file failed |
Date: |
Tue, 09 Oct 2018 15:04:26 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) |
Li Qiang <address@hidden> writes:
> Hello Philippe,
>
> Philippe Mathieu-Daudé <address@hidden> 于2018年10月9日周二 下午1:52写道:
>
>> Hi Li,
>>
>> On 09/10/2018 04:39, Li Qiang wrote:
>> > It makes sense to print the error message while reading
>> > file failed.
[...]
>> > 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].
>>
>
> OK, I will send out this patch based Markus' tree or later when his patch
> goes to upstream.
Appreciated!