From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43419) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c2gSS-0006W2-Fj for qemu-devel@nongnu.org; Fri, 04 Nov 2016 11:31:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c2gSR-0004Bz-JJ for qemu-devel@nongnu.org; Fri, 04 Nov 2016 11:31:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46630) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c2gSR-0004BJ-Cr for qemu-devel@nongnu.org; Fri, 04 Nov 2016 11:31:07 -0400 From: Markus Armbruster References: <1477705687-31175-1-git-send-email-ehabkost@redhat.com> <1477705687-31175-7-git-send-email-ehabkost@redhat.com> Date: Fri, 04 Nov 2016 16:31:04 +0100 In-Reply-To: <1477705687-31175-7-git-send-email-ehabkost@redhat.com> (Eduardo Habkost's message of "Fri, 28 Oct 2016 23:48:05 -0200") Message-ID: <87d1ib5kjr.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v4 6/8] qom: object_class_property_iter_init() function List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: qemu-devel@nongnu.org, Igor Mammedov , Andreas =?utf-8?Q?F=C3=A4rber?= Eduardo Habkost writes: > The new function will allow us to iterate over class properties > using the same logic we use for object properties. Unit test > included. > > Signed-off-by: Eduardo Habkost > --- > Changes series v1 -> v3: > * (none) > > Changes series v3 -> v4: > * Trivial whitespace change (removed extra newline) > --- > include/qom/object.h | 14 ++++++++++++++ > qom/object.c | 10 ++++++++-- > tests/check-qom-proplist.c | 28 ++++++++++++++++++++++++++++ > 3 files changed, 50 insertions(+), 2 deletions(-) > > diff --git a/include/qom/object.h b/include/qom/object.h > index 5ecc2d1..6e3646e 100644 > --- a/include/qom/object.h > +++ b/include/qom/object.h > @@ -995,6 +995,20 @@ void object_property_iter_init(ObjectPropertyIterator *iter, > Object *obj); > > /** > + * object_class_property_iter_init: > + * @klass: the class > + * > + * Initializes an iterator for traversing all properties > + * registered against an object class and all parent classes. > + * > + * It is forbidden to modify the property list while iterating, > + * whether removing or adding properties. You chose not to duplicate the example from object_property_iter_init()'s function comment. That's okay, but you might want to point to it. > + */ > +void object_class_property_iter_init(ObjectPropertyIterator *iter, > + ObjectClass *klass); > + > + > +/** > * object_property_iter_next: > * @iter: the iterator instance > * [...]