From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60493) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzLOG-0004OE-QS for qemu-devel@nongnu.org; Thu, 19 Nov 2015 04:20:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZzLOD-0003Ib-H3 for qemu-devel@nongnu.org; Thu, 19 Nov 2015 04:20:28 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38878) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzLOD-0003IU-Be for qemu-devel@nongnu.org; Thu, 19 Nov 2015 04:20:25 -0500 From: Markus Armbruster References: <1447879178-5440-1-git-send-email-afaerber@suse.de> <1447879178-5440-3-git-send-email-afaerber@suse.de> Date: Thu, 19 Nov 2015 10:20:22 +0100 In-Reply-To: <1447879178-5440-3-git-send-email-afaerber@suse.de> ("Andreas =?utf-8?Q?F=C3=A4rber=22's?= message of "Wed, 18 Nov 2015 21:39:30 +0100") Message-ID: <87vb8ybb1l.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PULL 02/10] qom: Introduce ObjectPropertyIterator struct for iteration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?utf-8?Q?F=C3=A4rber?= Cc: qemu-devel@nongnu.org Andreas F=C3=A4rber writes: > From: "Daniel P. Berrange" > > Some users of QOM need to be able to iterate over properties > defined against an object instance. Currently they are just > directly using the QTAIL macros against the object properties > data structure. > > This is bad because it exposes them to changes in the data > structure used to store properties, as well as changes in > functionality such as ability to register properties against > the class. > > This provides an ObjectPropertyIterator struct which will > insulate the callers from the particular data structure > used to store properties. It can be used thus > > ObjectProperty *prop; > ObjectPropertyIterator *iter; > > iter =3D object_property_iter_init(obj); > while ((prop =3D object_property_iter_next(iter))) { > ... do something with prop ... > } > object_property_iter_free(iter); I see my review hasn't been addressed, probably because it came late. Would you accept a follow-up patch to bring the iterator into line with existing ones? > Signed-off-by: Daniel P. Berrange > Tested-by: Pavel Fedin > [AF: Fixed examples, style cleanups] > Signed-off-by: Andreas F=C3=A4rber