qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/9] Fix some qapi examples
@ 2022-03-31 19:06 Victor Toso
  2022-03-31 19:06 ` [PATCH v1 1/9] qapi: fix example of netdev_add command Victor Toso
                   ` (10 more replies)
  0 siblings, 11 replies; 26+ messages in thread
From: Victor Toso @ 2022-03-31 19:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: John Snow, Eric Blake, Markus Armbruster

Hi,

I did another iteration of adding the examples in the qapi documentation
as unit tests in another project and found a few that could be updated.

Feel free to cherry-pick them. Happy to rework it if needed.

Victor Toso (9):
  qapi: fix example of netdev_add command
  qapi: fix examples: replay-break and replay-seek
  qapi: fix example of query-named-block-nodes command
  qapi: fix example of query-spice command
  qapi: fix example of query-vnc command
  qapi: fix example of query-colo-status command
  qapi: fix example of trace-event-get-state command
  qapi: fix example of query-cpus-fast command
  qapi: fix example of query-memdev command

 qapi/block-core.json | 1 +
 qapi/machine.json    | 4 ++--
 qapi/migration.json  | 2 +-
 qapi/net.json        | 2 +-
 qapi/replay.json     | 4 ++--
 qapi/trace.json      | 2 +-
 qapi/ui.json         | 3 +++
 7 files changed, 11 insertions(+), 7 deletions(-)

-- 
2.35.1



^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PATCH v1 1/9] qapi: fix example of netdev_add command
  2022-03-31 19:06 [PATCH v1 0/9] Fix some qapi examples Victor Toso
@ 2022-03-31 19:06 ` Victor Toso
  2022-04-01  7:56   ` Markus Armbruster
  2022-04-01 11:07   ` [PATCH v1.1 " Victor Toso
  2022-03-31 19:06 ` [PATCH v1 2/9] qapi: fix examples: replay-break and replay-seek Victor Toso
                   ` (9 subsequent siblings)
  10 siblings, 2 replies; 26+ messages in thread
From: Victor Toso @ 2022-03-31 19:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: John Snow, Eric Blake, Markus Armbruster

Example output has the optional member @dnssearch as string type. It
should be an array of strings instead. Fix it.

For reference, see NetdevUserOptions.

Signed-off-by: Victor Toso <victortoso@redhat.com>
---
 qapi/net.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qapi/net.json b/qapi/net.json
index 0d4578bd07..efc0bae170 100644
--- a/qapi/net.json
+++ b/qapi/net.json
@@ -51,7 +51,7 @@
 #
 # -> { "execute": "netdev_add",
 #      "arguments": { "type": "user", "id": "netdev1",
-#                     "dnssearch": "example.org" } }
+#                     "dnssearch": [ "example.org" ] } }
 # <- { "return": {} }
 #
 ##
-- 
2.35.1



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v1 2/9] qapi: fix examples: replay-break and replay-seek
  2022-03-31 19:06 [PATCH v1 0/9] Fix some qapi examples Victor Toso
  2022-03-31 19:06 ` [PATCH v1 1/9] qapi: fix example of netdev_add command Victor Toso
@ 2022-03-31 19:06 ` Victor Toso
  2022-04-01  8:01   ` Markus Armbruster
  2022-03-31 19:06 ` [PATCH v1 3/9] qapi: fix example of query-named-block-nodes command Victor Toso
                   ` (8 subsequent siblings)
  10 siblings, 1 reply; 26+ messages in thread
From: Victor Toso @ 2022-03-31 19:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: John Snow, Eric Blake, Markus Armbruster

Both examples outputs are using @data member for the arguments. This
is wrong. The expected member for the QMP is @arguments. Fix it.

Signed-off-by: Victor Toso <victortoso@redhat.com>
---
 qapi/replay.json | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/qapi/replay.json b/qapi/replay.json
index b4d1ba253b..351898f60d 100644
--- a/qapi/replay.json
+++ b/qapi/replay.json
@@ -81,7 +81,7 @@
 #
 # Example:
 #
-# -> { "execute": "replay-break", "data": { "icount": 220414 } }
+# -> { "execute": "replay-break", "arguments": { "icount": 220414 } }
 #
 ##
 { 'command': 'replay-break', 'data': { 'icount': 'int' } }
@@ -117,6 +117,6 @@
 #
 # Example:
 #
-# -> { "execute": "replay-seek", "data": { "icount": 220414 } }
+# -> { "execute": "replay-seek", "arguments": { "icount": 220414 } }
 ##
 { 'command': 'replay-seek', 'data': { 'icount': 'int' } }
-- 
2.35.1



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v1 3/9] qapi: fix example of query-named-block-nodes command
  2022-03-31 19:06 [PATCH v1 0/9] Fix some qapi examples Victor Toso
  2022-03-31 19:06 ` [PATCH v1 1/9] qapi: fix example of netdev_add command Victor Toso
  2022-03-31 19:06 ` [PATCH v1 2/9] qapi: fix examples: replay-break and replay-seek Victor Toso
