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