aboutsummaryrefslogtreecommitdiff
path: root/scripts/qapi/gen.py
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2021-02-01 14:37:44 -0500
committerMarkus Armbruster <armbru@redhat.com>2021-02-08 14:15:58 +0100
commitc6cd7e4151794194f804ac3b8d2bc9347142c024 (patch)
tree226e35d1249140b8131b2f4c350b4f3d4ccf93f3 /scripts/qapi/gen.py
parentd921d27c1bac0765370a9b9b891f9f0429f4c7c3 (diff)
qapi/commands: Simplify command registry generation
QAPISchemaGenCommandVisitor.visit_command() needs to generate the marshalling function into the current module, and also generate its registration into the ./init system module. The latter is done somewhat awkwardly: .__init__() creates a QAPIGenCCode that will not be written out, each .visit_command() adds its registration to it, and .visit_end() copies its contents into the ./init module it creates. Instead provide the means to temporarily switch to another module. Create the ./init module in .visit_begin(), and generate its initial part. Add registrations to it in .visit_command(). Finish it in .visit_end(). Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: John Snow <jsnow@redhat.com> Message-Id: <20210201193747.2169670-14-jsnow@redhat.com>
Diffstat (limited to 'scripts/qapi/gen.py')
0 files changed, 0 insertions, 0 deletions