From: Paolo Bonzini <pbonzini@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: "Daniel P. Berrangé" <berrange@redhat.com>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
"Eduardo Habkost" <ehabkost@redhat.com>,
qemu-devel@nongnu.org
Subject: Re: [PATCH-for-5.2 v4] hw/core/qdev: Increase qdev_realize() kindness
Date: Thu, 30 Jul 2020 00:25:10 +0200 [thread overview]
Message-ID: <c086f053-b4db-532d-2c8e-b29ec5e3e708@redhat.com> (raw)
In-Reply-To: <87r1suahxu.fsf@dusky.pond.sub.org>
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.
I'm not particularly attached to the change, but it seemed inconsistent
to use error_setg(&error_abort).
Paolo
next prev parent reply other threads:[~2020-07-29 22:26 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 [this message]
2020-07-30 8:27 ` Markus Armbruster
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=c086f053-b4db-532d-2c8e-b29ec5e3e708@redhat.com \
--to=pbonzini@redhat.com \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=ehabkost@redhat.com \
--cc=f4bug@amsat.org \
--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 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).