Andreas Färber <afaer...@suse.de> writes: > From: "Daniel P. Berrange" <berra...@redhat.com> > > 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 = object_property_iter_init(obj); > while ((prop = 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 <berra...@redhat.com> > Tested-by: Pavel Fedin <p.fe...@samsung.com> > [AF: Fixed examples, style cleanups] > Signed-off-by: Andreas Färber <afaer...@suse.de>