[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 23/26] qapi-schema: Fix up misleading specification o
From: |
Markus Armbruster |
Subject: |
[Qemu-devel] [PULL 23/26] qapi-schema: Fix up misleading specification of netdev_add |
Date: |
Mon, 21 Sep 2015 10:03:57 +0200 |
It doesn't take a 'props' argument, let alone one in the format
"NAME=VALUE,..."
The bogus arguments specification doesn't matter due to 'gen': false.
Clean it up to be incomplete rather than wrong, and document the
incompleteness.
While there, improve netdev_add usage example in the manual: add a
device option to show how it's done.
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Daniel P. Berrange <address@hidden>
Message-Id: <address@hidden>
---
docs/qapi-code-gen.txt | 2 +-
qapi-schema.json | 13 +++++++------
qmp-commands.hx | 4 +++-
3 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/docs/qapi-code-gen.txt b/docs/qapi-code-gen.txt
index 70fdae7..4e331a0 100644
--- a/docs/qapi-code-gen.txt
+++ b/docs/qapi-code-gen.txt
@@ -471,7 +471,7 @@ try to avoid adding new commands that rely on this, and
instead use
type-safe unions. For an example of bypass usage:
{ 'command': 'netdev_add',
- 'data': {'type': 'str', 'id': 'str', '*props': '**'},
+ 'data': {'type': 'str', 'id': 'str'},
'gen': false }
Normally, the QAPI schema is used to describe synchronous exchanges,
diff --git a/qapi-schema.json b/qapi-schema.json
index 756ed9e..3ff9fec 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -2079,11 +2079,12 @@
#
# @id: the name of the new network backend
#
-# @props: #optional a list of properties to be passed to the backend in
-# the format 'name=value', like 'ifname=tap0,script=no'
+# Additional arguments depend on the type.
#
-# Notes: The semantics of @props is not well defined. Future commands will be
-# introduced that provide stronger typing for backend creation.
+# TODO This command effectively bypasses QAPI completely due to its
+# "additional arguments" business. It shouldn't have been added to
+# the schema in this form. It should be qapified properly, or
+# replaced by a properly qapified command.
#
# Since: 0.14.0
#
@@ -2091,8 +2092,8 @@
# If @type is not a valid network backend, DeviceNotFound
##
{ 'command': 'netdev_add',
- 'data': {'type': 'str', 'id': 'str', '*props': '**'},
- 'gen': false }
+ 'data': {'type': 'str', 'id': 'str'},
+ 'gen': false } # so we can get the additional arguments
##
# @netdev_del:
diff --git a/qmp-commands.hx b/qmp-commands.hx
index 7c74e20..5a54406 100644
--- a/qmp-commands.hx
+++ b/qmp-commands.hx
@@ -917,7 +917,9 @@ Arguments:
Example:
--> { "execute": "netdev_add", "arguments": { "type": "user", "id": "netdev1" }
}
+-> { "execute": "netdev_add",
+ "arguments": { "type": "user", "id": "netdev1",
+ "dnssearch": "example.org" } }
<- { "return": {} }
Note: The supported device options are the same ones supported by the '-netdev'
--
2.4.3
- [Qemu-devel] [PULL 04/26] qapi: New QAPISchemaVisitor, (continued)
- [Qemu-devel] [PULL 04/26] qapi: New QAPISchemaVisitor, Markus Armbruster, 2015/09/21
- [Qemu-devel] [PULL 01/26] qapi: Rename class QAPISchema to QAPISchemaParser, Markus Armbruster, 2015/09/21
- [Qemu-devel] [PULL 03/26] qapi: QAPISchema code generation helper methods, Markus Armbruster, 2015/09/21
- [Qemu-devel] [PULL 12/26] qapi: Replace dirty is_c_ptr() by method c_null(), Markus Armbruster, 2015/09/21
- [Qemu-devel] [PULL 09/26] qapi: De-duplicate enum code generation, Markus Armbruster, 2015/09/21
- [Qemu-devel] [PULL 11/26] qapi-event: Convert to QAPISchemaVisitor, fixing data with base, Markus Armbruster, 2015/09/21
- [Qemu-devel] [PULL 08/26] qapi-commands: Convert to QAPISchemaVisitor, Markus Armbruster, 2015/09/21
- [Qemu-devel] [PULL 10/26] qapi-event: Eliminate global variable event_enum_value, Markus Armbruster, 2015/09/21
- [Qemu-devel] [PULL 14/26] qapi-visit: Rearrange code a bit, Markus Armbruster, 2015/09/21
- [Qemu-devel] [PULL 02/26] qapi: New QAPISchema intermediate reperesentation, Markus Armbruster, 2015/09/21
- [Qemu-devel] [PULL 23/26] qapi-schema: Fix up misleading specification of netdev_add,
Markus Armbruster <=
- [Qemu-devel] [PULL 06/26] qapi-types: Convert to QAPISchemaVisitor, fixing flat unions, Markus Armbruster, 2015/09/21
- [Qemu-devel] [PULL 20/26] qapi: Make output visitor return qnull() instead of NULL, Markus Armbruster, 2015/09/21
- [Qemu-devel] [PULL 18/26] qapi-commands: De-duplicate output marshaling functions, Markus Armbruster, 2015/09/21
- [Qemu-devel] [PULL 15/26] qapi-commands: Rearrange code, Markus Armbruster, 2015/09/21
- [Qemu-devel] [PULL 17/26] qapi: De-duplicate parameter list generation, Markus Armbruster, 2015/09/21
- [Qemu-devel] [PULL 05/26] tests/qapi-schema: Convert test harness to QAPISchemaVisitor, Markus Armbruster, 2015/09/21
- [Qemu-devel] [PULL 19/26] qapi: Improve built-in type documentation, Markus Armbruster, 2015/09/21
- [Qemu-devel] [PULL 22/26] qom: Don't use 'gen': false for qom-get, qom-set, object-add, Markus Armbruster, 2015/09/21
- [Qemu-devel] [PULL 26/26] qapi-introspect: Hide type names, Markus Armbruster, 2015/09/21
- [Qemu-devel] [PULL 24/26] qapi: Pseudo-type '**' is now unused, drop it, Markus Armbruster, 2015/09/21