@ 2022-03-31 19:06 ` Victor Toso
  2022-04-01  8:02   ` Markus Armbruster
  2022-03-31 19:06 ` [PATCH v1 4/9] qapi: fix example of query-spice command Victor Toso
                   ` (7 subsequent siblings)
  10 siblings, 1 reply; 26+ messages in thread
From: Victor Toso @ 2022-03-31 19:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: John Snow, Eric Blake, Markus Armbruster

Example output is missing mandatory member @detect_zeroes. Fix it.

Signed-off-by: Victor Toso <victortoso@redhat.com>
---
 qapi/block-core.json | 1 +
 1 file changed, 1 insertion(+)

diff --git a/qapi/block-core.json b/qapi/block-core.json
index 4a7a6940a3..beeb91952a 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -1776,6 +1776,7 @@
 #                    "file":"disks/test.qcow2",
 #                    "node-name": "my-node",
 #                    "backing_file_depth":1,
+#                    "detect_zeroes":"off",
 #                    "bps":1000000,
 #                    "bps_rd":0,
 #                    "bps_wr":0,
-- 
2.35.1



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v1 4/9] qapi: fix example of query-spice command
  2022-03-31 19:06 [PATCH v1 0/9] Fix some qapi examples Victor Toso
                   ` (2 preceding siblings ...)
  2022-03-31 19:06 ` [PATCH v1 3/9] qapi: fix example of query-named-block-nodes command Victor Toso
@ 2022-03-31 19:06 ` Victor Toso
  2022-04-01  8:03   ` Markus Armbruster
  2022-03-31 19:06 ` [PATCH v1 5/9] qapi: fix example of query-vnc command Victor Toso
                   ` (6 subsequent siblings)
  10 siblings, 1 reply; 26+ messages in thread
From: Victor Toso @ 2022-03-31 19:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: John Snow, Eric Blake, Markus Armbruster

Example output is missing mandatory members @migrated and @mouse-mode.
Fix it.

Signed-off-by: Victor Toso <victortoso@redhat.com>
---
 qapi/ui.json | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/qapi/ui.json b/qapi/ui.json
index a810ed680c..c039b8b3cb 100644
--- a/qapi/ui.json
+++ b/qapi/ui.json
@@ -324,8 +324,10 @@
 #          "enabled": true,
 #          "auth": "spice",
 #          "port": 5920,
+#          "migrated":false,
 #          "tls-port": 5921,
 #          "host": "0.0.0.0",
+#          "mouse-mode":"client",
 #          "channels": [
 #             {
 #                "port": "54924",
-- 
2.35.1



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v1 5/9] qapi: fix example of query-vnc command
  2022-03-31 19:06 [PATCH v1 0/9] Fix some qapi examples Victor Toso
                   ` (3 preceding siblings ...)
  2022-03-31 19:06 ` [PATCH v1 4/9] qapi: fix example of query-spice command Victor Toso
@ 2022-03-31 19:06 ` Victor Toso
  2022-04-01  8:03   ` Markus Armbruster
  2022-03-31 19:06 ` [PATCH v1 6/9] qapi: fix example of query-colo-status command Victor Toso
                   ` (5 subsequent siblings)
  10 siblings, 1 reply; 26+ messages in thread
From: Victor Toso @ 2022-03-31 19:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: John Snow, Eric Blake, Markus Armbruster

The return value is missing the mandatory member @websocket. Fix it.

Signed-off-by: Victor Toso <victortoso@redhat.com>
---
 qapi/ui.json | 1 +
 1 file changed, 1 insertion(+)

diff --git a/qapi/ui.json b/qapi/ui.json
index c039b8b3cb..13a8bb82aa 100644
--- a/qapi/ui.json
+++ b/qapi/ui.json
@@ -658,6 +658,7 @@
 #                "host":"127.0.0.1",
 #                "service":"50401",
 #                "family":"ipv4"
+#                "websocket":false,
 #             }
 #          ]
 #       }
-- 
2.35.1



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v1 6/9] qapi: fix example of query-colo-status command
  2022-03-31 19:06 [PATCH v1 0/9] Fix some qapi examples Victor Toso
                   ` (4 preceding siblings ...)
  2022-03-31 19:06 ` [PATCH v1 5/9] qapi: fix example of query-vnc command Victor Toso
@ 2022-03-31 19:06 ` Victor Toso
  2022-04-01  8:04   ` Markus Armbruster
  2022-03-31 19:06 ` [PATCH v1 7/9] qapi: fix example of trace-event-get-state command Victor Toso
                   ` (4 subsequent siblings)
  10 siblings, 1 reply; 26+ messages in thread
From: Victor Toso @ 2022-03-31 19:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: John Snow, Eric Blake, Markus Armbruster

The example output is missing the mandatory member @last-mode in the
return value. Fix it.

Signed-off-by: Victor Toso <victortoso@redhat.com>
---
 qapi/migration.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qapi/migration.json b/qapi/migration.json
