From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Markus Armbruster" <armbru@redhat.com>,
"Daniel P. Berrangé" <berrange@redhat.com>,
qemu-devel <qemu-devel@nongnu.org>,
"Eduardo Habkost" <ehabkost@redhat.com>
Subject: Re: [PATCH] hw/core/qdev: Increase qdev_realize() kindness
Date: Sun, 5 Jul 2020 13:59:45 +0200 [thread overview]
Message-ID: <70eaca09-a869-2c7b-a63f-a019f28baac9@amsat.org> (raw)
In-Reply-To: <CABgObfYbqHh6JZZ4z_KUovekUH2yac17oQr0WH6K9GkdEz6rkg@mail.gmail.com>
On 7/5/20 1:14 PM, Paolo Bonzini wrote:
> Are we sure that qdev_realize is never called with user-provided input?
I am not sure, but ...
> If it's a programming error, the call chain will end up passing
> &error_abort anyway, won't it?
... this is a good point :)
>
> Paolo
>
> Il dom 5 lug 2020, 12:05 Philippe Mathieu-Daudé <f4bug@amsat.org
> <mailto:f4bug@amsat.org>> ha scritto:
>
> On 7/5/20 7:46 AM, Paolo Bonzini wrote:
> > On 20/06/20 17:38, Philippe Mathieu-Daudé wrote:
> >> - } else {
> >> - assert(!DEVICE_GET_CLASS(dev)->bus_type);
> >> + } else if (DEVICE_GET_CLASS(dev)->bus_type) {
> >> + error_report("%s: Unexpected bus '%s' for device '%s'",
> >> + __func__, DEVICE_GET_CLASS(dev)->bus_type,
> >> + object_get_typename(OBJECT(dev)));
> >> + abort();
> >> }
> >>
> >
> > Since there is an errp, should we use it and be even kinder?
>
> This is a programming error, not an user triggerable condition,
> so I'm not sure. IOW this must not happen, but if it does, then
> the error message helps the developer to notice the problem without
> having to use gdb.
>
next prev parent reply other threads:[~2020-07-05 12:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-20 15:38 [PATCH] hw/core/qdev: Increase qdev_realize() kindness Philippe Mathieu-Daudé
2020-07-04 16:47 ` Philippe Mathieu-Daudé
2020-07-05 5:46 ` Paolo Bonzini
2020-07-05 10:05 ` Philippe Mathieu-Daudé
2020-07-05 11:14 ` Paolo Bonzini
2020-07-05 11:59 ` Philippe Mathieu-Daudé [this message]
2020-07-06 6:48 ` 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=70eaca09-a869-2c7b-a63f-a019f28baac9@amsat.org \
--to=f4bug@amsat.org \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=ehabkost@redhat.com \
--cc=pbonzini@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).