diff mbox series

qmp: Add examples to qom list, get, and set commands

Message ID 20181228194442.3506-1-wainersm@redhat.com (mailing list archive)
State New, archived
Headers show
Series qmp: Add examples to qom list, get, and set commands | expand

Commit Message

Wainer dos Santos Moschetta Dec. 28, 2018, 7:44 p.m. UTC
Added examples for the qom-list, qom-get, and qom-set
commands in qapi misc JSON file.

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
---
 qapi/misc.json | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

Comments

Markus Armbruster Jan. 7, 2019, 3:53 p.m. UTC | #1
Wainer dos Santos Moschetta <wainersm@redhat.com> writes:

> Added examples for the qom-list, qom-get, and qom-set
> commands in qapi misc JSON file.
>
> Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>

Reviewed-by: Markus Armbruster <armbru@redhat.com>
Markus Armbruster Jan. 8, 2019, 6:38 p.m. UTC | #2
Wainer dos Santos Moschetta <wainersm@redhat.com> writes:

> Added examples for the qom-list, qom-get, and qom-set
> commands in qapi misc JSON file.
>
> Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>

Queued, thanks!
diff mbox series

Patch

diff --git a/qapi/misc.json b/qapi/misc.json
index 24d20a880a..426274ecf8 100644
--- a/qapi/misc.json
+++ b/qapi/misc.json
@@ -1380,6 +1380,16 @@ 
 #          object.
 #
 # Since: 1.2
+#
+# Example:
+#
+# -> { "execute": "qom-list",
+#      "arguments": { "path": "/chardevs" } }
+# <- { "return": [ { "name": "type", "type": "string" },
+#                  { "name": "parallel0", "type": "child<chardev-vc>" },
+#                  { "name": "serial0", "type": "child<chardev-vc>" },
+#                  { "name": "mon0", "type": "child<chardev-stdio>" } ] }
+#
 ##
 { 'command': 'qom-list',
   'data': { 'path': 'str' },
@@ -1417,6 +1427,23 @@ 
 #          returned as #int.
 #
 # Since: 1.2
+#
+# Example:
+#
+# 1. Use absolute path
+#
+# -> { "execute": "qom-get",
+#      "arguments": { "path": "/machine/unattached/device[0]",
+#                     "property": "hotplugged" } }
+# <- { "return": false }
+#
+# 2. Use partial path
+#
+# -> { "execute": "qom-get",
+#      "arguments": { "path": "unattached/sysbus",
+#                     "property": "type" } }
+# <- { "return": "System" }
+#
 ##
 { 'command': 'qom-get',
   'data': { 'path': 'str', 'property': 'str' },
@@ -1436,6 +1463,15 @@ 
 #         for a description of type mapping.
 #
 # Since: 1.2
+#
+# Example:
+#
+# -> { "execute": "qom-set",
+#      "arguments": { "path": "/machine",
+#                     "property": "graphics",
+#                     "value": false } }
+# <- { "return": {} }
+#
 ##
 { 'command': 'qom-set',
   'data': { 'path': 'str', 'property': 'str', 'value': 'any' },