From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>, qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
Thomas Huth <thuth@redhat.com>,
Markus Armbruster <armbru@redhat.com>,
Like Xu <like.xu@linux.intel.com>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 4/4] qdev-hotplug: Don't check type of qdev_get_machine()
Date: Mon, 1 Nov 2021 19:03:04 +0100 [thread overview]
Message-ID: <ee7fe6bb-7df2-389e-913c-a704f6b5d815@redhat.com> (raw)
In-Reply-To: <20190425200051.19906-5-ehabkost@redhat.com>
On 4/25/19 22:00, Eduardo Habkost wrote:
> Now that qdev_get_machine_hotplug_handler() is only compiled in
> softmmu mode, we don't need to check if qdev_gt_machine() is
> really of type TYPE_MACHINE.
>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
> hw/core/qdev-hotplug.c | 13 ++++---------
> 1 file changed, 4 insertions(+), 9 deletions(-)
>
> diff --git a/hw/core/qdev-hotplug.c b/hw/core/qdev-hotplug.c
> index 8ab31043a7..017500c1e1 100644
> --- a/hw/core/qdev-hotplug.c
> +++ b/hw/core/qdev-hotplug.c
> @@ -35,16 +35,11 @@ void qbus_set_bus_hotplug_handler(BusState *bus, Error **errp)
>
> HotplugHandler *qdev_get_machine_hotplug_handler(DeviceState *dev)
> {
> - MachineState *machine;
> - MachineClass *mc;
> - Object *m_obj = qdev_get_machine();
> + MachineState *machine = MACHINE(qdev_get_machine());
> + MachineClass *mc = MACHINE_GET_CLASS(machine);
>
> - if (object_dynamic_cast(m_obj, TYPE_MACHINE)) {
> - machine = MACHINE(m_obj);
> - mc = MACHINE_GET_CLASS(machine);
> - if (mc->get_hotplug_handler) {
> - return mc->get_hotplug_handler(machine, dev);
> - }
> + if (mc->get_hotplug_handler) {
> + return mc->get_hotplug_handler(machine, dev);
> }
>
> return NULL;
>
I rebased this patch and tried it, but it fails 'check-unit':
Running test test-qdev-global-props
**
ERROR:../tests/unit/test-qdev-global-props.c:89:test_static_prop: child
process (/qdev/properties/static/default/subprocess [12678]) failed
unexpectedly
ERROR test-qdev-global-props - Bail out!
ERROR:../tests/unit/test-qdev-global-props.c:89:test_static_prop: child
process (/qdev/properties/static/default/subprocess [12678]) failed
unexpectedly
make: *** [Makefile.mtest:640: run-test-78] Error 1
Here the object is of type "container":
Object *object_get_root(void)
{
static Object *root;
if (!root) {
root = object_new("container");
}
return root;
}
next prev parent reply other threads:[~2021-11-01 19:21 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-25 20:00 [Qemu-devel] [PATCH 0/4] Remove some qdev_get_machine() calls from CONFIG_USER_ONLY Eduardo Habkost
2019-04-25 20:00 ` Eduardo Habkost
2019-04-25 20:00 ` [Qemu-devel] [PATCH 1/4] machine: Move gpio code to hw/core/gpio.c Eduardo Habkost
2019-04-25 20:00 ` Eduardo Habkost
2021-11-01 16:24 ` Philippe Mathieu-Daudé
2019-04-25 20:00 ` [Qemu-devel] [PATCH 2/4] move qdev hotplug code to qdev-hotplug.c Eduardo Habkost
2019-04-25 20:00 ` Eduardo Habkost
2019-04-25 20:00 ` [Qemu-devel] [PATCH 3/4] qdev: Don't compile hotplug code in user-mode emulation Eduardo Habkost
2019-04-25 20:00 ` Eduardo Habkost
2019-04-26 8:27 ` Paolo Bonzini
2019-04-26 8:27 ` Paolo Bonzini
2019-04-26 11:21 ` Eduardo Habkost
2019-04-26 11:21 ` Eduardo Habkost
2019-04-25 20:00 ` [Qemu-devel] [PATCH 4/4] qdev-hotplug: Don't check type of qdev_get_machine() Eduardo Habkost
2019-04-25 20:00 ` Eduardo Habkost
2021-11-01 18:03 ` Philippe Mathieu-Daudé [this message]
2019-04-25 20:09 ` [Qemu-devel] [PATCH 0/4] Remove some qdev_get_machine() calls from CONFIG_USER_ONLY no-reply
2019-04-25 20:09 ` no-reply
2019-04-26 8:55 ` Like Xu
2019-04-26 8:55 ` Like Xu
2019-05-02 20:24 ` Eduardo Habkost
2019-05-02 20:24 ` Eduardo Habkost
2019-05-06 14:34 ` Markus Armbruster
2021-11-01 18:27 ` Philippe Mathieu-Daudé
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=ee7fe6bb-7df2-389e-913c-a704f6b5d815@redhat.com \
--to=philmd@redhat.com \
--cc=armbru@redhat.com \
--cc=ehabkost@redhat.com \
--cc=like.xu@linux.intel.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.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).