summary refs log tree commit diff stats
path: root/include/hw/qdev-core.h
diff options
context:
space:
mode:
authorPeter Xu <peterx@redhat.com>2024-10-29 17:16:04 -0400
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2025-01-09 18:16:24 +0100
commit63450f322bf76faab7add3def89815d9198492dc (patch)
tree24eb23959c53aeed31924a27894556ef996b6d09 /include/hw/qdev-core.h
parent558ee1ede6cc95d3dde806f0ac323911c5dbb4b4 (diff)
downloadfocaccia-qemu-63450f322bf76faab7add3def89815d9198492dc.tar.gz
focaccia-qemu-63450f322bf76faab7add3def89815d9198492dc.zip
qdev: Make qdev_get_machine() not use container_get()
Currently, qdev_get_machine() has a slight misuse on container_get(), as
the helper says "get a container" but in reality the goal is to get the
machine object.  It is still a "container" but not strictly.

Note that it _may_ get a container (at "/machine") in our current unit test
of test-qdev-global-props.c before all these changes, but it's probably
unexpected and worked by accident.

Switch to an explicit object_resolve_path_component(), with a side benefit
that qdev_get_machine() can happen a lot, and we don't need to split the
string ("/machine") every time.  This also paves way for making the helper
container_get() never try to return a non-container at all.

Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20241121192202.4155849-9-peterx@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'include/hw/qdev-core.h')
0 files changed, 0 insertions, 0 deletions