On 10/13/2015 05:40 AM, Markus Armbruster wrote: > Eric Blake <ebl...@redhat.com> writes: >
>> @@ -900,6 +903,10 @@ class QAPISchemaEnumType(QAPISchemaType): >> def check(self, schema): >> assert len(set(self.values)) == len(self.values) >> >> + def is_implicit(self): >> + # See QAPISchema._make_implicit_enum_type() >> + return self.name[-4:] == 'Kind' >> + >> def c_type(self, is_param=False): >> return c_name(self.name) >> > > I believe this method... > >> @@ -970,12 +977,16 @@ class QAPISchemaObjectType(QAPISchemaType): >> self.variants.check(schema, members, seen) >> self.members = members >> >> + def is_implicit(self): >> + # See QAPISchema._make_implicit_object_type() >> + return self.name[0] == ':' >> + > > ... as well as this one are redundant at this stage. They become > necessary only when you start passing info != None to the constructor in > PATCH 12. If I'm right, then moving the two to PATCH 12 makes sense. I think you're right; we could float these hunks to where they become important if there is a reason for a respin. >> def _make_implicit_enum_type(self, name, values): >> - name = name + 'Kind' >> + name = name + 'Kind' # Use namespace reserved by add_name() > > This is the comment I suggested... > >> self._def_entity(QAPISchemaEnumType(name, None, values, None)) >> return name >> >> def _make_array_type(self, element_type): >> + # TODO fooList namespace is not reserved; user can create >> collisions, >> + # or abuse our type system with ['fooList'] for 2D array > > ... and this is its buddy you added on your own initiative. Thanks! > > Did you actually try the abuse? If not, I'd say "or maybe abuse", out > of caution. Yes, back in an earlier version of your introspection work, we played with 2D arrays, and concluded that it wasn't worth worrying about until the queue is flushed: https://lists.gnu.org/archive/html/qemu-devel/2015-08/msg00551.html But back then, when I was playing with it, I did confirm that ['fooList'] gets past the generator. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature