Commit f965e8fe authored by Markus Armbruster's avatar Markus Armbruster
Browse files

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: default avatarMarkus Armbruster <armbru@redhat.com>
Message-Id: <20200317115459.31821-26-armbru@redhat.com>
Reviewed-by: default avatarEric Blake <eblake@redhat.com>
[Doc typo fixed]
parent 4a883738
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -683,6 +683,12 @@ Intended use is to have each feature string signal that this build of
QEMU shows a certain behaviour.


==== Special features ====

Feature "deprecated" marks a command, event, or struct member as
deprecated.  It is not supported elsewhere so far.


=== Naming rules and reserved names ===

All names must begin with a letter, and contain only ASCII letters,
+6 −0
Original line number Diff line number Diff line
@@ -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)
+1 −0
Original line number Diff line number Diff line
@@ -242,6 +242,7 @@ qapi-schema += event-case.json
qapi-schema += event-member-invalid-dict.json
qapi-schema += event-nest-struct.json
qapi-schema += features-bad-type.json
qapi-schema += features-deprecated-type.json
qapi-schema += features-duplicate-name.json
qapi-schema += features-if-invalid.json
qapi-schema += features-missing-name.json
+2 −0
Original line number Diff line number Diff line
features-deprecated-type.json: In struct 'S':
features-deprecated-type.json:2: feature 'deprecated' is not supported for types
+3 −0
Original line number Diff line number Diff line
# Feature 'deprecated' is not supported for types
{ 'struct': 'S', 'data': {},
  'features': [ 'deprecated' ] }
Loading