qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PULL 32/32] qapi: Polish command flags documentation in qapi-code-gen.txt
Date: Tue,  3 Jul 2018 17:37:28 +0200	[thread overview]
Message-ID: <20180703153728.2175-33-armbru@redhat.com> (raw)
In-Reply-To: <20180703153728.2175-1-armbru@redhat.com>

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20180703085358.13941-33-armbru@redhat.com>
---
 docs/devel/qapi-code-gen.txt | 61 +++++++++++++++---------------------
 1 file changed, 25 insertions(+), 36 deletions(-)

diff --git a/docs/devel/qapi-code-gen.txt b/docs/devel/qapi-code-gen.txt
index f020f6bab2..8decd6f17d 100644
--- a/docs/devel/qapi-code-gen.txt
+++ b/docs/devel/qapi-code-gen.txt
@@ -624,60 +624,48 @@ its return value.
 In rare cases, QAPI cannot express a type-safe representation of a
 corresponding Client JSON Protocol command.  You then have to suppress
 generation of a marshalling function by including a key 'gen' with
-boolean value false, and instead write your own function.  Please try
-to avoid adding new commands that rely on this, and instead use
-type-safe unions.  For an example of this usage:
+boolean value false, and instead write your own function.  For
+example:
 
  { 'command': 'netdev_add',
    'data': {'type': 'str', 'id': 'str'},
    'gen': false }
 
+Please try to avoid adding new commands that rely on this, and instead
+use type-safe unions.
+
 Normally, the QAPI schema is used to describe synchronous exchanges,
 where a response is expected.  But in some cases, the action of a
 command is expected to change state in a way that a successful
 response is not possible (although the command will still return a
 normal dictionary error on failure).  When a successful reply is not
-possible, the command expression should include the optional key
+possible, the command expression includes the optional key
 'success-response' with boolean value false.  So far, only QGA makes
 use of this member.
 
-A command can be declared to support out-of-band (OOB) execution.  By
-default, commands do not support OOB.  To declare a command that
-supports it, the schema includes an extra 'allow-oob' field.  For
-example:
+Key 'allow-oob' declares whether the command supports out-of-band
+(OOB) execution.  It defaults to false.  For example:
 
  { 'command': 'migrate_recover',
    'data': { 'uri': 'str' }, 'allow-oob': true }
 
-To execute a command with out-of-band priority, the client uses key
-"exec-oob" instead of "execute".  Example:
+See qmp-spec.txt for out-of-band execution syntax and semantics.
 
- => { "exec-oob": "migrate-recover",
-      "arguments": { "uri": "tcp:192.168.1.200:12345" } }
- <= { "return": { } }
+Commands supporting out-of-band execution can still be executed
+in-band.
 
-Without it, even the commands that support out-of-band execution will
-still be run in-band.
+When a command is executed in-band, its handler runs in the main
+thread with the BQL held.
 
-Under normal QMP command execution, the following apply to each
-command:
+When a command is executed out-of-band, its handler runs in a
+dedicated monitor I/O thread with the BQL *not* held.
 
-- They are executed in order,
-- They run only in main thread of QEMU,
-- They run with the BQL held.
+An OOB-capable command handler must satisfy the following conditions:
 
-When a command is executed with OOB, the following changes occur:
-
-- They can be completed before a pending in-band command,
-- They run in a dedicated monitor thread,
-- They run with the BQL not held.
-
-OOB command handlers must satisfy the following conditions:
-
-- It terminates quickly,
-- It does not invoke system calls that may block,
+- It terminates quickly.
+- It does not invoke system calls that may block.
 - It does not access guest RAM that may block when userfaultfd is
-  enabled for postcopy live migration,
+  enabled for postcopy live migration.
 - It takes only "fast" locks, i.e. all critical sections protected by
   any lock it takes also satisfy the conditions for OOB command
   handler code.
@@ -686,17 +674,18 @@ The restrictions on locking limit access to shared state.  Such access
 requires synchronization, but OOB commands can't take the BQL or any
 other "slow" lock.
 
-If in doubt, do not implement OOB execution support.
+When in doubt, do not implement OOB execution support.
 
-A command may use the optional 'allow-preconfig' key to permit its execution
-at early runtime configuration stage (preconfig runstate).
-If not specified then a command defaults to 'allow-preconfig': false.
+Key 'allow-preconfig' declares whether the command is available before
+the machine is built.  It defaults to false.  For example:
 
-An example of declaring a command that is enabled during preconfig:
  { 'command': 'qmp_capabilities',
    'data': { '*enable': [ 'QMPCapability' ] },
    'allow-preconfig': true }
 