index 092a63354b..f74777608a 100644
--- a/qapi/migration.json
+++ b/qapi/migration.json
@@ -1679,7 +1679,7 @@
 # Example:
 #
 # -> { "execute": "query-colo-status" }
-# <- { "return": { "mode": "primary", "reason": "request" } }
+# <- { "return": { "mode": "primary", "last-mode": "none", "reason": "request" } }
 #
 # Since: 3.1
 ##
-- 
2.35.1



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v1 7/9] qapi: fix example of trace-event-get-state command
  2022-03-31 19:06 [PATCH v1 0/9] Fix some qapi examples Victor Toso
                   ` (5 preceding siblings ...)
  2022-03-31 19:06 ` [PATCH v1 6/9] qapi: fix example of query-colo-status command Victor Toso
@ 2022-03-31 19:06 ` Victor Toso
  2022-04-01  8:07   ` Markus Armbruster
  2022-03-31 19:06 ` [PATCH v1 8/9] qapi: fix example of query-cpus-fast command Victor Toso
                   ` (3 subsequent siblings)
  10 siblings, 1 reply; 26+ messages in thread
From: Victor Toso @ 2022-03-31 19:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: John Snow, Eric Blake, Markus Armbruster

The example output is missing the mandatory member @vcpu. Fix it.

Signed-off-by: Victor Toso <victortoso@redhat.com>
---
 qapi/trace.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qapi/trace.json b/qapi/trace.json
index 119509f565..6c6982a587 100644
--- a/qapi/trace.json
+++ b/qapi/trace.json
@@ -69,7 +69,7 @@
 #
 # -> { "execute": "trace-event-get-state",
 #      "arguments": { "name": "qemu_memalign" } }
-# <- { "return": [ { "name": "qemu_memalign", "state": "disabled" } ] }
+# <- { "return": [ { "name": "qemu_memalign", "state": "disabled", "vcpu": false } ] }
 #
 ##
 { 'command': 'trace-event-get-state',
-- 
2.35.1



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v1 8/9] qapi: fix example of query-cpus-fast command
  2022-03-31 19:06 [PATCH v1 0/9] Fix some qapi examples Victor Toso
                   ` (6 preceding siblings ...)
  2022-03-31 19:06 ` [PATCH v1 7/9] qapi: fix example of trace-event-get-state command Victor Toso
@ 2022-03-31 19:06 ` Victor Toso
  2022-04-01  8:08   ` Markus Armbruster
  2022-03-31 19:06 ` [PATCH v1 9/9] qapi: fix example of query-memdev command Victor Toso
                   ` (2 subsequent siblings)
  10 siblings, 1 reply; 26+ messages in thread
From: Victor Toso @ 2022-03-31 19:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: John Snow, Eric Blake, Markus Armbruster

Example output contains member @arch that was removed in 445a5b4087
"machine: remove 'arch' field from 'query-cpus-fast' QMP command". Fix
it.

Signed-off-by: Victor Toso <victortoso@redhat.com>
---
 qapi/machine.json | 2 --
 1 file changed, 2 deletions(-)

diff --git a/qapi/machine.json b/qapi/machine.json
index 9c460ec450..968f912989 100644
--- a/qapi/machine.json
+++ b/qapi/machine.json
@@ -109,7 +109,6 @@
 #                 "socket-id": 0
 #             },
 #             "qom-path": "/machine/unattached/device[0]",
-#             "arch":"x86",
 #             "target":"x86_64",
 #             "cpu-index": 0
 #         },
@@ -121,7 +120,6 @@
 #                 "socket-id": 1
 #             },
 #             "qom-path": "/machine/unattached/device[2]",
-#             "arch":"x86",
 #             "target":"x86_64",
 #             "cpu-index": 1
 #         }
-- 
2.35.1



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v1 9/9] qapi: fix example of query-memdev command
  2022-03-31 19:06 [PATCH v1 0/9] Fix some qapi examples Victor Toso
                   ` (7 preceding siblings ...)
  2022-03-31 19:06 ` [PATCH v1 8/9] qapi: fix example of query-cpus-fast command Victor Toso
@ 2022-03-31 19:06 ` Victor Toso
  2022-04-01  8:09   ` Markus Armbruster
  2022-04-01  8:20 ` [PATCH 10/9] qapi: Fix calc-dirty-rate example Markus Armbruster
  2022-04-04  9:51 ` [PATCH v1 0/9] Fix some qapi examples Markus Armbruster
  10 siblings, 1 reply; 26+ messages in thread
From: Victor Toso @ 2022-03-31 19:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: John Snow, Eric Blake, Markus Armbruster

Example output is missing mandatory argument @share for the return
JSON object. Add it.

Signed-off-by: Victor Toso <victortoso@redhat.com>
---
 qapi/machine.json | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/qapi/machine.json b/qapi/machine.json
index 968f912989..d25a481ce4 100644
--- a/qapi/machine.json
+++ b/qapi/machine.json
@@ -839,6 +839,7 @@
 #          "merge": false,
 #          "dump": true,
 #          "prealloc": false,
