qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Luiz Capitulino <lcapitulino@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 3/4] QError: Don't abort on multiple faults
Date: Fri, 05 Feb 2010 15:21:13 +0100	[thread overview]
Message-ID: <m3y6j7n4py.fsf@blackfin.pond.sub.org> (raw)
In-Reply-To: <m3ljf8rqkv.fsf@blackfin.pond.sub.org> (Markus Armbruster's message of "Fri, 05 Feb 2010 10:15:28 +0100")

Markus Armbruster <armbru@redhat.com> writes:

> Luiz Capitulino <lcapitulino@redhat.com> writes:
>
>> Ideally, Monitor code should report an error only once and
>> return the error information up the call chain.
>>
>> To assure that this happens as expected and that no error is
>> lost, we have an assert() in qemu_error_internal().
>>
>> However, we still have not fully converted handlers using
>> monitor_printf() to report errors. As there can be multiple
>> monitor_printf() calls on an error, the assertion is easily
>> triggered when debugging is enabled; and we will get a memory
>> leak if it's not.
>>
>> The solution to this problem is to allow multiple faults by only
>> reporting the first one, and to release the additional error objects.
>
> I want this badly.
>
> [...]

Let me elaborate a bit.  While this patch is a much wanted improvement,
what I *really* want is something else.

Right now, we have 41 uses of qemu_error_new().  We still have >300 uses
of monitor_printf(), many of them errors.  Plus some 100 uses of
qemu_error(), which boils down to monitor_printf() when running within a
monitor.  Not to mention >1000 uses of stderr.

To convert a monitor handler to QError, we have to make it report
exactly one error on every unsuccessful path, with qemu_error_new().
That's not too hard.  Then we have to ensure it does not call
monitor_printf() directly (not hard either) or indirectly (ouch).  I say
"ouch", because those prints can hide behind long call chains, in code
shared with other users.  Cleaning up all those stray prints will take
time.

Without this patch, a stray print is fatal, unless it happens to be the
only one *and* there is no real error.

With this patch, we survive, but the UndefinedError triggered by the
stray print displaces any later real error.

What I really want is that stray prints do not mess with my real errors.

  reply	other threads:[~2010-02-05 14:23 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-04 20:13 [Qemu-devel] [PATCH v0 0/4]: QMP related fixes Luiz Capitulino
2010-02-04 20:13 ` [Qemu-devel] [PATCH 1/4] qjson: Improve debugging Luiz Capitulino
2010-02-04 22:31   ` Anthony Liguori
2010-02-05  9:13     ` Markus Armbruster
2010-02-05 12:13       ` Luiz Capitulino
2010-02-05 12:12     ` Luiz Capitulino
2010-02-05 15:54       ` Anthony Liguori
2010-02-05 17:14         ` Markus Armbruster
2010-02-08 11:22           ` Luiz Capitulino
2010-02-08 14:53           ` Anthony Liguori
2010-02-08 15:05             ` Luiz Capitulino
2010-02-04 20:13 ` [Qemu-devel] [PATCH 2/4] Monitor: remove unneeded checks Luiz Capitulino
2010-02-04 20:13 ` [Qemu-devel] [PATCH 3/4] QError: Don't abort on multiple faults Luiz Capitulino
2010-02-05  9:15   ` Markus Armbruster
2010-02-05 14:21     ` Markus Armbruster [this message]
2010-02-05 14:44       ` Luiz Capitulino
2010-02-05 15:15         ` Markus Armbruster
2010-02-05 17:07           ` Luiz Capitulino
2010-02-04 20:13 ` [Qemu-devel] [PATCH 4/4] QMP: Don't leak on connection close Luiz Capitulino
  -- strict thread matches above, loose matches on Subject: below --
2010-02-08 19:01 [Qemu-devel] [PATCH v1 0/4]: QMP related fixes Luiz Capitulino
2010-02-08 19:01 ` [Qemu-devel] [PATCH 3/4] QError: Don't abort on multiple faults Luiz Capitulino

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=m3y6j7n4py.fsf@blackfin.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=lcapitulino@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).