From patchwork Thu Sep 3 14:30:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 514111 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 33EE6140285 for ; Fri, 4 Sep 2015 00:42:42 +1000 (AEST) Received: from localhost ([::1]:48625 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXViq-0000Bg-BM for incoming@patchwork.ozlabs.org; Thu, 03 Sep 2015 10:42:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33005) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXVXB-0004Q0-Ox for qemu-devel@nongnu.org; Thu, 03 Sep 2015 10:30:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZXVXA-0005gN-C9 for qemu-devel@nongnu.org; Thu, 03 Sep 2015 10:30:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34128) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXVX9-0005fc-MH for qemu-devel@nongnu.org; Thu, 03 Sep 2015 10:30:35 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 6DEDB40; Thu, 3 Sep 2015 14:30:35 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-45.ams2.redhat.com [10.36.116.45]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t83EUVH9001360 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 3 Sep 2015 10:30:34 -0400 Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id D829E3011FAC; Thu, 3 Sep 2015 16:30:25 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Thu, 3 Sep 2015 16:30:19 +0200 Message-Id: <1441290623-13631-29-git-send-email-armbru@redhat.com> In-Reply-To: <1441290623-13631-1-git-send-email-armbru@redhat.com> References: <1441290623-13631-1-git-send-email-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: mdroth@linux.vnet.ibm.com Subject: [Qemu-devel] [PATCH RFC v4 28/32] qapi-schema: Fix up misleading specification of netdev_add X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 17d2e60..e91e3b9 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -2065,11 +2065,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 # @@ -2077,8 +2078,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 76942a6..b06d74c 100644 --- a/qmp-commands.hx +++ b/qmp-commands.hx @@ -892,7 +892,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'