Re: [RFC PATCH 074/134] hw/i386/pc: Give pcspk a QOM parent

Philippe Mathieu-Daudé <[email protected]>
Newsgroups org.nongnu.qemu-riscv,org.nongnu.qemu-arm,org.nongnu.qemu-devel
Message-ID <[email protected]>
On 12/7/26 00:36, Alexander Graf wrote:
> pcspk was created in pc_machine_initfn() as an orphan and manually
> unref'd in pc_machine_finalize() when the machine was never realized
> (e.g. -M pc,help).  Making it a child<> of the machine at creation
> time lets the QOM property teardown in object_property_del_all()
> handle that lifecycle for free, so pc_machine_finalize() and its
> open-coded refcount juggling can go.
> 
> The realize path switches from isa_realize_and_unref() to plain
> qdev_realize() because the reference is now held by the parent's
> child<> property, not the caller.

Nice.

Reviewed-by: Philippe Mathieu-Daudé <[email protected]>

> Assisted-by: Kiro
> Signed-off-by: Alexander Graf <[email protected]>
> ---
>   hw/i386/pc.c | 14 ++------------
>   1 file changed, 2 insertions(+), 12 deletions(-)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.