From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47297) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WuMrY-0007cX-G0 for qemu-devel@nongnu.org; Tue, 10 Jun 2014 10:17:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WuMrR-0005tG-Oq for qemu-devel@nongnu.org; Tue, 10 Jun 2014 10:17:20 -0400 Received: from mail-wg0-f44.google.com ([74.125.82.44]:36552) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WuMrR-0005t6-Iv for qemu-devel@nongnu.org; Tue, 10 Jun 2014 10:17:13 -0400 Received: by mail-wg0-f44.google.com with SMTP id x13so4666858wgg.15 for ; Tue, 10 Jun 2014 07:17:12 -0700 (PDT) From: Nikolay Nikolaev Date: Tue, 10 Jun 2014 17:17:05 +0300 Message-ID: <20140610141631.27328.63686.stgit@3820> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH v10-fix 1/1] fixup! Add the vhost-user netdev backend to the command line List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: snabb-devel@googlegroups.com, qemu-devel@nongnu.org Cc: a.motakis@virtualopensystems.com, luke@snabb.co, tech@virtualopensystems.com, n.nikolaev@virtualopensystems.com, mst@redhat.com Fixes remarks: - rever vhost-force to vhostforce (consistent with tap) - removed has_unsupported member from VhostUserChardevProps - removed double error reporting when parsing chardev options Signed-off-by: Nikolay Nikolaev --- net/vhost-user.c | 18 ++++++------------ qapi-schema.json | 4 ++-- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/net/vhost-user.c b/net/vhost-user.c index 32b78fb..24e050c 100644 --- a/net/vhost-user.c +++ b/net/vhost-user.c @@ -26,7 +26,6 @@ typedef struct VhostUserChardevProps { bool is_socket; bool is_unix; bool is_server; - bool has_unsupported; } VhostUserChardevProps; VHostNetState *vhost_user_get_vhost_net(NetClientState *nc) @@ -172,7 +171,6 @@ static int net_vhost_chardev_opts(const char *name, const char *value, error_report("vhost-user does not support a chardev" " with the following option:\n %s = %s", name, value); - props->has_unsupported = true; return -1; } return 0; @@ -190,7 +188,9 @@ static CharDriverState *net_vhost_parse_chardev(const NetdevVhostUserOptions *op /* inspect chardev opts */ memset(&props, 0, sizeof(props)); - qemu_opt_foreach(chr->opts, net_vhost_chardev_opts, &props, false); + if (qemu_opt_foreach(chr->opts, net_vhost_chardev_opts, &props, true) != 0) { + return NULL; + } if (!props.is_socket || !props.is_unix) { error_report("chardev \"%s\" is not a unix socket", @@ -198,12 +198,6 @@ static CharDriverState *net_vhost_parse_chardev(const NetdevVhostUserOptions *op return NULL; } - if (props.has_unsupported) { - error_report("chardev \"%s\" has an unsupported option", - opts->chardev); - return NULL; - } - qemu_chr_fe_claim_no_fail(chr); return chr; @@ -253,9 +247,9 @@ int net_init_vhost_user(const NetClientOptions *opts, const char *name, return -1; } - /* vhost-force for non-MSIX */ - if (vhost_user_opts->has_vhost_force) { - vhostforce = vhost_user_opts->vhost_force; + /* vhostforce for non-MSIX */ + if (vhost_user_opts->has_vhostforce) { + vhostforce = vhost_user_opts->vhostforce; } else { vhostforce = false; } diff --git a/qapi-schema.json b/qapi-schema.json index f062ce9..0837fc5 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -3273,14 +3273,14 @@ # # @chardev: name of a unix socket chardev # -# @vhost-force: #optional vhost on for non-MSIX virtio guests (default: false). +# @vhostforce: #optional vhost on for non-MSIX virtio guests (default: false). # # Since 2.1 ## { 'type': 'NetdevVhostUserOptions', 'data': { 'chardev': 'str', - '*vhost-force': 'bool' } } + '*vhostforce': 'bool' } } ## # @NetClientOptions