+#          "share": false,
 #          "host-nodes": [0, 1],
 #          "policy": "bind"
 #        },
@@ -847,6 +848,7 @@
 #          "merge": false,
 #          "dump": true,
 #          "prealloc": true,
+#          "share": false,
 #          "host-nodes": [2, 3],
 #          "policy": "preferred"
 #        }
-- 
2.35.1



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [PATCH v1 1/9] qapi: fix example of netdev_add command
  2022-03-31 19:06 ` [PATCH v1 1/9] qapi: fix example of netdev_add command Victor Toso
@ 2022-04-01  7:56   ` Markus Armbruster
  2022-04-01 10:59     ` Victor Toso
  2022-04-01 11:07   ` [PATCH v1.1 " Victor Toso
  1 sibling, 1 reply; 26+ messages in thread
From: Markus Armbruster @ 2022-04-01  7:56 UTC (permalink / raw)
  To: Victor Toso; +Cc: John Snow, Eric Blake, qemu-devel, Markus Armbruster

Victor Toso <victortoso@redhat.com> writes:

> Example output has the optional member @dnssearch as string type. It
> should be an array of strings instead. Fix it.
>
> For reference, see NetdevUserOptions.
>
> Signed-off-by: Victor Toso <victortoso@redhat.com>
> ---
>  qapi/net.json | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/qapi/net.json b/qapi/net.json
> index 0d4578bd07..efc0bae170 100644
> --- a/qapi/net.json
> +++ b/qapi/net.json
> @@ -51,7 +51,7 @@
>  #
>  # -> { "execute": "netdev_add",
>  #      "arguments": { "type": "user", "id": "netdev1",
> -#                     "dnssearch": "example.org" } }
> +#                     "dnssearch": [ "example.org" ] } }
>  # <- { "return": {} }
>  #
>  ##

Uh, @dnssearch is ['String']...  shouldn't this be something like

   #                     "dnssearch": [ { "str": "example.org" } ] } }

?



^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v1 2/9] qapi: fix examples: replay-break and replay-seek
  2022-03-31 19:06 ` [PATCH v1 2/9] qapi: fix examples: replay-break and replay-seek Victor Toso
@ 2022-04-01  8:01   ` Markus Armbruster
  0 siblings, 0 replies; 26+ messages in thread
From: Markus Armbruster @ 2022-04-01  8:01 UTC (permalink / raw)
  To: Victor Toso; +Cc: John Snow, Eric Blake, qemu-devel

Victor Toso <victortoso@redhat.com> writes:

> Both examples outputs are using @data member for the arguments. This
> is wrong. The expected member for the QMP is @arguments. Fix it.
>
> Signed-off-by: Victor Toso <victortoso@redhat.com>
> ---
>  qapi/replay.json | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/qapi/replay.json b/qapi/replay.json
> index b4d1ba253b..351898f60d 100644
> --- a/qapi/replay.json
> +++ b/qapi/replay.json
> @@ -81,7 +81,7 @@
>  #
>  # Example:
>  #
> -# -> { "execute": "replay-break", "data": { "icount": 220414 } }
> +# -> { "execute": "replay-break", "arguments": { "icount": 220414 } }
>  #
>  ##
>  { 'command': 'replay-break', 'data': { 'icount': 'int' } }
> @@ -117,6 +117,6 @@
>  #
>  # Example:
>  #
> -# -> { "execute": "replay-seek", "data": { "icount": 220414 } }
> +# -> { "execute": "replay-seek", "arguments": { "icount": 220414 } }
>  ##
>  { 'command': 'replay-seek', 'data': { 'icount': 'int' } }

I should've flagged these when I reviewed commit b1ca53224a
"qapi/migration: Fix examples document wrong field name for arguments".

Reviewed-by: Markus Armbruster <armbru@redhat.com>



^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v1 3/9] qapi: fix example of query-named-block-nodes command
  2022-03-31 19:06 ` [PATCH v1 3/9] qapi: fix example of query-named-block-nodes command Victor Toso
@ 2022-04-01  8:02   ` Markus Armbruster
  0 siblings, 0 replies; 26+ messages in thread
From: Markus Armbruster @ 2022-04-01  8:02 UTC (permalink / raw)
  To: Victor Toso; +Cc: John Snow, Eric Blake, qemu-devel

Victor Toso <victortoso@redhat.com> writes:

> Example output is missing mandatory member @detect_zeroes. Fix it.
>
> Signed-off-by: Victor Toso <victortoso@redhat.com>
> ---
>  qapi/block-core.json | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/qapi/block-core.json b/qapi/block-core.json
> index 4a7a6940a3..beeb91952a 100644
> --- a/qapi/block-core.json
> +++ b/qapi/block-core.json
> @@ -1776,6 +1776,7 @@
>  #                    "file":"disks/test.qcow2",
>  #                    "node-name": "my-node",
>  #                    "backing_file_depth":1,
> +#                    "detect_zeroes":"off",
>  #                    "bps":1000000,
>  #                    "bps_rd":0,
>  #                    "bps_wr":0,

