From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, Eric Blake <eblake@redhat.com>
Subject: [PULL 15/18] docs/devel/writing-monitor-commands: Minor improvements
Date: Mon, 4 Mar 2024 07:32:33 +0100 [thread overview]
Message-ID: <20240304063236.213955-16-armbru@redhat.com> (raw)
In-Reply-To: <20240304063236.213955-1-armbru@redhat.com>
Avoid "JSON" when talking about the QAPI schema syntax. Capitalize
QEMU. Don't claim all HMP commands live in monitor/hmp-cmds.c (this
was never true). Fix punctuation and drop inappropriate "the" here
and there.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20240227115617.237875-3-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
---
docs/devel/writing-monitor-commands.rst | 32 ++++++++++++-------------
1 file changed, 15 insertions(+), 17 deletions(-)
diff --git a/docs/devel/writing-monitor-commands.rst b/docs/devel/writing-monitor-commands.rst
index cd57f46082..930da5cd06 100644
--- a/docs/devel/writing-monitor-commands.rst
+++ b/docs/devel/writing-monitor-commands.rst
@@ -115,8 +115,7 @@ the bottom::
##
{ 'command': 'hello-world' }
-The "command" keyword defines a new QMP command. It's an JSON object. All
-schema entries are JSON objects. The line above will instruct the QAPI to
+The "command" keyword defines a new QMP command. It instructs QAPI to
generate any prototypes and the necessary code to marshal and unmarshal
protocol data.
@@ -138,16 +137,16 @@ There are a few things to be noticed:
3. It takes an "Error \*\*" argument. This is required. Later we will see how to
return errors and take additional arguments. The Error argument should not
be touched if the command doesn't return errors
-4. We won't add the function's prototype. That's automatically done by the QAPI
+4. We won't add the function's prototype. That's automatically done by QAPI
5. Printing to the terminal is discouraged for QMP commands, we do it here
because it's the easiest way to demonstrate a QMP command
-You're done. Now build qemu, run it as suggested in the "Testing" section,
+You're done. Now build QEMU, run it as suggested in the "Testing" section,
and then type the following QMP command::
{ "execute": "hello-world" }
-Then check the terminal running qemu and look for the "Hello, world" string. If
+Then check the terminal running QEMU and look for the "Hello, world" string. If
you don't see it then something went wrong.
@@ -201,7 +200,7 @@ There are two important details to be noticed:
2. The C implementation signature must follow the schema's argument ordering,
which is defined by the "data" member
-Time to test our new version of the "hello-world" command. Build qemu, run it as
+Time to test our new version of the "hello-world" command. Build QEMU, run it as
described in the "Testing" section and then send two commands::
{ "execute": "hello-world" }
@@ -210,13 +209,13 @@ described in the "Testing" section and then send two commands::
}
}
- { "execute": "hello-world", "arguments": { "message": "We love qemu" } }
+ { "execute": "hello-world", "arguments": { "message": "We love QEMU" } }
{
"return": {
}
}
-You should see "Hello, world" and "We love qemu" in the terminal running qemu,
+You should see "Hello, world" and "We love QEMU" in the terminal running QEMU,
if you don't see these strings, then something went wrong.
@@ -246,7 +245,7 @@ The first argument to the error_setg() function is the Error pointer
to pointer, which is passed to all QMP functions. The next argument is a human
description of the error, this is a free-form printf-like string.
-Let's test the example above. Build qemu, run it as defined in the "Testing"
+Let's test the example above. Build QEMU, run it as defined in the "Testing"
section, and then issue the following command::
{ "execute": "hello-world", "arguments": { "message": "all you need is love" } }
@@ -279,9 +278,8 @@ Implementing the HMP command
Now that the QMP command is in place, we can also make it available in the human
monitor (HMP).
-With the introduction of the QAPI, HMP commands make QMP calls. Most of the
-time HMP commands are simple wrappers. All HMP commands implementation exist in
-the monitor/hmp-cmds.c file.
+With the introduction of QAPI, HMP commands make QMP calls. Most of the
+time HMP commands are simple wrappers.
Here's the implementation of the "hello-world" HMP command::
@@ -332,17 +330,17 @@ To test this you have to open a user monitor and issue the "hello-world"
command. It might be instructive to check the command's documentation with
HMP's "help" command.
-Please, check the "-monitor" command-line option to know how to open a user
+Please check the "-monitor" command-line option to know how to open a user
monitor.
Writing more complex commands
-----------------------------
-A QMP command is capable of returning any data the QAPI supports like integers,
+A QMP command is capable of returning any data QAPI supports like integers,
strings, booleans, enumerations and user defined types.
-In this section we will focus on user defined types. Please, check the QAPI
+In this section we will focus on user defined types. Please check the QAPI
documentation for information about the other types.
@@ -463,7 +461,7 @@ There are a number of things to be noticed:
member, it comes with a 'has_bootindex' member that needs to be set
by the implementation, as shown above
-Time to test the new command. Build qemu, run it as described in the "Testing"
+Time to test the new command. Build QEMU, run it as described in the "Testing"
section and try this::
{ "execute": "query-option-rom" }
@@ -532,7 +530,7 @@ option-roms" follows::
Show the option ROMs.
ERST
-To test this, run qemu and type "info option-roms" in the user monitor.
+To test this, run QEMU and type "info option-roms" in the user monitor.
Writing a debugging aid returning unstructured text
--
2.44.0
next prev parent reply other threads:[~2024-03-04 6:34 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-04 6:32 [PULL 00/18] QAPI patches patches for 2024-03-04 Markus Armbruster
2024-03-04 6:32 ` [PULL 01/18] qapi: Memorize since & returns sections Markus Armbruster
2024-03-04 6:32 ` [PULL 02/18] qapi: Slightly clearer error message for invalid "Returns" section Markus Armbruster
2024-03-04 6:32 ` [PULL 03/18] qapi: New documentation section tag "Errors" Markus Armbruster
2024-03-04 6:32 ` [PULL 04/18] qapi: Move error documentation to new "Errors" sections Markus Armbruster
2024-03-04 6:32 ` [PULL 05/18] qapi: Delete useless "Returns" sections Markus Armbruster
2024-03-04 6:32 ` [PULL 06/18] qapi: Clean up " Markus Armbruster
2024-03-04 6:32 ` [PULL 07/18] qapi/yank: Tweak @yank's error description for consistency Markus Armbruster
2024-03-04 6:32 ` [PULL 08/18] qga/qapi-schema: Move error documentation to new "Errors" sections Markus Armbruster
2024-03-04 6:32 ` [PULL 09/18] qga/qapi-schema: Delete useless "Returns" sections Markus Armbruster
2024-03-04 6:32 ` [PULL 10/18] qga/qapi-schema: Clean up " Markus Armbruster
2024-03-04 6:32 ` [PULL 11/18] qga/qapi-schema: Tweak documentation of fsfreeze commands Markus Armbruster
2024-03-04 6:32 ` [PULL 12/18] qga/qapi-schema: Fix guest-set-memory-blocks documentation Markus Armbruster
2024-03-04 6:32 ` [PULL 13/18] qapi: Reject "Returns" section when command doesn't return anything Markus Armbruster
2024-03-04 6:32 ` [PULL 14/18] docs/devel/writing-monitor-commands: Repair a decade of rot Markus Armbruster
2024-03-04 6:32 ` Markus Armbruster [this message]
2024-03-04 6:32 ` [PULL 16/18] qapi: New QAPI_LIST_LENGTH() Markus Armbruster
2024-03-04 6:32 ` [PULL 17/18] qapi: New strv_from_str_list() Markus Armbruster
2024-03-04 6:32 ` [PULL 18/18] migration: simplify exec migration functions Markus Armbruster
2024-03-05 13:45 ` [PULL 00/18] QAPI patches patches for 2024-03-04 Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240304063236.213955-16-armbru@redhat.com \
--to=armbru@redhat.com \
--cc=eblake@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).