From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34350) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYtTu-0001bg-Hi for qemu-devel@nongnu.org; Mon, 07 Sep 2015 06:16:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZYtTt-0000Sn-0x for qemu-devel@nongnu.org; Mon, 07 Sep 2015 06:16:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32890) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYtTs-0000Sc-RE for qemu-devel@nongnu.org; Mon, 07 Sep 2015 06:16:56 -0400 From: Markus Armbruster Date: Mon, 7 Sep 2015 12:16:39 +0200 Message-Id: <1441621003-2434-29-git-send-email-armbru@redhat.com> In-Reply-To: <1441621003-2434-1-git-send-email-armbru@redhat.com> References: <1441621003-2434-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PATCH RFC v5 28/32] qapi-schema: Fix up misleading specification of netdev_add List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: mdroth@linux.vnet.ibm.com 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 Reviewed-by: Eric Blake --- 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 c713e3a..a5fccd4 100644 --- a/docs/qapi-code-gen.txt +++ b/docs/qapi-code-gen.txt @@ -463,7 +463,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 b0906c7..d874c11 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 5e11700..8183bbd 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