qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: qemu-devel@nongnu.org
Cc: armbru@redhat.com
Subject: [Qemu-devel] [PATCH 5/5] qapi: Fix QMP spec references to JSON
Date: Wed, 25 Mar 2015 18:13:57 -0600	[thread overview]
Message-ID: <1427328837-4406-6-git-send-email-eblake@redhat.com> (raw)
In-Reply-To: <1427328837-4406-1-git-send-email-eblake@redhat.com>

I had assumed that 'id' of a command/return transaction could only
be an integer, and therefore that 'json-value' meant integer, so
I invented the term 'json-entity' to express a choice between
json-object, json-string, and json-array.  But in reality, the JSON
RFC defines json-value as the combination of all other types, and
the QMP parser currently accepts any JSON value that does not
include a literal JSON null.  So, clean up the docs to be consistent
with the RFC.  And while at it, use the newer version of the RFC.

Signed-off-by: Eric Blake <eblake@redhat.com>
---
 docs/qmp/qmp-spec.txt | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/docs/qmp/qmp-spec.txt b/docs/qmp/qmp-spec.txt
index 1fb642b..f7d8c30 100644
--- a/docs/qmp/qmp-spec.txt
+++ b/docs/qmp/qmp-spec.txt
@@ -28,10 +28,10 @@ following format:

     json-DATA-STRUCTURE-NAME

-Where DATA-STRUCTURE-NAME is any valid JSON data structure, as defined by
-the JSON standard:
+Where DATA-STRUCTURE-NAME is any valid JSON data structure except the
+'null' literal, as defined by the JSON standard:

-http://www.ietf.org/rfc/rfc4627.txt
+http://www.ietf.org/rfc/rfc7159.txt

 For convenience, json-object members mentioned in this document will
 be in a certain order. However, in real protocol usage they can be in
@@ -92,7 +92,9 @@ The format for command execution is:
   execution of the command, it is optional when no arguments are required
 - The "id" member is a transaction identification associated with the
   command execution, it is optional and will be part of the response if
-  provided
+  provided. The "id" member can be any json-value that does not use a
+  json-null; however, most clients use a json-number incremented for
+  each successive command

 2.4 Commands Responses
 ----------------------
@@ -105,13 +107,13 @@ of a command execution: success or error.

 The format of a success response is:

-{ "return": json-entity, "id": json-value }
+{ "return": json-value, "id": json-value }

  Where,

 - The "return" member contains the data returned by the command, which
   is defined on a per-command basis (usually a json-object or
-  json-array of json-objects, but sometimes a json-value, json-string,
+  json-array of json-objects, but sometimes a json-number, json-string,
   or json-array of json-strings); it is an empty json-object if the
   command does not return data
 - The "id" member contains the transaction identification associated
-- 
2.1.0

  parent reply	other threads:[~2015-03-26  0:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-26  0:13 [Qemu-devel] [PATCH 0/5] qapi doc cleanups Eric Blake
2015-03-26  0:13 ` [Qemu-devel] [PATCH 1/5] qapi: Minor tweaks to qapi-code-gen.txt Eric Blake
2015-03-26  0:13 ` [Qemu-devel] [PATCH 2/5] qapi: Clean up documentation of alternate mappings Eric Blake
2015-03-27 11:02   ` Markus Armbruster
2015-03-30 15:54     ` Eric Blake
2015-03-26  0:13 ` [Qemu-devel] [PATCH 3/5] qapi: Make placeholders more obvious in doc usage statements Eric Blake
2015-03-26  0:13 ` [Qemu-devel] [PATCH 4/5] qapi: Tweak doc references to QMP when QGA is also meant Eric Blake
2015-03-26  0:13 ` Eric Blake [this message]
2015-03-27 11:05 ` [Qemu-devel] [PATCH 0/5] qapi doc cleanups Markus Armbruster
2015-05-08 14:29 ` Markus Armbruster
2015-05-08 14:41   ` Eric Blake

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=1427328837-4406-6-git-send-email-eblake@redhat.com \
    --to=eblake@redhat.com \
    --cc=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).