Reviewed-by: Markus Armbruster <armbru@redhat.com>



^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v1 4/9] qapi: fix example of query-spice command
  2022-03-31 19:06 ` [PATCH v1 4/9] qapi: fix example of query-spice command Victor Toso
@ 2022-04-01  8:03   ` Markus Armbruster
  0 siblings, 0 replies; 26+ messages in thread
From: Markus Armbruster @ 2022-04-01  8:03 UTC (permalink / raw)
  To: Victor Toso; +Cc: John Snow, Eric Blake, qemu-devel

Victor Toso <victortoso@redhat.com> writes:

> Example output is missing mandatory members @migrated and @mouse-mode.
> Fix it.
>
> Signed-off-by: Victor Toso <victortoso@redhat.com>
> ---
>  qapi/ui.json | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/qapi/ui.json b/qapi/ui.json
> index a810ed680c..c039b8b3cb 100644
> --- a/qapi/ui.json
> +++ b/qapi/ui.json
> @@ -324,8 +324,10 @@
>  #          "enabled": true,
>  #          "auth": "spice",
>  #          "port": 5920,
> +#          "migrated":false,
>  #          "tls-port": 5921,
>  #          "host": "0.0.0.0",
> +#          "mouse-mode":"client",
>  #          "channels": [
>  #             {
>  #                "port": "54924",

Reviewed-by: Markus Armbruster <armbru@redhat.com>



^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v1 5/9] qapi: fix example of query-vnc command
  2022-03-31 19:06 ` [PATCH v1 5/9] qapi: fix example of query-vnc command Victor Toso
@ 2022-04-01  8:03   ` Markus Armbruster
  0 siblings, 0 replies; 26+ messages in thread
From: Markus Armbruster @ 2022-04-01  8:03 UTC (permalink / raw)
  To: Victor Toso; +Cc: John Snow, Eric Blake, qemu-devel

Victor Toso <victortoso@redhat.com> writes:

> The return value is missing the mandatory member @websocket. Fix it.
>
> Signed-off-by: Victor Toso <victortoso@redhat.com>
> ---
>  qapi/ui.json | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/qapi/ui.json b/qapi/ui.json
> index c039b8b3cb..13a8bb82aa 100644
> --- a/qapi/ui.json
> +++ b/qapi/ui.json
> @@ -658,6 +658,7 @@
>  #                "host":"127.0.0.1",
>  #                "service":"50401",
>  #                "family":"ipv4"
> +#                "websocket":false,
>  #             }
>  #          ]
>  #       }

Reviewed-by: Markus Armbruster <armbru@redhat.com>



^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v1 6/9] qapi: fix example of query-colo-status command
  2022-03-31 19:06 ` [PATCH v1 6/9] qapi: fix example of query-colo-status command Victor Toso
@ 2022-04-01  8:04   ` Markus Armbruster
  0 siblings, 0 replies; 26+ messages in thread
From: Markus Armbruster @ 2022-04-01  8:04 UTC (permalink / raw)
  To: Victor Toso; +Cc: John Snow, Eric Blake, qemu-devel

Victor Toso <victortoso@redhat.com> writes:

> The example output is missing the mandatory member @last-mode in the
> return value. Fix it.
>
> Signed-off-by: Victor Toso <victortoso@redhat.com>
> ---
>  qapi/migration.json | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/qapi/migration.json b/qapi/migration.json
> index 092a63354b..f74777608a 100644
> --- a/qapi/migration.json
> +++ b/qapi/migration.json
> @@ -1679,7 +1679,7 @@
>  # Example:
>  #
>  # -> { "execute": "query-colo-status" }
> -# <- { "return": { "mode": "primary", "reason": "request" } }
> +# <- { "return": { "mode": "primary", "last-mode": "none", "reason": "request" } }
>  #
>  # Since: 3.1
>  ##

Reviewed-by: Markus Armbruster <armbru@redhat.com>



^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v1 7/9] qapi: fix example of trace-event-get-state command
  2022-03-31 19:06 ` [PATCH v1 7/9] qapi: fix example of trace-event-get-state command Victor Toso
@ 2022-04-01  8:07   ` Markus Armbruster
  0 siblings, 0 replies; 26+ messages in thread
From: Markus Armbruster @ 2022-04-01  8:07 UTC (permalink / raw)
  To: Victor Toso; +Cc: John Snow, Eric Blake, qemu-devel

Victor Toso <victortoso@redhat.com> writes:

> The example output is missing the mandatory member @vcpu. Fix it.
>
> Signed-off-by: Victor Toso <victortoso@redhat.com>
> ---
>  qapi/trace.json | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/qapi/trace.json b/qapi/trace.json
> index 119509f565..6c6982a587 100644
> --- a/qapi/trace.json
> +++ b/qapi/trace.json
> @@ -69,7 +69,7 @@
>  #
>  # -> { "execute": "trace-event-get-state",
>  #      "arguments": { "name": "qemu_memalign" } }
> -# <- { "return": [ { "name": "qemu_memalign", "state": "disabled" } ] }
> +# <- { "return": [ { "name": "qemu_memalign", "state": "disabled", "vcpu": false } ] }
>  #
>  ##
>  { 'command': 'trace-event-get-state',

Reviewed-by: Markus Armbruster <armbru@redhat.com>



^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v1 8/9] qapi: fix example of query-cpus-fast command
  2022-03-31 19:06 ` [PATCH v1 8/9] qapi: fix example of query-cpus-fast command Victor Toso
@ 2022-04-01  8:08   ` Markus Armbruster
  0 siblings, 0 replies; 26+ messages in thread
