From: Markus Armbruster <armbru@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org,
"Richard Henderson" <richard.henderson@linaro.org>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
"Eduardo Habkost" <ehabkost@redhat.com>
Subject: Re: [PATCH-for-5.2 v4] hw/core/qdev: Increase qdev_realize() kindness
Date: Thu, 30 Jul 2020 10:27:47 +0200 [thread overview]
Message-ID: <87sgd92yrg.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <c086f053-b4db-532d-2c8e-b29ec5e3e708@redhat.com> (Paolo Bonzini's message of "Thu, 30 Jul 2020 00:25:10 +0200")
Paolo Bonzini <pbonzini@redhat.com> writes:
> On 29/07/20 09:39, Markus Armbruster wrote:
>> Taking a step back, I disagree with the notion that assertions should be
>> avoided just because we have an Error **. A programming error doesn't
>> become less wrong, and continuing when the program is in disorder
>> doesn't become any safer when you add an Error ** parameter to a
>> function.
>
> I don't think it is actually unsafe to continue after passing a bus-less
> device with a bus_type to qdev_realize. It will fail, but orderly.
>
> So even though it's a programming error, it should not be a big deal to
> avoid the assertion here: either the caller will pass &error_abort, or
> it will print a nice error message and let the user go on with their
> business.
An error message the user can do nothing about other than report as a
bug is never nice.
We can try to phrase the message in a way that makes "this is a bug,
please report" clear, but doing that case-by-case can only result in
inconsistency and confusion. Having a common way to do it gets us to:
>> If you're calling for recovering from programming errors where that can
>> be done safely, we can talk about creating the necessary infrastructure.
>> Handling them as if they were errors the user can do something about can
>> only lead to confusion.
Moreover, we want programming errors reported even when we recover, so
they get fixed. If we treat them like any other error, that is not
assured: errors may be handled silently.
> I'm not particularly attached to the change, but it seemed inconsistent
> to use error_setg(&error_abort).
From error.h:
* Please don't error_setg(&error_fatal, ...), use error_report() and
* exit(), because that's more obvious.
* Likewise, don't error_setg(&error_abort, ...), use assert().
prev parent reply other threads:[~2020-07-30 8:28 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-27 17:51 [PATCH-for-5.2 v4] hw/core/qdev: Increase qdev_realize() kindness Philippe Mathieu-Daudé
2020-07-28 7:44 ` Markus Armbruster
2020-07-28 8:21 ` Paolo Bonzini
2020-07-29 7:39 ` Markus Armbruster
2020-07-29 12:02 ` Philippe Mathieu-Daudé
2020-07-29 12:32 ` Markus Armbruster
2020-07-29 12:49 ` Philippe Mathieu-Daudé
2020-07-29 14:13 ` Markus Armbruster
2020-07-29 22:25 ` Paolo Bonzini
2020-07-30 8:27 ` Markus Armbruster [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=87sgd92yrg.fsf@dusky.pond.sub.org \
--to=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=ehabkost@redhat.com \
--cc=f4bug@amsat.org \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.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.