qapi: Tidy up examples

A few examples neglect to prefix QMP input with '->'.  Fix that.

Two examples have extra space after '<-'.  Delete it.

A few examples neglect to show output.  Provide some.  The example
output for query-vcpu-dirty-limit could use further improvement.  Add
a TODO comment.

Use "Examples:" instead of "Example:" where multiple examples are
given.

One example section numbers its two examples.  Not done elsewhere;
drop.

Another example section separates them with "or".  Likewise.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20230425064223.820979-8-armbru@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
This commit is contained in:
Markus Armbruster 2023-04-25 08:42:14 +02:00
parent f1a787b5f4
commit 37fa48a4cb
12 changed files with 47 additions and 38 deletions

View File

@ -4574,9 +4574,8 @@
# #
# Since: 2.9 # Since: 2.9
# #
# Example: # Examples:
# #
# 1.
# -> { "execute": "blockdev-add", # -> { "execute": "blockdev-add",
# "arguments": { # "arguments": {
# "driver": "qcow2", # "driver": "qcow2",
@ -4589,7 +4588,6 @@
# } # }
# <- { "return": {} } # <- { "return": {} }
# #
# 2.
# -> { "execute": "blockdev-add", # -> { "execute": "blockdev-add",
# "arguments": { # "arguments": {
# "driver": "qcow2", # "driver": "qcow2",
@ -5596,7 +5594,7 @@
# #
# Since: 2.7 # Since: 2.7
# #
# Example: # Examples:
# #
# 1. Add a new node to a quorum # 1. Add a new node to a quorum
# -> { "execute": "blockdev-add", # -> { "execute": "blockdev-add",
@ -5646,7 +5644,7 @@
# #
# Since: 2.12 # Since: 2.12
# #
# Example: # Examples:
# #
# 1. Move a node into an IOThread # 1. Move a node into an IOThread
# -> { "execute": "x-blockdev-set-iothread", # -> { "execute": "x-blockdev-set-iothread",
@ -5731,18 +5729,18 @@
# #
# Since: 2.0 # Since: 2.0
# #
# Example: # Examples:
# #
# 1. Read operation # 1. Read operation
# #
# { "event": "QUORUM_REPORT_BAD", # <- { "event": "QUORUM_REPORT_BAD",
# "data": { "node-name": "node0", "sector-num": 345435, "sectors-count": 5, # "data": { "node-name": "node0", "sector-num": 345435, "sectors-count": 5,
# "type": "read" }, # "type": "read" },
# "timestamp": { "seconds": 1344522075, "microseconds": 745528 } } # "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
# #
# 2. Flush operation # 2. Flush operation
# #
# { "event": "QUORUM_REPORT_BAD", # <- { "event": "QUORUM_REPORT_BAD",
# "data": { "node-name": "node0", "sector-num": 0, "sectors-count": 2097120, # "data": { "node-name": "node0", "sector-num": 0, "sectors-count": 2097120,
# "type": "flush", "error": "Broken pipe" }, # "type": "flush", "error": "Broken pipe" },
# "timestamp": { "seconds": 1456406829, "microseconds": 291763 } } # "timestamp": { "seconds": 1456406829, "microseconds": 291763 } }

View File

@ -457,7 +457,7 @@
# #
# Since: 1.1 # Since: 1.1
# #
# Example: # Examples:
# #
# -> { "execute": "block_set_io_throttle", # -> { "execute": "block_set_io_throttle",
# "arguments": { "id": "virtio-blk-pci0/virtio-backend", # "arguments": { "id": "virtio-blk-pci0/virtio-backend",

View File

@ -637,7 +637,7 @@
# #
# Since: 1.4 # Since: 1.4
# #
# Example: # Examples:
# #
# -> { "execute" : "chardev-add", # -> { "execute" : "chardev-add",
# "arguments" : { "id" : "foo", # "arguments" : { "id" : "foo",
@ -673,7 +673,7 @@
# #
# Since: 2.10 # Since: 2.10
# #
# Example: # Examples:
# #
# -> { "execute" : "chardev-change", # -> { "execute" : "chardev-change",
# "arguments" : { "id" : "baz", # "arguments" : { "id" : "baz",

View File

