From mboxrd@z Thu Jan 1 00:00:00 1970
Received: from eggs.gnu.org ([2001:4830:134:3::10]:39740)
by lists.gnu.org with esmtp (Exim 4.71)
(envelope-from
) id 1ZucuU-0000bA-Hd
for qemu-devel@nongnu.org; Fri, 06 Nov 2015 04:02:15 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
(envelope-from ) id 1ZucuO-00075u-Lo
for qemu-devel@nongnu.org; Fri, 06 Nov 2015 04:02:14 -0500
Received: from mailout4.w1.samsung.com ([210.118.77.14]:40939)
by eggs.gnu.org with esmtp (Exim 4.71)
(envelope-from ) id 1ZucuO-00075J-GD
for qemu-devel@nongnu.org; Fri, 06 Nov 2015 04:02:08 -0500
Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244])
by mailout4.w1.samsung.com
(Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5
2014)) with ESMTP id <0NXD006WDYFE3750@mailout4.w1.samsung.com> for
qemu-devel@nongnu.org; Fri, 06 Nov 2015 09:02:02 +0000 (GMT)
From: Pavel Fedin
References: <1444739866-14798-1-git-send-email-berrange@redhat.com>
<1444739866-14798-7-git-send-email-berrange@redhat.com>
<563B9A7C.4010000@suse.de>
In-reply-to: <563B9A7C.4010000@suse.de>
Date: Fri, 06 Nov 2015 12:02:01 +0300
Message-id: <002101d11871$cd4139b0$67c3ad10$@samsung.com>
MIME-version: 1.0
Content-type: text/plain; charset=iso-8859-1
Content-transfer-encoding: 7bit
Content-language: ru
Subject: Re: [Qemu-devel] [PATCH v4 6/7] qom: replace object property list
with GHashTable
List-Id:
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
To: =?iso-8859-1?Q?'Andreas_F=E4rber'?= , "'Daniel P. Berrange'" , qemu-devel@nongnu.org, 'Markus Armbruster'
Cc: 'Paolo Bonzini'
Hello!
> > static void object_property_del_all(Object *obj)
> > {
> > - while (!QTAILQ_EMPTY(&obj->properties)) {
> > - ObjectProperty *prop = QTAILQ_FIRST(&obj->properties);
> > -
> > - QTAILQ_REMOVE(&obj->properties, prop, node);
> > + ObjectProperty *prop;
> > + GHashTableIter iter;
> > + gpointer key, value;
> >
> > + g_hash_table_iter_init(&iter, obj->properties);
> > + while (g_hash_table_iter_next(&iter, &key, &value)) {
> > + prop = value;
> > if (prop->release) {
> > prop->release(obj, prop->name, prop->opaque);
> > }
>
> Why is this not in property_free(), too? Is there a timing difference?
This is what i started from, and got NAKed. property_free() gets only ObjectProperty * as argument, but for our release callback we
need also 'obj'. In my first version i added Object * backpointer to ObjectProperty and Daniel reported a problem with that:
--- cut ---
I have a patch which adds property registration against the
class, so requiring ObjectProperty to have a back-poointer
to an object instance is not desirable.
--- cut ---
Full message here: https://lists.gnu.org/archive/html/qemu-devel/2015-10/msg01999.html
>
> > -
> > - g_free(prop->name);
> > - g_free(prop->type);
> > - g_free(prop->description);
> > - g_free(prop);
> > }
> > +
> > + g_hash_table_unref(obj->properties);
> > }
Kind regards,
Pavel Fedin
Expert Engineer
Samsung Electronics Research center Russia