aboutsummaryrefslogtreecommitdiff
path: root/scripts/qapi
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2018-02-11 10:35:54 +0100
committerEric Blake <eblake@redhat.com>2018-03-02 13:14:10 -0600
commit8a84767cc4f7e00e5dd62435c32be9e7d2cbe4d3 (patch)
treed406903daba9ec39ff3b2d448ba373c3c1d2092b /scripts/qapi
parent97f0249474d19c1d60fb9d934c8bc08625a619ca (diff)
qapi: Generate in source order
The generators' conversion to visitors (merge commit 9e72681d16) changed the processing order of entities from source order to alphabetical order. The next commit needs source order, so change it back. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20180211093607.27351-17-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'scripts/qapi')
-rw-r--r--scripts/qapi/common.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
index 961331a210..1aa1cd3b9b 100644
--- a/scripts/qapi/common.py
+++ b/scripts/qapi/common.py
@@ -1474,6 +1474,7 @@ class QAPISchema(object):
parser = QAPISchemaParser(open(fname, 'r'))
exprs = check_exprs(parser.exprs)
self.docs = parser.docs
+ self._entity_list = []
self._entity_dict = {}
self._predefining = True
self._def_predefineds()
@@ -1485,6 +1486,7 @@ class QAPISchema(object):
# Only the predefined types are allowed to not have info
assert ent.info or self._predefining
assert ent.name not in self._entity_dict
+ self._entity_list.append(ent)
self._entity_dict[ent.name] = ent
def lookup_entity(self, name, typ=None):
@@ -1683,12 +1685,12 @@ class QAPISchema(object):
assert False
def check(self):
- for (name, ent) in sorted(self._entity_dict.items()):
+ for ent in self._entity_list:
ent.check(self)
def visit(self, visitor):
visitor.visit_begin(self)
- for (name, entity) in sorted(self._entity_dict.items()):
+ for entity in self._entity_list:
if visitor.visit_needed(entity):
entity.visit(visitor)
visitor.visit_end()