[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH for-2.6 3/3] qom: -object error messages lost lo
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH for-2.6 3/3] qom: -object error messages lost location, restore it |
Date: |
Wed, 27 Apr 2016 09:25:52 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 04/27/2016 08:29 AM, Markus Armbruster wrote:
> qemu_opts_foreach() runs its callback with the error location set to
> the option's location. Any errors the callback reports use the
> option's location automatically.
>
> Commit 90998d5 moved the actual error reporting from "inside"
> qemu_opts_foreach() to after it. Here's a typical hunk:
>
> if (qemu_opts_foreach(qemu_find_opts("object"),
> - object_create,
> - object_create_initial, NULL)) {
> + user_creatable_add_opts_foreach,
> + object_create_initial, &err)) {
> + error_report_err(err);
> exit(1);
> }
>
> Before, object_create() reports from within qemu_opts_foreach(), using
> the option's location. Afterwards, we do it after
> qemu_opts_foreach(), using whatever location happens to be current.
> Commonly a "none" location.
I agree with Dan that Error objects ought to track the Location in
effect at the point the Error is first registered, rather than
concatenating the two back together at the time the Error is eventually
reported; but also that such a change is too big to even consider this
late in 2.6. So as a band-aid, this particular patch improves the error
message quality back to its useful state.
Reviewed-by: Eric Blake <address@hidden>
> Note that the qemu_opts_foreach() bug just fixed could mask the bug
> here: if the location it leaves dandling hasn't been clobbered, yet,
s/dandling/dangling/
> it's the correct one.
>
> Reported-by: Eric Blake <address@hidden>
> Cc: Daniel P. Berrange <address@hidden>
> Signed-off-by: Markus Armbruster <address@hidden>
> ---
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature