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: Paolo Bonzini
Subject: Re: [PATCH v4 2/3] mac_via: fix incorrect creation of mos6522 device in mac_via
Date: Sat, 14 Mar 2020 15:03:55 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0

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.

So, sysbus_init_child_obj is fine.

Paolo




reply via email to

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