From: Eric Blake <eblake@redhat.com>
To: Markus Armbruster <armbru@redhat.com>, qemu-devel@nongnu.org
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 [thread overview]
Message-ID: <5720DA00.2000005@redhat.com> (raw)
In-Reply-To: <1461767349-15329-4-git-send-email-armbru@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1873 bytes --]
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 <eblake@redhat.com>
> 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 <eblake@redhat.com>
> Cc: Daniel P. Berrange <berrange@redhat.com>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
prev parent reply other threads:[~2016-04-27 15:25 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-27 14:29 [Qemu-devel] [PATCH for-2.6 0/3] Fix dangling pointers and error message regressions Markus Armbruster
2016-04-27 14:29 ` [Qemu-devel] [PATCH for-2.6 1/3] QemuOpts: Fix qemu_opts_foreach() dangling location regression Markus Armbruster
2016-04-27 14:42 ` Eric Blake
2016-04-27 14:29 ` [Qemu-devel] [PATCH for-2.6 2/3] replay: Fix dangling location bug in replay_configure() Markus Armbruster
2016-04-27 14:57 ` Eric Blake
2016-04-27 16:39 ` Eduardo Habkost
2016-04-27 14:29 ` [Qemu-devel] [PATCH for-2.6 3/3] qom: -object error messages lost location, restore it Markus Armbruster
2016-04-27 14:49 ` Daniel P. Berrange
2016-04-27 15:36 ` Markus Armbruster
2016-04-27 15:25 ` Eric Blake [this message]
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=5720DA00.2000005@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@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).