@ -954,7 +954,7 @@
# #
# Since: 2.7 # Since: 2.7
# #
# Example: # Examples:
# #
# For pseries machine type started with -smp 2,cores=2,maxcpus=4 -cpu POWER8: # For pseries machine type started with -smp 2,cores=2,maxcpus=4 -cpu POWER8:
# #
@ -1677,8 +1677,9 @@
# Since: 7.2 # Since: 7.2
# #
# Example: # Example:
# {"execute": "dumpdtb"} # -> { "execute": "dumpdtb" }
# "arguments": { "filename": "fdt.dtb" } } # "arguments": { "filename": "fdt.dtb" } }
# <- { "return": {} }
# #
## ##
{ 'command': 'dumpdtb', { 'command': 'dumpdtb',

View File

@ -273,7 +273,7 @@
# #
# Since: 0.14 # Since: 0.14
# #
# Example: # Examples:
# #
# 1. Before the first migration # 1. Before the first migration
# #
@ -521,6 +521,7 @@
# #
# -> { "execute": "migrate-set-capabilities" , "arguments": # -> { "execute": "migrate-set-capabilities" , "arguments":
# { "capabilities": [ { "capability": "xbzrle", "state": true } ] } } # { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
# <- { "return": {} }
# #
## ##
{ 'command': 'migrate-set-capabilities', { 'command': 'migrate-set-capabilities',
@ -989,6 +990,7 @@
# #
# -> { "execute": "migrate-set-parameters" , # -> { "execute": "migrate-set-parameters" ,
# "arguments": { "compress-level": 1 } } # "arguments": { "compress-level": 1 } }
# <- { "return": {} }
# #
## ##
{ 'command': 'migrate-set-parameters', 'boxed': true, { 'command': 'migrate-set-parameters', 'boxed': true,
@ -1251,8 +1253,8 @@
# #
# Example: # Example:
# #
# { "timestamp": {"seconds": 1449669631, "microseconds": 239225}, # <- { "timestamp": {"seconds": 1449669631, "microseconds": 239225},
# "event": "MIGRATION_PASS", "data": {"pass": 2} } # "event": "MIGRATION_PASS", "data": {"pass": 2} }
# #
## ##
{ 'event': 'MIGRATION_PASS', { 'event': 'MIGRATION_PASS',
@ -1833,8 +1835,9 @@
# #
# Example: # Example:
# #
# {"execute": "calc-dirty-rate", "arguments": {"calc-time": 1, # -> {"execute": "calc-dirty-rate", "arguments": {"calc-time": 1,
# 'sample-pages': 512} } # 'sample-pages': 512} }
# <- { "return": {} }
# #
## ##
{ 'command': 'calc-dirty-rate', 'data': {'calc-time': 'int64', { 'command': 'calc-dirty-rate', 'data': {'calc-time': 'int64',
@ -1886,9 +1889,11 @@
# Since: 7.1 # Since: 7.1
# #
# Example: # Example:
# {"execute": "set-vcpu-dirty-limit"} #
# "arguments": { "dirty-rate": 200, # -> {"execute": "set-vcpu-dirty-limit"}
# "cpu-index": 1 } } # "arguments": { "dirty-rate": 200,
# "cpu-index": 1 } }
# <- { "return": {} }
# #
## ##
{ 'command': 'set-vcpu-dirty-limit', { 'command': 'set-vcpu-dirty-limit',
@ -1909,8 +1914,10 @@
# Since: 7.1 # Since: 7.1
# #
# Example: # Example:
# {"execute": "cancel-vcpu-dirty-limit"} #
# "arguments": { "cpu-index": 1 } } # -> {"execute": "cancel-vcpu-dirty-limit"},
# "arguments": { "cpu-index": 1 } }
# <- { "return": {} }
# #
## ##
{ 'command': 'cancel-vcpu-dirty-limit', { 'command': 'cancel-vcpu-dirty-limit',
@ -1924,7 +1931,11 @@
# Since: 7.1 # Since: 7.1
# #
# Example: # Example:
# {"execute": "query-vcpu-dirty-limit"} #
# -> {"execute": "query-vcpu-dirty-limit"}
# <- {"return": [
# { "limit-rate": 60, "current-rate": 3, "cpu-index": 0},
# { "limit-rate": 60, "current-rate": 3, "cpu-index": 1}]}
# #
## ##
{ 'command': 'query-vcpu-dirty-limit', { 'command': 'query-vcpu-dirty-limit',

View File

@ -580,10 +580,9 @@
# #
# Example: # Example:
# #
# <- { "event": "RTC_CHANGE", # <- { "event": "RTC_CHANGE",
# "data": { "offset": 78 }, # "data": { "offset": 78 },
# "timestamp": { "seconds": 1267020223, "microseconds": 435656 } } # "timestamp": { "seconds": 1267020223, "microseconds": 435656 } }
#
## ##
{ 'event': 'RTC_CHANGE', { 'event': 'RTC_CHANGE',
'data': { 'offset': 'int', 'qom-path': 'str' } } 'data': { 'offset': 'int', 'qom-path': 'str' } }

View File

@ -914,7 +914,7 @@
# #
# Since: 7.2 # Since: 7.2
# #
# Example: # Examples:
# #
# <- { "event": "NETDEV_STREAM_CONNECTED", # <- { "event": "NETDEV_STREAM_CONNECTED",
# "data": { "netdev-id": "netdev0", # "data": { "netdev-id": "netdev0",
@ -922,8 +922,6 @@
# "host": "::1", "type": "inet" } }, # "host": "::1", "type": "inet" } },
# "timestamp": { "seconds": 1666269863, "microseconds": 311222 } } # "timestamp": { "seconds": 1666269863, "microseconds": 311222 } }
# #
# or
#
# <- { "event": "NETDEV_STREAM_CONNECTED", # <- { "event": "NETDEV_STREAM_CONNECTED",
# "data": { "netdev-id": "netdev0", # "data": { "netdev-id": "netdev0",
# "addr": { "path": "/tmp/qemu0", "type": "unix" } }, # "addr": { "path": "/tmp/qemu0", "type": "unix" } },

View File

@ -100,7 +100,7 @@
# #
# Since: 0.14 # Since: 0.14
# #
# Example: # Examples:
# #
# -> { "execute": "device_del", # -> { "execute": "device_del",
# "arguments": { "id": "net1" } } # "arguments": { "id": "net1" } }

View File

@ -103,7 +103,7 @@
# #
# Since: 1.2 # Since: 1.2
# #
# Example: # Examples:
# #
# 1. Use absolute path # 1. Use absolute path
# #

View File

@ -81,6 +81,7 @@
# Example: # Example:
# #
# -> { "execute": "replay-break", "arguments": { "icount": 220414 } } # -> { "execute": "replay-break", "arguments": { "icount": 220414 } }
# <- { "return": {} }
# #
## ##
{ 'command': 'replay-break', 'data': { 'icount': 'int' } } { 'command': 'replay-break', 'data': { 'icount': 'int' } }
@ -96,6 +97,7 @@
# Example: # Example:
# #
# -> { "execute": "replay-delete-break" } # -> { "execute": "replay-delete-break" }
# <- { "return": {} }
# #
## ##
{ 'command': 'replay-delete-break' } { 'command': 'replay-delete-break' }
@ -117,5 +119,6 @@
# Example: # Example:
# #
# -> { "execute": "replay-seek", "arguments": { "icount": 220414 } } # -> { "execute": "replay-seek", "arguments": { "icount": 220414 } }
# <- { "return": {} }
## ##
{ 'command': 'replay-seek', 'data': { 'icount': 'int' } } { 'command': 'replay-seek', 'data': { 'icount': 'int' } }

View File

@ -258,9 +258,8 @@
# #
# Example: # Example:
# #
# <- { "event": "SUSPEND_DISK", # <- { "event": "SUSPEND_DISK",
# "timestamp": { "seconds": 1344456160, "microseconds": 309119 } } # "timestamp": { "seconds": 1344456160, "microseconds": 309119 } }
#
## ##
{ 'event': 'SUSPEND_DISK' } { 'event': 'SUSPEND_DISK' }

View File

@ -1153,7 +1153,7 @@
# so it is possible to map which console belongs to which device and # so it is possible to map which console belongs to which device and
# display. # display.
# #
# Example: # Examples:
# #
# 1. Press left mouse button. # 1. Press left mouse button.
# #