qapi: ensure stable sort ordering when checking QAPI entities

Some early python 3.x versions will have different default
ordering when calling the 'values()' method on a dict, compared
to python 2.x and later 3.x versions. Explicitly sort the items
to get a stable ordering.

Backports commit f7a5376d4b667cf6c83c1d640e32d22456d7b5ee from qemu
This commit is contained in:
Daniel P. Berrange 2018-03-06 11:30:30 -05:00 committed by Lioncash
parent 74091c5976
commit 4fb711df46
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -1684,7 +1684,7 @@ class QAPISchema(object):
assert False
def check(self):
for ent in self._entity_dict.values():
for (name, ent) in sorted(self._entity_dict.items()):
ent.check(self)
def visit(self, visitor):