[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 26/30] docs/devel/writing-qmp-commands: Update for mo
From: |
Eric Blake |
Subject: |
[Qemu-devel] [PULL 26/30] docs/devel/writing-qmp-commands: Update for modular QAPI |
Date: |
Thu, 1 Mar 2018 13:42:41 -0600 |
From: Markus Armbruster <address@hidden>
With modular code generation, putting stuff right into
qapi-schema.json is a bad idea. Update writing-qmp-commands.txt
accordingly.
Signed-off-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
Reviewed-by: Michael Roth <address@hidden>
Signed-off-by: Eric Blake <address@hidden>
---
docs/devel/writing-qmp-commands.txt | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/docs/devel/writing-qmp-commands.txt
b/docs/devel/writing-qmp-commands.txt
index 4f5b24c0c4c..776b3b41ca0 100644
--- a/docs/devel/writing-qmp-commands.txt
+++ b/docs/devel/writing-qmp-commands.txt
@@ -15,8 +15,8 @@ start with docs/interop/qmp-intro.txt.
Generally speaking, the following steps should be taken in order to write a
new QMP command.
-1. Write the command's and type(s) specification in the QAPI schema file
- (qapi-schema.json in the root source directory)
+1. Define the command and any types it needs in the appropriate QAPI
+ schema module.
2. Write the QMP command itself, which is a regular C function. Preferably,
the command should be exported by some QEMU subsystem. But it can also be
@@ -88,8 +88,9 @@ command carries some meaningful action in QEMU but here it
will just print
Our command will be called "hello-world". It takes no arguments, nor does it
return any data.
-The first step is to add the following line to the bottom of the
-qapi-schema.json file:
+The first step is defining the command in the appropriate QAPI schema
+module. We pick module qapi/misc.json, and add the following line at
+the bottom:
{ 'command': 'hello-world' }
@@ -245,7 +246,7 @@ This is very important. No QMP command will be accepted in
QEMU without proper
documentation.
There are many examples of such documentation in the schema file already, but
-here goes "hello-world"'s new entry for the qapi-schema.json file:
+here goes "hello-world"'s new entry for qapi/misc.json:
##
# @hello-world
@@ -425,8 +426,7 @@ There are a number of things to be noticed:
allocated by the implementation. This is so because the QAPI also generates
a function to free its types and it cannot distinguish between dynamically
or statically allocated strings
-6. You have to include the "qmp-commands.h" header file in qemu-timer.c,
- otherwise qemu won't build
+6. You have to include "qapi/qmp-commands-misc.h" in qemu-timer.c
Time to test the new command. Build qemu, run it as described in the "Testing"
section and try this:
--
2.14.3
- [Qemu-devel] [PULL 08/30] qapi-gen: New common driver for code and doc generators, (continued)
- [Qemu-devel] [PULL 08/30] qapi-gen: New common driver for code and doc generators, Eric Blake, 2018/03/01
- [Qemu-devel] [PULL 14/30] qapi: Concentrate QAPISchemaParser.exprs updates in .__init__(), Eric Blake, 2018/03/01
- [Qemu-devel] [PULL 16/30] qapi: Generate in source order, Eric Blake, 2018/03/01
- [Qemu-devel] [PULL 17/30] qapi: Record 'include' directives in intermediate representation, Eric Blake, 2018/03/01
- [Qemu-devel] [PULL 18/30] qapi: Rename generated qmp-marshal.c to qmp-commands.c, Eric Blake, 2018/03/01
- [Qemu-devel] [PULL 21/30] qapi/common: Fix guardname() for funny filenames, Eric Blake, 2018/03/01
- [Qemu-devel] [PULL 20/30] qapi/types qapi/visit: Generate built-in stuff into separate files, Eric Blake, 2018/03/01
- [Qemu-devel] [PULL 19/30] qapi: Make code-generating visitors use QAPIGen more, Eric Blake, 2018/03/01
- [Qemu-devel] [PULL 22/30] qapi: Generate separate .h, .c for each module, Eric Blake, 2018/03/01
- [Qemu-devel] [PULL 24/30] watchdog: Consolidate QAPI into single file, Eric Blake, 2018/03/01
- [Qemu-devel] [PULL 26/30] docs/devel/writing-qmp-commands: Update for modular QAPI,
Eric Blake <=
- [Qemu-devel] [PULL 27/30] docs: Correct outdated information on QAPI, Eric Blake, 2018/03/01
- [Qemu-devel] [PULL 30/30] qapi: Don't create useless directory qapi-generated, Eric Blake, 2018/03/01
- [Qemu-devel] [PULL 23/30] Include less of the generated modular QAPI headers, Eric Blake, 2018/03/01
- [Qemu-devel] [PULL 29/30] Fix up dangling references to qmp-commands.* in comment and doc, Eric Blake, 2018/03/01
- [Qemu-devel] [PULL 28/30] qapi: Move qapi-schema.json to qapi/, rename generated files, Eric Blake, 2018/03/01
- [Qemu-devel] [PULL 25/30] qapi: Empty out qapi-schema.json, Eric Blake, 2018/03/01
- Re: [Qemu-devel] [PULL 00/30] QAPI patches for 2018-03-01, no-reply, 2018/03/01
- Re: [Qemu-devel] [PULL 00/30] QAPI patches for 2018-03-01, no-reply, 2018/03/01
- Re: [Qemu-devel] [PULL 00/30] QAPI patches for 2018-03-01, no-reply, 2018/03/01