qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 2/3] mac_via: fix incorrect creation of mos6522 device in


From: Markus Armbruster
Subject: Re: [PATCH v4 2/3] mac_via: fix incorrect creation of mos6522 device in mac_via
Date: Sun, 15 Mar 2020 15:56:24 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

Paolo Bonzini <address@hidden> writes:

> On 14/03/20 14:19, Mark Cave-Ayland wrote:
>>> Observe that mac_via_init() has obvious side effects.  In particular, it
>>> creates two devices that are then visible in "info qtree", and that's
>>> caught by device-introspect-test.
>>>
>>> I believe these things need to be done in .realize().
>
> That is not a problem; the devices should be removed when the device is
> finalized.  In theory the steps would be:
>
> - the child properties are removed
>
> - this causes unparent to be called on the child devices
>
> - this causes the child devices to be unrealized
>
> - this causes the child devices to remove themselves from their bus (and
> from "info qtree")
>
> - this causes the refcount to drop to zero and the devices to be
> finalized themselves.
>
> The question is why they are not, i.e. where does the above reasoning break.

I don't know.  But let's for the sake of the argument assume this
actually worked.  Asking for help in the monitor then *still* has side
effects visible in the time span between .instance_init() and
finalization.

Why is that harmless?

> So, sysbus_init_child_obj is fine.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]