On 12/7/26 00:35, Alexander Graf wrote:
Convert the *_orphan() device-creation calls in hw/nitro 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):
file:line | parent | name | rationale
machine.c:200 | OBJECT(bridge) | "heartbeat" | onboard heartbeat
is a fixed child of the vsock bridge it plugs into; bridge owns its lifetime
machine.c:212 | OBJECT(bridge) | "serial" | debug-mode
serial-over-vsock is a fixed child of the same bridge
nitro-vsock-bus.c:51 | ORPHAN-JUSTIFIED| - | bridge is parented
immediately after via qdev_set_id() to /machine/peripheral/nitro-vsock; keep
the orphan creator here
Link: https://lore.kernel.org/qemu-devel/[email protected]/
Assisted-by: Kiro
Signed-off-by: Alexander Graf <[email protected]>
---
hw/nitro/machine.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>