qapi: New special feature flag "deprecated"

Unlike regular feature flags, the new special feature flag
"deprecated" is recognized by the QAPI generator.  For now, it's only
permitted with commands, events, and struct members.  It will be put
to use shortly.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200317115459.31821-26-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[Doc typo fixed]
This commit is contained in:
Markus Armbruster 2020-03-17 12:54:50 +01:00
parent 4a8837389e
commit f965e8fea6
8 changed files with 24 additions and 6 deletions

View file

@ -193,6 +193,12 @@ class QAPISchemaType(QAPISchemaEntity):
return None
return self.name
def check(self, schema):
QAPISchemaEntity.check(self, schema)
if 'deprecated' in [f.name for f in self.features]:
raise QAPISemError(
self.info, "feature 'deprecated' is not supported for types")
def describe(self):
assert self.meta
return "%s type '%s'" % (self.meta, self.name)