+QMP is available before the machine is built only when QEMU was
+started with --preconfig.
+
 === Events ===
 
 Usage: { 'event': STRING, '*data': COMPLEX-TYPE-NAME-OR-DICT,
-- 
2.17.1

      parent reply	other threads:[~2018-07-03 15:37 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-03 15:36 [Qemu-devel] [PULL 00/32] Monitor patches for 2018-07-03 Markus Armbruster
2018-07-03 15:36 ` [Qemu-devel] [PULL 01/32] qmp: Say "out-of-band" instead of "Out-Of-Band" Markus Armbruster
2018-07-03 15:36 ` [Qemu-devel] [PULL 02/32] monitor: Spell "I/O thread" consistently in comments Markus Armbruster
2018-07-03 15:36 ` [Qemu-devel] [PULL 03/32] docs/interop/qmp: Improve OOB documentation Markus Armbruster
2018-07-03 15:37 ` [Qemu-devel] [PULL 04/32] qmp: Document COMMAND_DROPPED design flaw Markus Armbruster
2018-07-03 15:37 ` [Qemu-devel] [PULL 05/32] qmp: Get rid of x-oob-test command Markus Armbruster
2018-07-03 15:37 ` [Qemu-devel] [PULL 06/32] tests/qmp-test: Test in-band command doesn't overtake Markus Armbruster
2018-07-03 15:37 ` [Qemu-devel] [PULL 07/32] qmp: Make "id" optional again even in "oob" monitors Markus Armbruster
2018-07-03 15:37 ` [Qemu-devel] [PULL 08/32] tests/test-qga: Demonstrate the guest-agent ignores "id" Markus Armbruster
2018-07-03 15:37 ` [Qemu-devel] [PULL 09/32] qmp qemu-ga: Revert change that accidentally made qemu-ga accept "id" Markus Armbruster
2018-07-03 15:37 ` [Qemu-devel] [PULL 10/32] tests/test-qga: Demonstrate the guest-agent ignores "control" Markus Armbruster
2018-07-03 15:37 ` [Qemu-devel] [PULL 11/32] qmp qemu-ga: Fix qemu-ga not to accept "control" Markus Armbruster
2018-07-03 15:37 ` [Qemu-devel] [PULL 12/32] qmp: Redo how the client requests out-of-band execution Markus Armbruster
2018-07-03 15:37 ` [Qemu-devel] [PULL 13/32] qmp: Revert change to handle_qmp_command tracepoint Markus Armbruster
2018-07-03 15:37 ` [Qemu-devel] [PULL 14/32] qmp: Always free QMPRequest with qmp_request_free() Markus Armbruster
2018-07-03 15:37 ` [Qemu-devel] [PULL 15/32] qmp: Simplify code around monitor_qmp_dispatch_one() Markus Armbruster
2018-07-03 15:37 ` [Qemu-devel] [PULL 16/32] tests/qmp-test: Demonstrate QMP errors jumping the queue Markus Armbruster
2018-07-03 15:37 ` [Qemu-devel] [PULL 17/32] qmp: Don't let malformed in-band commands jump " Markus Armbruster
2018-07-03 15:37 ` [Qemu-devel] [PULL 18/32] qmp: Don't let JSON errors " Markus Armbruster
2018-07-03 15:37 ` [Qemu-devel] [PULL 19/32] monitor: Rename use_io_thr to use_io_thread Markus Armbruster
2018-07-03 15:37 ` [Qemu-devel] [PULL 20/32] monitor: Peel off @mon_global wrapper Markus Armbruster
2018-07-03 15:37 ` [Qemu-devel] [PULL 21/32] qobject: New qdict_from_jsonf_nofail() Markus Armbruster
2018-07-03 15:37 ` [Qemu-devel] [PULL 22/32] qmp: De-duplicate error response building Markus Armbruster
2018-07-03 15:37 ` [Qemu-devel] [PULL 23/32] qmp: Use QDict * instead of QObject * for response objects Markus Armbruster
2018-07-03 15:37 ` [Qemu-devel] [PULL 24/32] qmp: Replace monitor_json_emitter{, raw}() by qmp_{queue, send}_response() Markus Armbruster
2018-07-03 15:37 ` [Qemu-devel] [PULL 25/32] qmp: Replace get_qmp_greeting() by qmp_greeting() Markus Armbruster
2018-07-03 15:37 ` [Qemu-devel] [PULL 26/32] qmp: Simplify monitor_qmp_respond() Markus Armbruster
2018-07-03 15:37 ` [Qemu-devel] [PULL 27/32] qmp: Add some comments around null responses Markus Armbruster
2018-07-03 15:37 ` [Qemu-devel] [PULL 28/32] qmp: Switch timestamp_put() to qdict_from_jsonf_nofail() Markus Armbruster
2018-07-03 15:37 ` [Qemu-devel] [PULL 29/32] qobject: Let qobject_from_jsonf() fail instead of abort Markus Armbruster
2018-07-03 15:37 ` [Qemu-devel] [PULL 30/32] qmp: Clean up capability negotiation after commit 02130314d8c Markus Armbruster
2018-07-03 15:37 ` [Qemu-devel] [PULL 31/32] monitor: Improve some comments Markus Armbruster
2018-07-03 15:37 ` Markus Armbruster [this message]

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=20180703153728.2175-33-armbru@redhat.com \
    --to=armbru@redhat.com \
    --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).