From: Markus Armbruster @ 2022-04-01  8:08 UTC (permalink / raw)
  To: Victor Toso; +Cc: John Snow, Eric Blake, qemu-devel

Victor Toso <victortoso@redhat.com> writes:

> Example output contains member @arch that was removed in 445a5b4087
> "machine: remove 'arch' field from 'query-cpus-fast' QMP command". Fix
> it.
>
> Signed-off-by: Victor Toso <victortoso@redhat.com>
> ---
>  qapi/machine.json | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/qapi/machine.json b/qapi/machine.json
> index 9c460ec450..968f912989 100644
> --- a/qapi/machine.json
> +++ b/qapi/machine.json
> @@ -109,7 +109,6 @@
>  #                 "socket-id": 0
>  #             },
>  #             "qom-path": "/machine/unattached/device[0]",
> -#             "arch":"x86",
>  #             "target":"x86_64",
>  #             "cpu-index": 0
>  #         },
> @@ -121,7 +120,6 @@
>  #                 "socket-id": 1
>  #             },
>  #             "qom-path": "/machine/unattached/device[2]",
> -#             "arch":"x86",
>  #             "target":"x86_64",
>  #             "cpu-index": 1
>  #         }

Reviewed-by: Markus Armbruster <armbru@redhat.com>



^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v1 9/9] qapi: fix example of query-memdev command
  2022-03-31 19:06 ` [PATCH v1 9/9] qapi: fix example of query-memdev command Victor Toso
@ 2022-04-01  8:09   ` Markus Armbruster
  0 siblings, 0 replies; 26+ messages in thread
From: Markus Armbruster @ 2022-04-01  8:09 UTC (permalink / raw)
  To: Victor Toso; +Cc: John Snow, Eric Blake, qemu-devel

Victor Toso <victortoso@redhat.com> writes:

> Example output is missing mandatory argument @share for the return
> JSON object. Add it.
>
> Signed-off-by: Victor Toso <victortoso@redhat.com>
> ---
>  qapi/machine.json | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/qapi/machine.json b/qapi/machine.json
> index 968f912989..d25a481ce4 100644
> --- a/qapi/machine.json
> +++ b/qapi/machine.json
> @@ -839,6 +839,7 @@
>  #          "merge": false,
>  #          "dump": true,
>  #          "prealloc": false,
> +#          "share": false,
>  #          "host-nodes": [0, 1],
>  #          "policy": "bind"
>  #        },
> @@ -847,6 +848,7 @@
>  #          "merge": false,
>  #          "dump": true,
>  #          "prealloc": true,
> +#          "share": false,
>  #          "host-nodes": [2, 3],
>  #          "policy": "preferred"
>  #        }

Reviewed-by: Markus Armbruster <armbru@redhat.com>



^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PATCH 10/9] qapi: Fix calc-dirty-rate example
  2022-03-31 19:06 [PATCH v1 0/9] Fix some qapi examples Victor Toso
                   ` (8 preceding siblings ...)
  2022-03-31 19:06 ` [PATCH v1 9/9] qapi: fix example of query-memdev command Victor Toso
@ 2022-04-01  8:20 ` Markus Armbruster
  2022-04-01 11:00   ` Victor Toso
  2022-04-04  9:51 ` [PATCH v1 0/9] Fix some qapi examples Markus Armbruster
  10 siblings, 1 reply; 26+ messages in thread
From: Markus Armbruster @ 2022-04-01  8:20 UTC (permalink / raw)
  To: qemu-devel; +Cc: jsnow, eblake, victortoso

The example shows {"command": ...}, which is wrong.  Fix it to
{"execute": ...}.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 qapi/migration.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qapi/migration.json b/qapi/migration.json
index f74777608a..27d7b28158 100644
--- a/qapi/migration.json
+++ b/qapi/migration.json
@@ -1845,7 +1845,7 @@
 # Since: 5.2
 #
 # Example:
-#   {"command": "calc-dirty-rate", "arguments": {"calc-time": 1,
+#   {"execute": "calc-dirty-rate", "arguments": {"calc-time": 1,
 #                                                'sample-pages': 512} }
 #
 ##
-- 
2.35.1



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [PATCH v1 1/9] qapi: fix example of netdev_add command
  2022-04-01  7:56   ` Markus Armbruster
