qapi qga: Elide redundant has_FOO in generated C

The has_FOO for pointer-valued FOO are redundant, except for arrays.
They are also a nuisance to work with.  Recent commit "qapi: Start to
elide redundant has_FOO in generated C" provided the means to elide
them step by step.  This is the step for qga/qapi-schema.json.

Said commit explains the transformation in more detail.  The invariant
violations mentioned there do not occur here.

Cc: Michael Roth <michael.roth@amd.com>
Cc: Konstantin Kostiuk <kkostiuk@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20221104160712.3005652-30-armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
This commit is contained in:
Markus Armbruster 2022-11-04 17:07:11 +01:00
parent 41462e4106
commit 91eab32a3f
4 changed files with 20 additions and 66 deletions

View file

@ -758,8 +758,7 @@ class QAPISchemaObjectTypeMember(QAPISchemaMember):
def need_has(self):
assert self.type
# Temporary hack to support dropping the has_FOO in reviewable chunks
opt_out = [
'qga/qapi-schema.json']
opt_out = []
if self.info and any(self.info.fname.endswith(mod)
for mod in opt_out):
return self.optional