]> git.proxmox.com Git - mirror_qemu.git/commitdiff
qapi-schema: Fix up misleading specification of netdev_add
authorMarkus Armbruster <armbru@redhat.com>
Wed, 16 Sep 2015 11:06:26 +0000 (13:06 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Mon, 21 Sep 2015 07:56:49 +0000 (09:56 +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 <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
Message-Id: <1442401589-24189-24-git-send-email-armbru@redhat.com>

docs/qapi-code-gen.txt
qapi-schema.json
qmp-commands.hx

index 70fdae77d19c539f1bf6ff25d5954fc394a14db2..4e331a0f1d01c9432d452feb7356a636d79a1515 100644 (file)
@@ -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,
index 756ed9e96cdb52af8cac45edb3d34dc5c0011637..3ff9fec61dab7c046517fda754e44af20d977cc3 100644 (file)
 #
 # @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
 #
 #          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:
index 7c74e20087a20cc5a7582fe80c2a43adf64ba4fe..5a5440636d46a16a7a0607082325f8cfd2bf0efe 100644 (file)
@@ -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'