From: Markus Armbruster <armbru@redhat.com>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Cc: qemu-devel@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Eduardo Habkost" <ehabkost@redhat.com>
Subject: Re: [PATCH-for-5.2 v4] hw/core/qdev: Increase qdev_realize() kindness
Date: Wed, 29 Jul 2020 14:32:07 +0200 [thread overview]
Message-ID: <87d04e7b94.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <a73edd14-ab57-0072-36cb-91222a9a1638@amsat.org> ("Philippe Mathieu-Daudé"'s message of "Wed, 29 Jul 2020 14:02:22 +0200")
Philippe Mathieu-Daudé <f4bug@amsat.org> writes:
> On 7/29/20 9:39 AM, Markus Armbruster wrote:
>> Paolo Bonzini <pbonzini@redhat.com> writes:
>>
>>> On 28/07/20 09:44, Markus Armbruster wrote:
>>>>> - assert(!DEVICE_GET_CLASS(dev)->bus_type);
>>>>> + } else if (DEVICE_GET_CLASS(dev)->bus_type) {
>>>>> + error_setg(errp, "Unexpected bus '%s' for bus-less device '%s'",
>>>>> + DEVICE_GET_CLASS(dev)->bus_type,
>>>>> + object_get_typename(OBJECT(dev)));
>>>>> + return false;
>>>>> }
>>>>>
>>>>> object_property_set_bool(OBJECT(dev), true, "realized", &err);
>>>> Objection. This turns an abort into something else unless the caller
>>>> passes &error_abort. The caller in your commit message's example does,
>>>> others don't.
>>>>
>>>> Keep the unconditional abort, please. Feel free to print something kind
>>>> right before. I doubt it's all that useful, as I believe whoever gets
>>>> to fix the bug will have to figure out the code anyway, but I could be
>>>> wrong.
>>>>
>>>
>>> This was my request, actually. We have an Error**, we should use it in
>>> case this code is reached via device_add.
>>
>> That's not actually possible.
>
> I agree this condition is not possible in current mainstream.
>
> What I'm working on is:
>
> qmp command that:
> - create a SDCard or FloppyDisk medium
> - eventually link a block driver to it
> - insert the medium into a slot
>
> then another qmp command that
> - eject the medium
> - unlink the block driver
> - destroy the medium
>
> second step is a command that takes as argument
> (block driver, bus endpoint) and automatically
> creates the envelope media and insert it to the bus.
If this makes the error possible, then your code fails to establish
qdev_realize()'s precondition, and therefore needs fixing.
Could a combination of existing commands get the job done?
next prev parent reply other threads:[~2020-07-29 12:32 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 [this message]
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
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=87d04e7b94.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.