From: Paolo Bonzini <pbonzini@redhat.com>
To: Thomas Huth <thuth@redhat.com>,
qemu-devel@nongnu.org, Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-arm@nongnu.org, Markus Armbruster <armbru@redhat.com>,
Eduardo Habkost <ehabkost@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] hw/arm/bcm283x: Fix crash with device_add bcm2837 on unsupported machines
Date: Wed, 11 Jul 2018 22:15:43 +0200 [thread overview]
Message-ID: <016ebe6a-91e3-24f3-9e2a-26613bd9f61e@redhat.com> (raw)
In-Reply-To: <163e1c54-c953-e5fe-3142-eab18e0362b8@redhat.com>
On 11/07/2018 20:43, Thomas Huth wrote:
>>
>> - realize fails
> In this case, the failure is before realize is attempted,
> qdev_device_add() already stop with "Device '%s' can not be hotplugged
> on this machine".
Still, object_unparent is called by qdev_device_add in the error path,
and it should work the same way (in a nutshell, recursive unparent when
child properties are deleted, and finalization of the contained objects
as the last reference is dropped).
>> - object_unparent is called on the device that failed to realize (see
>> qdev_device_add). object_unparent calls device_unparent
> Hmm, are you sure? I can see that object_unparent calls device_unparent
> indirectly for the *child* nodes of the device, but not for the device
> itself...
object_unparent -> object_property_del_child ->
object_finalize_child_property -> device_unparent
I think you're on the right track, after object_property_add_child you
need to drop the reference to the object. For example qmp_device_add
does it after qdev_device_add returns a device successfully (just an
example---I understand it is not the case with bcm283x). In that case
the call to object_property_add_child is in qdev_set_id.
Paolo
next prev parent reply other threads:[~2018-07-11 20:15 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-09 21:03 [Qemu-devel] [PATCH] hw/arm/bcm283x: Fix crash with device_add bcm2837 on unsupported machines Thomas Huth
2018-07-09 21:31 ` Eduardo Habkost
2018-07-09 21:36 ` Thomas Huth
2018-07-09 21:42 ` Peter Maydell
2018-07-09 22:03 ` Thomas Huth
2018-07-10 6:50 ` Peter Maydell
2018-07-11 7:21 ` Thomas Huth
2018-07-11 16:12 ` Eduardo Habkost
2018-07-11 17:15 ` Peter Maydell
2018-07-12 12:06 ` Markus Armbruster
2018-07-12 12:55 ` Peter Maydell
2018-07-12 13:19 ` Markus Armbruster
2018-07-12 15:25 ` Thomas Huth
2018-07-12 16:16 ` Markus Armbruster
2018-07-12 16:22 ` Peter Maydell
2018-07-12 16:32 ` Thomas Huth
2018-07-16 6:41 ` Markus Armbruster
2018-07-11 17:21 ` Paolo Bonzini
2018-07-11 19:04 ` Thomas Huth
2018-07-11 19:59 ` Eduardo Habkost
2018-07-12 8:04 ` Paolo Bonzini
2018-07-12 12:04 ` Markus Armbruster
2018-07-11 17:20 ` Paolo Bonzini
2018-07-11 18:30 ` Eduardo Habkost
2018-07-11 20:16 ` Paolo Bonzini
2018-07-11 20:23 ` Eduardo Habkost
2018-07-12 8:05 ` Paolo Bonzini
2018-07-12 18:04 ` Eduardo Habkost
2018-07-16 6:43 ` Markus Armbruster
2018-07-16 14:25 ` Eduardo Habkost
2018-07-11 18:43 ` Thomas Huth
2018-07-11 20:15 ` Paolo Bonzini [this message]
2018-07-12 5:57 ` Thomas Huth
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=016ebe6a-91e3-24f3-9e2a-26613bd9f61e@redhat.com \
--to=pbonzini@redhat.com \
--cc=armbru@redhat.com \
--cc=ehabkost@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
/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).