qapi/common: Eliminate QAPISchema.exprs

Backports commit 71a7510baf8a5745eb844ab289f007ff8bbbee41 from qemu
This commit is contained in:
Markus Armbruster 2018-03-09 08:54:18 -05:00 committed by Lioncash
parent 3ab06081d4
commit b859a59f49
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -1470,13 +1470,13 @@ class QAPISchema(object):
def __init__(self, fname):
try:
parser = QAPISchemaParser(open(fname, 'r'))
self.exprs = check_exprs(parser.exprs)
exprs = check_exprs(parser.exprs)
self.docs = parser.docs
self._entity_dict = {}
self._predefining = True
self._def_predefineds()
self._predefining = False
self._def_exprs()
self._def_exprs(exprs)
self.check()
except QAPIError as err:
print(err, file=sys.stderr)
@ -1661,8 +1661,8 @@ class QAPISchema(object):
name, info, doc, 'arg', self._make_members(data, info))
self._def_entity(QAPISchemaEvent(name, info, doc, data, boxed))
def _def_exprs(self):
for expr_elem in self.exprs:
def _def_exprs(self, exprs):
for expr_elem in exprs:
expr = expr_elem['expr']
info = expr_elem['info']
doc = expr_elem.get('doc')