From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57464) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6KmN-0003fl-Po for qemu-devel@nongnu.org; Tue, 08 Dec 2015 11:06:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a6Km7-0006dX-6T for qemu-devel@nongnu.org; Tue, 08 Dec 2015 11:06:15 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54151) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6Km7-0006cv-06 for qemu-devel@nongnu.org; Tue, 08 Dec 2015 11:05:59 -0500 References: <1448638055-22113-1-git-send-email-berrange@redhat.com> From: Eric Blake Message-ID: <5666FFE0.10703@redhat.com> Date: Tue, 8 Dec 2015 09:05:52 -0700 MIME-Version: 1.0 In-Reply-To: <1448638055-22113-1-git-send-email-berrange@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="T3K4rUMd79TV1clMwdqLPgLXckr63DjmO" Subject: Re: [Qemu-devel] [PATCH] qom: change object property iterator API contract List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" , qemu-devel@nongnu.org Cc: =?UTF-8?Q?Andreas_F=c3=a4rber?= , Markus Armbruster This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --T3K4rUMd79TV1clMwdqLPgLXckr63DjmO Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11/27/2015 08:27 AM, Daniel P. Berrange wrote: > Currently the object property iterator API works as follows >=20 > ObjectPropertyIterator *iter; >=20 > iter =3D object_property_iter_init(obj); > while ((prop =3D object_property_iter_next(iter))) { > ... > } > object_property_iter_free(iter); >=20 > This has the benefit that the ObjectPropertyIterator struct > can be opaque, but has the downside that callers need to > explicitly call a free function. It is also not in keeping > with iterator style used elsewhere in QEMU/glib2 >=20 > This patch changes the API to use stack allocation instead >=20 > ObjectPropertyIterator iter; >=20 > object_property_iter_init(&iter, obj); > while ((prop =3D object_property_iter_next(&iter))) { > ... > } >=20 > Signed-off-by: Daniel P. Berrange > --- >=20 > NB, this patch is not against master, it is intended to apply > after >=20 > "qom: allow properties to be registered against classes" >=20 > which is queued in qom-next for 2.6 >=20 > hw/ppc/spapr_drc.c | 7 +++---- > include/qom/object.h | 42 +++++++++++++++++++++++++++-----------= ---- > net/filter.c | 7 +++---- > qmp.c | 14 ++++++-------- > qom/object.c | 22 ++++------------------ > tests/check-qom-proplist.c | 7 +++---- > vl.c | 7 +++---- > 7 files changed, 49 insertions(+), 57 deletions(-) >=20 > +++ b/include/qom/object.h > @@ -346,6 +346,7 @@ typedef struct ObjectProperty > void *opaque; > } ObjectProperty; > =20 > + > /** > * ObjectUnparent: > * @obj: the object that is being removed from the composition tree Spurious whitespace change? > =20 > + /** > + * object_property_iter_free: > + * @iter: the iterator instance > + * > + * Releases any resources associated with the iterator. It is > + * not necessary to call this method if object_property_iter_next > + * has returned %NULL. It is only required if an application wishes > + * to abort iteration before it is complete > + */ > +void object_property_iter_free(ObjectPropertyIterator *iter); > + Huh? Why is this being added? I thought the point was to get rid of the need for object_property_iter_free(). > +++ b/qom/object.c > @@ -67,11 +67,6 @@ struct TypeImpl Other than that snafu, everything else looked fine. If that's all you fix for v2, you can add: Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --T3K4rUMd79TV1clMwdqLPgLXckr63DjmO Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWZv/gAAoJEKeha0olJ0NqgJMIAJaBNcFWoN+Kj8LD4o3x8Id8 yG3jxKQBMY3aSIAP0VjC+ZHnhoQLK7BFJ4zOlqlLOQsXopZFoAq8t7uwY5b3Bkbt YNuQKGHYokNejp5+SMSwbLV/pd9C5qNf5brk3d7J9mbKNZVCRYJrnP2hJBaQ32oQ T9mh4mp0BkPvAEa16GU8QDp1Z6fZW3GbtMpTWL4R4d/aM5gUl7J+PJIlWRSiABHw ktyaCitWvBwo3JS7bltkXlPG6gHt10bwLijnnGhYrfV66NPfs+jjUWMLUGnRwU17 wovl/Lm+1MIcYrYe9t89Fw0adpeRzcvQzSt8T+1YCcDho27RY3C68yxxjxk3HfI= =eTdS -----END PGP SIGNATURE----- --T3K4rUMd79TV1clMwdqLPgLXckr63DjmO--