All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cleber Rosa <crosa@redhat.com>
To: Eric Blake <eblake@redhat.com>, Markus Armbruster <armbru@redhat.com>
Cc: qemu-devel@nongnu.org, Cleber Rosa <crosa@redhat.com>
Subject: [Qemu-devel] [PATCH 1/1] QAPI schema: turn example commands/returns into proper JSON
Date: Tue,  8 Aug 2017 16:53:27 -0400	[thread overview]
Message-ID: <20170808205327.8768-2-crosa@redhat.com> (raw)
In-Reply-To: <20170808205327.8768-1-crosa@redhat.com>

Most QMP commands and returns in the QAPI schema documentation
are valid "JSON-based wire format".  A few examples are either
malformed, or contain comments.

This fixes all the examples command and return data, making them
proper JSON, as they would be received and generated by QEMU's
QMP monitor.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
---
 qapi-schema.json     |  9 ++++-----
 qapi/block-core.json | 32 ++++++++++++++++----------------
 qapi/rocker.json     |  5 +----
 3 files changed, 21 insertions(+), 25 deletions(-)

diff --git a/qapi-schema.json b/qapi-schema.json
index 802ea53d00..78c1e8cbde 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -2000,8 +2000,7 @@
 #                "host": "127.0.0.1",
 #                "channel-id": 0,
 #                "tls": false
-#             },
-#             [ ... more channels follow ... ]
+#             }
 #          ]
 #       }
 #    }
@@ -2039,7 +2038,7 @@
 #
 # -> { "execute": "query-balloon" }
 # <- { "return": {
-#          "actual": 1073741824,
+#          "actual": 1073741824
 #       }
 #    }
 #
@@ -3536,7 +3535,7 @@
 #
 # -> { "execute": "query-dump-guest-memory-capability" }
 # <- { "return": { "formats":
-#                  ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
+#                  ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] } }
 #
 ##
 { 'command': 'query-dump-guest-memory-capability',
@@ -6500,7 +6499,7 @@
 #        "vcpus-count": 1 },
 #      { "props": { "core": 0 }, "type": "POWER8-spapr-cpu-core",
 #        "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
-#    ]}'
+#    ]}
 #
 # For pc machine type started with -smp 1,maxcpus=2:
 #
diff --git a/qapi/block-core.json b/qapi/block-core.json
index 833c602150..ab273a4729 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -801,10 +801,10 @@
 #                   "wr_bytes":9786368,
 #                   "wr_operations":751,
 #                   "rd_bytes":122567168,
-#                   "rd_operations":36772
-#                   "wr_total_times_ns":313253456
-#                   "rd_total_times_ns":3465673657
-#                   "flush_total_times_ns":49653
+#                   "rd_operations":36772,
+#                   "wr_total_times_ns":313253456,
+#                   "rd_total_times_ns":3465673657,
+#                   "flush_total_times_ns":49653,
 #                   "flush_operations":61,
 #                   "rd_merged":0,
 #                   "wr_merged":0,
@@ -818,10 +818,10 @@
 #                "wr_bytes":9786368,
 #                "wr_operations":692,
 #                "rd_bytes":122739200,
-#                "rd_operations":36604
+#                "rd_operations":36604,
 #                "flush_operations":51,
-#                "wr_total_times_ns":313253456
-#                "rd_total_times_ns":3465673657
+#                "wr_total_times_ns":313253456,
+#                "rd_total_times_ns":3465673657,
 #                "flush_total_times_ns":49653,
 #                "rd_merged":0,
 #                "wr_merged":0,
@@ -837,10 +837,10 @@
 #                "wr_bytes":0,
 #                "wr_operations":0,
 #                "rd_bytes":0,
-#                "rd_operations":0
+#                "rd_operations":0,
 #                "flush_operations":0,
-#                "wr_total_times_ns":0
-#                "rd_total_times_ns":0
+#                "wr_total_times_ns":0,
+#                "rd_total_times_ns":0,
 #                "flush_total_times_ns":0,
 #                "rd_merged":0,
 #                "wr_merged":0,
@@ -855,10 +855,10 @@
 #                "wr_bytes":0,
 #                "wr_operations":0,
 #                "rd_bytes":0,
-#                "rd_operations":0
+#                "rd_operations":0,
 #                "flush_operations":0,
-#                "wr_total_times_ns":0
-#                "rd_total_times_ns":0
+#                "wr_total_times_ns":0,
+#                "rd_total_times_ns":0,
 #                "flush_total_times_ns":0,
 #                "rd_merged":0,
 #                "wr_merged":0,
@@ -873,10 +873,10 @@
 #                "wr_bytes":0,
 #                "wr_operations":0,
 #                "rd_bytes":0,
-#                "rd_operations":0
+#                "rd_operations":0,
 #                "flush_operations":0,
-#                "wr_total_times_ns":0
-#                "rd_total_times_ns":0
+#                "wr_total_times_ns":0,
+#                "rd_total_times_ns":0,
 #                "flush_total_times_ns":0,
 #                "rd_merged":0,
 #                "wr_merged":0,
diff --git a/qapi/rocker.json b/qapi/rocker.json
index 3587661161..345863b600 100644
--- a/qapi/rocker.json
+++ b/qapi/rocker.json
@@ -249,10 +249,7 @@
 #                   "hits": 138,
 #                   "cookie": 0,
 #                   "action": {"goto-tbl": 10},
-#                   "mask": {"in-pport": 4294901760}
-#                  },
-#                  {...more...},
-#    ]}
+#                   "mask": {"in-pport": 4294901760} } ] }
 #
 ##
 { 'command': 'query-rocker-of-dpa-flows',
-- 
2.13.4

  reply	other threads:[~2017-08-08 21:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-08 20:53 [Qemu-devel] [PATCH 0/1] QAPI schema: turn example commands/returns into proper JSON Cleber Rosa
2017-08-08 20:53 ` Cleber Rosa [this message]
2017-08-08 21:13   ` [Qemu-devel] [PATCH 1/1] " Eric Blake
2017-08-08 21:26     ` Cleber Rosa
2017-08-14 15:31       ` Markus Armbruster

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=20170808205327.8768-2-crosa@redhat.com \
    --to=crosa@redhat.com \
    --cc=armbru@redhat.com \
    --cc=eblake@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.