Re: [Qemu-devel] [PATCH v2 01/16] qom/object: Add a new function object_initialize_child()

2018-08-16 Thread Eduardo Habkost
On Thu, Aug 16, 2018 at 01:59:49PM +0200, Thomas Huth wrote: > On 07/14/2018 12:57 AM, Eduardo Habkost wrote: > > On Fri, Jul 13, 2018 at 10:27:29AM +0200, Thomas Huth wrote: > >> A lot of code is using the object_initialize() function followed by a call > >> to object_property_add_child() to add t

Re: [Qemu-devel] [PATCH v2 01/16] qom/object: Add a new function object_initialize_child()

2018-08-16 Thread Thomas Huth
On 07/14/2018 12:57 AM, Eduardo Habkost wrote: > On Fri, Jul 13, 2018 at 10:27:29AM +0200, Thomas Huth wrote: >> A lot of code is using the object_initialize() function followed by a call >> to object_property_add_child() to add the newly initialized object as a child >> of the current object. Both

Re: [Qemu-devel] [PATCH v2 01/16] qom/object: Add a new function object_initialize_child()

2018-07-16 Thread Thomas Huth
On 14.07.2018 00:57, Eduardo Habkost wrote: > On Fri, Jul 13, 2018 at 10:27:29AM +0200, Thomas Huth wrote: >> A lot of code is using the object_initialize() function followed by a call >> to object_property_add_child() to add the newly initialized object as a child >> of the current object. Both fu

Re: [Qemu-devel] [PATCH v2 01/16] qom/object: Add a new function object_initialize_child()

2018-07-16 Thread Thomas Huth
On 13.07.2018 23:46, Eduardo Habkost wrote: > On Fri, Jul 13, 2018 at 11:29:17PM +0200, Andreas Färber wrote: >> Am 13.07.2018 um 23:16 schrieb Eduardo Habkost: >>> I wonder if we should deprecate object_initialize() and support >>> only object_initialize_child() later. Initializing an object >>>

Re: [Qemu-devel] [PATCH v2 01/16] qom/object: Add a new function object_initialize_child()

2018-07-13 Thread Eduardo Habkost
On Fri, Jul 13, 2018 at 10:27:29AM +0200, Thomas Huth wrote: > A lot of code is using the object_initialize() function followed by a call > to object_property_add_child() to add the newly initialized object as a child > of the current object. Both functions increase the reference counter of the > n

Re: [Qemu-devel] [PATCH v2 01/16] qom/object: Add a new function object_initialize_child()

2018-07-13 Thread Eduardo Habkost
On Fri, Jul 13, 2018 at 11:29:17PM +0200, Andreas Färber wrote: > Am 13.07.2018 um 23:16 schrieb Eduardo Habkost: > > I wonder if we should deprecate object_initialize() and support > > only object_initialize_child() later. Initializing an object > > contained inside another one without making it

Re: [Qemu-devel] [PATCH v2 01/16] qom/object: Add a new function object_initialize_child()

2018-07-13 Thread Andreas Färber
Am 13.07.2018 um 23:16 schrieb Eduardo Habkost: > I wonder if we should deprecate object_initialize() and support > only object_initialize_child() later. Initializing an object > contained inside another one without making it a child of the > parent object is a recipe for trouble. The root contai

Re: [Qemu-devel] [PATCH v2 01/16] qom/object: Add a new function object_initialize_child()

2018-07-13 Thread Eduardo Habkost
On Fri, Jul 13, 2018 at 10:27:29AM +0200, Thomas Huth wrote: > A lot of code is using the object_initialize() function followed by a call > to object_property_add_child() to add the newly initialized object as a child > of the current object. Both functions increase the reference counter of the > n

Re: [Qemu-devel] [PATCH v2 01/16] qom/object: Add a new function object_initialize_child()

2018-07-13 Thread Paolo Bonzini
On 13/07/2018 10:27, Thomas Huth wrote: > A lot of code is using the object_initialize() function followed by a call > to object_property_add_child() to add the newly initialized object as a child > of the current object. Both functions increase the reference counter of the > new object, but many s

[Qemu-devel] [PATCH v2 01/16] qom/object: Add a new function object_initialize_child()

2018-07-13 Thread Thomas Huth
A lot of code is using the object_initialize() function followed by a call to object_property_add_child() to add the newly initialized object as a child of the current object. Both functions increase the reference counter of the new object, but many spots that call these two functions then forget t