On 12/7/26 00:35, Alexander Graf wrote:
Convert the *_orphan() device-creation calls in hw/display to the new
parented API introduced earlier in this series, so every onboard
device gets a stable path in the composition tree instead of landing
in /machine/unattached with an unstable device[N] name.
The parent for each device is the object that owns its lifetime: the
machine for board-created devices, the containing device for
composite children. Names follow existing QOM conventions.
Per-site rationale (reviewers: dispute the modeling here):
hw/display/sii9022.c:167 | i2c_slave_create_simple | OBJECT(dev) | "ddc" |
DeviceClass.realize(); DDC slave owned by sii9022 device
hw/display/sm501.c:1913 | qdev_new | OBJECT(dev) | "ddc" | sm501_init() helper
receives realizing DeviceState *dev; drop _and_unref
hw/display/xlnx_dp.c:1349 | qdev_new | obj | "dpcd" | instance_init(Object
*obj); collapse existing add_child+unref, keep name
hw/display/xlnx_dp.c:1353 | qdev_new | obj | "edid" | instance_init(Object
*obj); collapse existing add_child+unref, keep name
Link: https://lore.kernel.org/qemu-devel/[email protected]/
Assisted-by: Kiro
Signed-off-by: Alexander Graf <[email protected]>
---
hw/display/sii9022.c | 2 +-
hw/display/sm501.c | 4 ++--
hw/display/xlnx_dp.c | 14 +++-----------
3 files changed, 6 insertions(+), 14 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>