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 /docs | |
parent | 3a63b24a1bbf166e6f455fe43a6bbd8dea413d92 (diff) | |
parent | 3bef3aaec91815b75a78a4c12ca92ac3cec53faf (diff) |
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 'docs')
-rw-r--r-- | docs/devel/qapi-code-gen.txt | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/docs/devel/qapi-code-gen.txt b/docs/devel/qapi-code-gen.txt index 45c93a43cc..59d6973e1e 100644 --- a/docs/devel/qapi-code-gen.txt +++ b/docs/devel/qapi-code-gen.txt @@ -1493,6 +1493,10 @@ $(prefix)qapi-commands.c: Command marshal/dispatch functions for each $(prefix)qapi-commands.h: Function prototypes for the QMP commands specified in the schema +$(prefix)qapi-init-commands.h - Command initialization prototype + +$(prefix)qapi-init-commands.c - Command initialization code + Example: $ cat qapi-generated/example-qapi-commands.h @@ -1502,11 +1506,9 @@ Example: #define EXAMPLE_QAPI_COMMANDS_H #include "example-qapi-types.h" - #include "qapi/qmp/dispatch.h" UserDefOne *qmp_my_command(UserDefOneList *arg1, Error **errp); void qmp_marshal_my_command(QDict *args, QObject **ret, Error **errp); - void example_qmp_init_marshal(QmpCommandList *cmds); #endif /* EXAMPLE_QAPI_COMMANDS_H */ $ cat qapi-generated/example-qapi-commands.c @@ -1566,7 +1568,19 @@ Example: visit_end_struct(v, NULL); visit_free(v); } +[Uninteresting stuff omitted...] + $ cat qapi-generated/example-qapi-init-commands.h +[Uninteresting stuff omitted...] + #ifndef EXAMPLE_QAPI_INIT_COMMANDS_H + #define EXAMPLE_QAPI_INIT_COMMANDS_H + #include "qapi/qmp/dispatch.h" + + void example_qmp_init_marshal(QmpCommandList *cmds); + + #endif /* EXAMPLE_QAPI_INIT_COMMANDS_H */ + $ cat qapi-generated/example-qapi-init-commands.c +[Uninteresting stuff omitted...] void example_qmp_init_marshal(QmpCommandList *cmds) { QTAILQ_INIT(cmds); @@ -1574,7 +1588,6 @@ Example: qmp_register_command(cmds, "my-command", qmp_marshal_my_command, QCO_NO_OPTIONS); } - [Uninteresting stuff omitted...] For a modular QAPI schema (see section Include directives), code for |