[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH 0/9] qom: improve reference counting and hot
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [RFC PATCH 0/9] qom: improve reference counting and hotplug |
Date: |
Mon, 27 Aug 2012 14:09:30 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0 |
Il 27/08/2012 13:46, Andreas Färber ha scritto:
>>> >>
>>> >> Since link and child properties all hold references, in order to
>>> >> actually free
>>> >> an object, we need to break those links. User created devices end up as
>>> >> children of a container. But child properties cannot be removed which
>>> >> means
>>> >> there's no obvious way to remove the reference and ultimately free the
>>> >> object.
>>> >>
>> > Why? Since we call _add_child() in qdev_device_add(), why can not we
>> > call object_property_del_child() for qmp_device_del(). Could you
>> > explain it more detail?
> Seconded. If we hot-unplug a device, we should surely remove its child<>
> property from /machine/unassigned or parent bus or whatever.
Sure, as soon as the device is ejected by the guest. But until that
point we need to keep the device in the QOM tree so that: 1) it has a
canonical path; 2) it can be examined; 3) it keeps children alive.
> Why is it that child<> properties cannot be removed?
Yeah, I didn't quite understand the difference between unparenting and
setting the child property to NULL.
Paolo
- Re: [Qemu-devel] [PATCH 8/9] qdev: make qdev_set_parent_bus() just set a link property, (continued)