From: Eduardo Habkost <ehabkost@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Thomas Huth <thuth@redhat.com>,
qemu-arm@nongnu.org, qemu-devel@nongnu.org,
Peter Maydell <peter.maydell@linaro.org>
Subject: Re: [Qemu-arm] [Qemu-devel] [PATCH] hw/arm/bcm283x: Fix crash with device_add bcm2837 on unsupported machines
Date: Mon, 16 Jul 2018 11:25:32 -0300 [thread overview]
Message-ID: <20180716142532.GH31657@localhost.localdomain> (raw)
In-Reply-To: <87efg3istv.fsf@dusky.pond.sub.org>
On Mon, Jul 16, 2018 at 08:43:24AM +0200, Markus Armbruster wrote:
> Eduardo Habkost <ehabkost@redhat.com> writes:
>
> > On Thu, Jul 12, 2018 at 10:05:46AM +0200, Paolo Bonzini wrote:
> >> On 11/07/2018 22:23, Eduardo Habkost wrote:
> >> > On Wed, Jul 11, 2018 at 10:16:42PM +0200, Paolo Bonzini wrote:
> >> >> On 11/07/2018 20:30, Eduardo Habkost wrote:
> >> >>>> The theoretical behavior should be:
> >> >>> It's not clear below where you expect
> >> >>> qdev_set_parent_bus(..., sysbus_get_default())
> >> >>> to be called (if it should be called at all).
> >> >>>
> >> >>> I don't know where it should be called, but I'm absolutely sure
> >> >>> instance_init is not the right place.
> >> >>
> >> >> I think instance_init is fine to call qdev_set_parent_bus on contained
> >> >> devices. Why do you say it's not?
> >> >
> >> > Because object_unref(object_new(...)) is not supposed to affect
> >> > QEMU global state at all.
> >>
> >> It should not affect it. Any changes to the global state done by
> >> instance_init are immediately undone when object_unref destroys the
> >> child properties of the object.
> >
> > I would prefer if it didn't, but not a big deal as long as all
> > QOM code is protected by the BQL (it is, right?).
> >
> > If we get rid of object_new() in qmp_device_list_properties(),
> > then most of the restrictions on instance_init can go away,
> > anyway.
>
> How could we get rid of object_new()? As long as we create properties
> in code, we need to run the code to find the properties.
By stopping registering properties at instance_init, and making
them introspectable at the class object.
--
Eduardo
WARNING: multiple messages have this Message-ID (diff)
From: Eduardo Habkost <ehabkost@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Peter Maydell <peter.maydell@linaro.org>,
Thomas Huth <thuth@redhat.com>,
qemu-arm@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] hw/arm/bcm283x: Fix crash with device_add bcm2837 on unsupported machines
Date: Mon, 16 Jul 2018 11:25:32 -0300 [thread overview]
Message-ID: <20180716142532.GH31657@localhost.localdomain> (raw)
In-Reply-To: <87efg3istv.fsf@dusky.pond.sub.org>
On Mon, Jul 16, 2018 at 08:43:24AM +0200, Markus Armbruster wrote:
> Eduardo Habkost <ehabkost@redhat.com> writes:
>
> > On Thu, Jul 12, 2018 at 10:05:46AM +0200, Paolo Bonzini wrote:
> >> On 11/07/2018 22:23, Eduardo Habkost wrote:
> >> > On Wed, Jul 11, 2018 at 10:16:42PM +0200, Paolo Bonzini wrote:
> >> >> On 11/07/2018 20:30, Eduardo Habkost wrote:
> >> >>>> The theoretical behavior should be:
> >> >>> It's not clear below where you expect
> >> >>> qdev_set_parent_bus(..., sysbus_get_default())
> >> >>> to be called (if it should be called at all).
> >> >>>
> >> >>> I don't know where it should be called, but I'm absolutely sure
> >> >>> instance_init is not the right place.
> >> >>
> >> >> I think instance_init is fine to call qdev_set_parent_bus on contained
> >> >> devices. Why do you say it's not?
> >> >
> >> > Because object_unref(object_new(...)) is not supposed to affect
> >> > QEMU global state at all.
> >>
> >> It should not affect it. Any changes to the global state done by
> >> instance_init are immediately undone when object_unref destroys the
> >> child properties of the object.
> >
> > I would prefer if it didn't, but not a big deal as long as all
> > QOM code is protected by the BQL (it is, right?).
> >
> > If we get rid of object_new() in qmp_device_list_properties(),
> > then most of the restrictions on instance_init can go away,
> > anyway.
>
> How could we get rid of object_new()? As long as we create properties
> in code, we need to run the code to find the properties.
By stopping registering properties at instance_init, and making
them introspectable at the class object.
--
Eduardo
next prev parent reply other threads:[~2018-07-16 14:25 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-09 21:03 [Qemu-arm] [PATCH] hw/arm/bcm283x: Fix crash with device_add bcm2837 on unsupported machines Thomas Huth
2018-07-09 21:03 ` [Qemu-devel] " Thomas Huth
2018-07-09 21:31 ` [Qemu-arm] " Eduardo Habkost
2018-07-09 21:31 ` [Qemu-devel] " Eduardo Habkost
2018-07-09 21:36 ` [Qemu-arm] " Thomas Huth
2018-07-09 21:36 ` [Qemu-devel] " Thomas Huth
2018-07-09 21:42 ` [Qemu-arm] " Peter Maydell
2018-07-09 21:42 ` [Qemu-devel] " Peter Maydell
2018-07-09 22:03 ` [Qemu-arm] " Thomas Huth
2018-07-09 22:03 ` [Qemu-devel] " Thomas Huth
2018-07-10 6:50 ` [Qemu-arm] " Peter Maydell
2018-07-10 6:50 ` [Qemu-devel] " Peter Maydell
2018-07-11 7:21 ` [Qemu-arm] " Thomas Huth
2018-07-11 7:21 ` [Qemu-devel] " Thomas Huth
2018-07-11 16:12 ` [Qemu-arm] " Eduardo Habkost
2018-07-11 16:12 ` [Qemu-devel] " Eduardo Habkost
2018-07-11 17:15 ` [Qemu-arm] " Peter Maydell
2018-07-11 17:15 ` [Qemu-devel] " Peter Maydell
2018-07-12 12:06 ` [Qemu-arm] " Markus Armbruster
2018-07-12 12:06 ` Markus Armbruster
2018-07-12 12:55 ` [Qemu-arm] " Peter Maydell
2018-07-12 12:55 ` Peter Maydell
2018-07-12 13:19 ` [Qemu-arm] " Markus Armbruster
2018-07-12 13:19 ` Markus Armbruster
2018-07-12 15:25 ` [Qemu-arm] " Thomas Huth
2018-07-12 15:25 ` Thomas Huth
2018-07-12 16:16 ` [Qemu-arm] " Markus Armbruster
2018-07-12 16:16 ` Markus Armbruster
2018-07-12 16:22 ` [Qemu-arm] " Peter Maydell
2018-07-12 16:22 ` Peter Maydell
2018-07-12 16:32 ` Thomas Huth
2018-07-16 6:41 ` [Qemu-arm] " Markus Armbruster
2018-07-16 6:41 ` Markus Armbruster
2018-07-11 17:21 ` [Qemu-arm] " Paolo Bonzini
2018-07-11 17:21 ` [Qemu-devel] " Paolo Bonzini
2018-07-11 19:04 ` [Qemu-arm] " Thomas Huth
2018-07-11 19:04 ` [Qemu-devel] " Thomas Huth
2018-07-11 19:59 ` [Qemu-arm] " Eduardo Habkost
2018-07-11 19:59 ` [Qemu-devel] " Eduardo Habkost
2018-07-12 8:04 ` [Qemu-arm] " Paolo Bonzini
2018-07-12 8:04 ` Paolo Bonzini
2018-07-12 12:04 ` [Qemu-arm] " Markus Armbruster
2018-07-12 12:04 ` Markus Armbruster
2018-07-11 17:20 ` [Qemu-arm] " Paolo Bonzini
2018-07-11 17:20 ` [Qemu-devel] " Paolo Bonzini
2018-07-11 18:30 ` [Qemu-arm] " Eduardo Habkost
2018-07-11 18:30 ` [Qemu-devel] " Eduardo Habkost
2018-07-11 20:16 ` [Qemu-arm] " Paolo Bonzini
2018-07-11 20:16 ` [Qemu-devel] " Paolo Bonzini
2018-07-11 20:23 ` [Qemu-arm] " Eduardo Habkost
2018-07-11 20:23 ` [Qemu-devel] " Eduardo Habkost
2018-07-12 8:05 ` Paolo Bonzini
2018-07-12 18:04 ` [Qemu-arm] " Eduardo Habkost
2018-07-12 18:04 ` Eduardo Habkost
2018-07-16 6:43 ` [Qemu-arm] " Markus Armbruster
2018-07-16 6:43 ` Markus Armbruster
2018-07-16 14:25 ` Eduardo Habkost [this message]
2018-07-16 14:25 ` Eduardo Habkost
2018-07-11 18:43 ` [Qemu-arm] " Thomas Huth
2018-07-11 18:43 ` [Qemu-devel] " Thomas Huth
2018-07-11 20:15 ` [Qemu-arm] " Paolo Bonzini
2018-07-11 20:15 ` [Qemu-devel] " Paolo Bonzini
2018-07-12 5:57 ` [Qemu-arm] " Thomas Huth
2018-07-12 5:57 ` [Qemu-devel] " 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=20180716142532.GH31657@localhost.localdomain \
--to=ehabkost@redhat.com \
--cc=armbru@redhat.com \
--cc=pbonzini@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 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.