aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2020-03-17 12:54:50 +0100
committerMarkus Armbruster <armbru@redhat.com>2020-03-17 21:42:47 +0100
commitf965e8fea6a915343d160ba6043deb75710d8df1 (patch)
tree50557c3f42431652f1e566b367625151891e1b7f /scripts
parent4a8837389ef28554a57cdad8e2fc90ae1362dcb2 (diff)
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]
Diffstat (limited to 'scripts')
-rw-r--r--scripts/qapi/schema.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py
index 6ee3677215..78309a00f0 100644
--- a/scripts/qapi/schema.py
+++ b/scripts/qapi/schema.py
@@ -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)