Am 27.08.2012 09:22, schrieb liu ping fan: > On Sun, Aug 26, 2012 at 11:51 PM, Anthony Liguori <[email protected]> wrote: >> Right now, you need to pair up object_new with object_delete. This is >> impractical when using reference counting because we would like to ensure >> that >> object_unref() also frees memory when needed. >> >> The first few patches fix this problem by introducing a release callback so >> that objects that need special release behavior (i.e. g_free) can do that. >> >> 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. Why is it that child<> properties cannot be removed? Andreas -- SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
