diff options
| author | Peter Maydell <peter.maydell@linaro.org> | 2020-01-14 16:42:27 +0000 |
|---|---|---|
| committer | Peter Maydell <peter.maydell@linaro.org> | 2020-01-14 16:42:27 +0000 |
| commit | e021e6fe5294939f286021b3f870666ccb979aa2 (patch) | |
| tree | 606b0534cb354f1b82017d408b41c2ac2555f320 /scripts/qapi/commands.py | |
| parent | 3a63b24a1bbf166e6f455fe43a6bbd8dea413d92 (diff) | |
| parent | 3bef3aaec91815b75a78a4c12ca92ac3cec53faf (diff) | |
| download | focaccia-qemu-e021e6fe5294939f286021b3f870666ccb979aa2.tar.gz focaccia-qemu-e021e6fe5294939f286021b3f870666ccb979aa2.zip | |
Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2020-01-14' into staging
QAPI patches for 2020-01-14 # gpg: Signature made Tue 14 Jan 2020 10:15:22 GMT # gpg: using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653 # gpg: issuer "armbru@redhat.com" # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full] # gpg: aka "Markus Armbruster <armbru@pond.sub.org>" [full] # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867 4E5F 3870 B400 EB91 8653 * remotes/armbru/tags/pull-qapi-2020-01-14: qapi: Simplify QAPISchemaModularCVisitor qapi: Fix code generation for empty modules qapi: Proper intermediate representation for modules qapi: Generate command registration stuff into separate files tests/Makefile.include: Fix missing test-qapi-emit-events.[ch] qapi: Tweak "command returns a nice type" check for clarity Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'scripts/qapi/commands.py')
| -rw-r--r-- | scripts/qapi/commands.py | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/scripts/qapi/commands.py b/scripts/qapi/commands.py index ab98e504f3..afa55b055c 100644 --- a/scripts/qapi/commands.py +++ b/scripts/qapi/commands.py @@ -239,7 +239,7 @@ class QAPISchemaGenCommandVisitor(QAPISchemaModularCVisitor): def __init__(self, prefix): QAPISchemaModularCVisitor.__init__( self, prefix, 'qapi-commands', - ' * Schema-defined QAPI/QMP commands', __doc__) + ' * Schema-defined QAPI/QMP commands', None, __doc__) self._regy = QAPIGenCCode(None) self._visited_ret_types = {} @@ -263,18 +263,25 @@ class QAPISchemaGenCommandVisitor(QAPISchemaModularCVisitor): commands=commands, visit=visit)) self._genh.add(mcgen(''' #include "%(types)s.h" -#include "qapi/qmp/dispatch.h" ''', types=types)) def visit_end(self): - (genc, genh) = self._module[self._main_module] - genh.add(mcgen(''' + self._add_system_module('init', ' * QAPI Commands initialization') + self._genh.add(mcgen(''' +#include "qapi/qmp/dispatch.h" + void %(c_prefix)sqmp_init_marshal(QmpCommandList *cmds); ''', c_prefix=c_name(self._prefix, protect=False))) - genc.add(gen_registry(self._regy.get_content(), self._prefix)) + self._genc.preamble_add(mcgen(''' +#include "qemu/osdep.h" +#include "%(prefix)sqapi-commands.h" +#include "%(prefix)sqapi-init-commands.h" +''', + prefix=self._prefix)) + self._genc.add(gen_registry(self._regy.get_content(), self._prefix)) def visit_command(self, name, info, ifcond, arg_type, ret_type, gen, success_response, boxed, allow_oob, allow_preconfig, |