qemu/scripts/qapi
Markus Armbruster 43d1455cf8 qapi: Fix code generation with Python 3.5
Recent commit 3e7fb5811b "qapi: Fix code generation for empty modules"
modules" switched QAPISchema.visit() from

    for entity in self._entity_list:

effectively to

    for mod in self._module_dict.values():
        for entity in mod._entity_list:

Visits in the same order as long as .values() is in insertion order.
That's the case only for Python 3.6 and later.  Before, it's in some
arbitrary order, which results in broken generated code.

Fix by making self._module_dict an OrderedDict rather than a dict.

Fixes: 3e7fb5811b
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Thomas Huth <thuth@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: BALATON Zoltan <balaton@eik.bme.hu>
Tested-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 20200116202558.31473-1-armbru@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-01-20 12:17:38 +00:00
..
__init__.py
commands.py qapi: Simplify QAPISchemaModularCVisitor 2020-01-14 11:01:58 +01:00
common.py qapi: Split up scripts/qapi/common.py 2019-10-22 13:53:55 +02:00
doc.py qapi: Fix doc comment checking for commands and events 2019-10-29 07:35:16 +01:00
error.py qapi: Split up scripts/qapi/common.py 2019-10-22 13:53:55 +02:00
events.py qapi: Simplify QAPISchemaModularCVisitor 2020-01-14 11:01:58 +01:00
expr.py qapi: Fold normalize_enum() into check_enum() 2019-10-29 07:35:16 +01:00
gen.py qapi: Simplify QAPISchemaModularCVisitor 2020-01-14 11:01:58 +01:00
introspect.py qapi: Add feature flags to commands 2019-10-22 13:54:13 +02:00
parser.py qapi: Check feature documentation against the schema 2019-10-29 07:35:16 +01:00
schema.py qapi: Fix code generation with Python 3.5 2020-01-20 12:17:38 +00:00
source.py qapi: Split up scripts/qapi/common.py 2019-10-22 13:53:55 +02:00
types.py qapi: Simplify QAPISchemaModularCVisitor 2020-01-14 11:01:58 +01:00
visit.py qapi: Simplify QAPISchemaModularCVisitor 2020-01-14 11:01:58 +01:00