@ 2022-04-01 10:59     ` Victor Toso
  0 siblings, 0 replies; 26+ messages in thread
From: Victor Toso @ 2022-04-01 10:59 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: John Snow, Eric Blake, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1146 bytes --]

Hi,

On Fri, Apr 01, 2022 at 09:56:40AM +0200, Markus Armbruster wrote:
> Victor Toso <victortoso@redhat.com> writes:
> 
> > Example output has the optional member @dnssearch as string type. It
> > should be an array of strings instead. Fix it.
> >
> > For reference, see NetdevUserOptions.
> >
> > Signed-off-by: Victor Toso <victortoso@redhat.com>
> > ---
> >  qapi/net.json | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/qapi/net.json b/qapi/net.json
> > index 0d4578bd07..efc0bae170 100644
> > --- a/qapi/net.json
> > +++ b/qapi/net.json
> > @@ -51,7 +51,7 @@
> >  #
> >  # -> { "execute": "netdev_add",
> >  #      "arguments": { "type": "user", "id": "netdev1",
> > -#                     "dnssearch": "example.org" } }
> > +#                     "dnssearch": [ "example.org" ] } }
> >  # <- { "return": {} }
> >  #
> >  ##
> 
> Uh, @dnssearch is ['String']...  shouldn't this be something like
> 
>    #                     "dnssearch": [ { "str": "example.org" } ] } }
> 
> ?

Yes, my mistake. Thanks for spotting it.
I'll resend this patch shortly.

Cheers,
Victor

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 10/9] qapi: Fix calc-dirty-rate example
  2022-04-01  8:20 ` [PATCH 10/9] qapi: Fix calc-dirty-rate example Markus Armbruster
@ 2022-04-01 11:00   ` Victor Toso
  0 siblings, 0 replies; 26+ messages in thread
From: Victor Toso @ 2022-04-01 11:00 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: jsnow, eblake, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 840 bytes --]

On Fri, Apr 01, 2022 at 10:20:28AM +0200, Markus Armbruster wrote:
> The example shows {"command": ...}, which is wrong.  Fix it to
> {"execute": ...}.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  qapi/migration.json | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/qapi/migration.json b/qapi/migration.json
> index f74777608a..27d7b28158 100644
> --- a/qapi/migration.json
> +++ b/qapi/migration.json
> @@ -1845,7 +1845,7 @@
>  # Since: 5.2
>  #
>  # Example:
> -#   {"command": "calc-dirty-rate", "arguments": {"calc-time": 1,
> +#   {"execute": "calc-dirty-rate", "arguments": {"calc-time": 1,
>  #                                                'sample-pages': 512} }
>  #
>  ##
> -- 
> 2.35.1

Reviewed-by: Victor Toso <victortoso@redhat.com>

Cheers,
Victor

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PATCH v1.1 1/9] qapi: fix example of netdev_add command
  2022-03-31 19:06 ` [PATCH v1 1/9] qapi: fix example of netdev_add command Victor Toso
  2022-04-01  7:56   ` Markus Armbruster
@ 2022-04-01 11:07   ` Victor Toso
  2022-04-04  6:14     ` Markus Armbruster
  1 sibling, 1 reply; 26+ messages in thread
From: Victor Toso @ 2022-04-01 11:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: John Snow, Eric Blake, Markus Armbruster

Example output has the optional member @dnssearch as string type. It
should be an array of strings instead. Fix it.

For reference, see NetdevUserOptions.

Signed-off-by: Victor Toso <victortoso@redhat.com>
---
 qapi/net.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qapi/net.json b/qapi/net.json
index 0d4578bd07..b92f3f5fb4 100644
--- a/qapi/net.json
+++ b/qapi/net.json
@@ -51,7 +51,7 @@
 #
 # -> { "execute": "netdev_add",
 #      "arguments": { "type": "user", "id": "netdev1",
-#                     "dnssearch": "example.org" } }
+#                     "dnssearch": [ { "str": "example.org" } ] } }
 # <- { "return": {} }
 #
 ##
-- 
2.35.1



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [PATCH v1.1 1/9] qapi: fix example of netdev_add command
  2022-04-01 11:07   ` [PATCH v1.1 " Victor Toso
@ 2022-04-04  6:14     ` Markus Armbruster
  2022-04-04  8:27       ` Victor Toso
  0 siblings, 1 reply; 26+ messages in thread
From: Markus Armbruster @ 2022-04-04  6:14 UTC (permalink / raw)
  To: Victor Toso; +Cc: John Snow, Eric Blake, qemu-devel

Victor Toso <victortoso@redhat.com> writes:

> Example output has the optional member @dnssearch as string type. It
> should be an array of strings instead. Fix it.

"of String objects".  Happy to fix this in my tree.

>
> For reference, see NetdevUserOptions.
>
> Signed-off-by: Victor Toso <victortoso@redhat.com>
> ---
>  qapi/net.json | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/qapi/net.json b/qapi/net.json
> index 0d4578bd07..b92f3f5fb4 100644
> --- a/qapi/net.json
> +++ b/qapi/net.json
> @@ -51,7 +51,7 @@
>  #
>  # -> { "execute": "netdev_add",
>  #      "arguments": { "type": "user", "id": "netdev1",
> -#                     "dnssearch": "example.org" } }
> +#                     "dnssearch": [ { "str": "example.org" } ] } }
>  # <- { "return": {} }
>  #
>  ##

Preferably with the commit message tweak:
Reviewed-by: Markus Armbruster <armbru@redhat.com>



^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v1.1 1/9] qapi: fix example of netdev_add command
  2022-04-04  6:14     ` Markus Armbruster
@ 2022-04-04  8:27       ` Victor Toso
  0 siblings, 0 replies; 26+ messages in thread
