qemu-devel
[Top][All Lists]
Advanced

[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: Andreas Färber
Subject: Re: [Qemu-devel] [RFC PATCH 0/9] qom: improve reference counting and hotplug
Date: Mon, 27 Aug 2012 13:46:05 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120713 Thunderbird/14.0

Am 27.08.2012 09:22, schrieb liu ping fan:
> On Sun, Aug 26, 2012 at 11:51 PM, Anthony Liguori <address@hidden> 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



reply via email to

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