From: Victor Toso @ 2022-04-04  8:27 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: John Snow, Eric Blake, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1096 bytes --]

Hi,

On Mon, Apr 04, 2022 at 08:14:11AM +0200, Markus Armbruster wrote:
> Victor Toso <victortoso@redhat.com> writes:
> 
> > Example output has the optional member @dnssearch as string type. It
> > should be an array of strings instead. Fix it.
> 
> "of String objects".  Happy to fix this in my tree.

Sure

> 
> >
> > For reference, see NetdevUserOptions.
> >
> > Signed-off-by: Victor Toso <victortoso@redhat.com>
> > ---
> >  qapi/net.json | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/qapi/net.json b/qapi/net.json
> > index 0d4578bd07..b92f3f5fb4 100644
> > --- a/qapi/net.json
> > +++ b/qapi/net.json
> > @@ -51,7 +51,7 @@
> >  #
> >  # -> { "execute": "netdev_add",
> >  #      "arguments": { "type": "user", "id": "netdev1",
> > -#                     "dnssearch": "example.org" } }
> > +#                     "dnssearch": [ { "str": "example.org" } ] } }
> >  # <- { "return": {} }
> >  #
> >  ##
> 
> Preferably with the commit message tweak:
> Reviewed-by: Markus Armbruster <armbru@redhat.com>

Thanks,
Victor

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v1 0/9] Fix some qapi examples
  2022-03-31 19:06 [PATCH v1 0/9] Fix some qapi examples Victor Toso
                   ` (9 preceding siblings ...)
  2022-04-01  8:20 ` [PATCH 10/9] qapi: Fix calc-dirty-rate example Markus Armbruster
@ 2022-04-04  9:51 ` Markus Armbruster
  10 siblings, 0 replies; 26+ messages in thread
From: Markus Armbruster @ 2022-04-04  9:51 UTC (permalink / raw)
  To: Victor Toso; +Cc: John Snow, Eric Blake, qemu-devel

Victor Toso <victortoso@redhat.com> writes:

> Hi,
>
> I did another iteration of adding the examples in the qapi documentation
> as unit tests in another project and found a few that could be updated.
>
> Feel free to cherry-pick them. Happy to rework it if needed.

Queued, thanks!



^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2022-04-04  9:53 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-31 19:06 [PATCH v1 0/9] Fix some qapi examples Victor Toso
2022-03-31 19:06 ` [PATCH v1 1/9] qapi: fix example of netdev_add command Victor Toso
2022-04-01  7:56   ` Markus Armbruster
2022-04-01 10:59     ` Victor Toso
2022-04-01 11:07   ` [PATCH v1.1 " Victor Toso
2022-04-04  6:14     ` Markus Armbruster
2022-04-04  8:27       ` Victor Toso
2022-03-31 19:06 ` [PATCH v1 2/9] qapi: fix examples: replay-break and replay-seek Victor Toso
2022-04-01  8:01   ` Markus Armbruster
2022-03-31 19:06 ` [PATCH v1 3/9] qapi: fix example of query-named-block-nodes command Victor Toso
2022-04-01  8:02   ` Markus Armbruster
2022-03-31 19:06 ` [PATCH v1 4/9] qapi: fix example of query-spice command Victor Toso
2022-04-01  8:03   ` Markus Armbruster
2022-03-31 19:06 ` [PATCH v1 5/9] qapi: fix example of query-vnc command Victor Toso
2022-04-01  8:03   ` Markus Armbruster
2022-03-31 19:06 ` [PATCH v1 6/9] qapi: fix example of query-colo-status command Victor Toso
2022-04-01  8:04   ` Markus Armbruster
2022-03-31 19:06 ` [PATCH v1 7/9] qapi: fix example of trace-event-get-state command Victor Toso
2022-04-01  8:07   ` Markus Armbruster
2022-03-31 19:06 ` [PATCH v1 8/9] qapi: fix example of query-cpus-fast command Victor Toso
2022-04-01  8:08   ` Markus Armbruster
2022-03-31 19:06 ` [PATCH v1 9/9] qapi: fix example of query-memdev command Victor Toso
2022-04-01  8:09   ` Markus Armbruster
2022-04-01  8:20 ` [PATCH 10/9] qapi: Fix calc-dirty-rate example Markus Armbruster
2022-04-01 11:00   ` Victor Toso
2022-04-04  9:51 ` [PATCH v1 0/9] Fix some qapi examples Markus Armbruster

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).