From patchwork Thu Oct 8 18:58:25 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark McLoughlin X-Patchwork-Id: 35505 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 1AFC3B70B3 for ; Fri, 9 Oct 2009 06:06:35 +1100 (EST) Received: from localhost ([127.0.0.1]:34483 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MvyJs-0000s6-N4 for incoming@patchwork.ozlabs.org; Thu, 08 Oct 2009 15:06:32 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MvyDs-00067E-UP for qemu-devel@nongnu.org; Thu, 08 Oct 2009 15:00:20 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MvyDn-000657-Oz for qemu-devel@nongnu.org; Thu, 08 Oct 2009 15:00:20 -0400 Received: from [199.232.76.173] (port=52320 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MvyDn-00064y-JN for qemu-devel@nongnu.org; Thu, 08 Oct 2009 15:00:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32694) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MvyDn-0006wF-2c for qemu-devel@nongnu.org; Thu, 08 Oct 2009 15:00:15 -0400 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n98J0E1H005404 for ; Thu, 8 Oct 2009 15:00:14 -0400 Received: from blaa.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n98J0CT0013075; Thu, 8 Oct 2009 15:00:13 -0400 Received: by blaa.localdomain (Postfix, from userid 500) id 5E9064830B; Thu, 8 Oct 2009 19:58:33 +0100 (IST) From: Mark McLoughlin To: qemu-devel@nongnu.org Date: Thu, 8 Oct 2009 19:58:25 +0100 Message-Id: <1255028312-28180-10-git-send-email-markmc@redhat.com> In-Reply-To: <1255028312-28180-1-git-send-email-markmc@redhat.com> References: <1255028312-28180-1-git-send-email-markmc@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Mark McLoughlin Subject: [Qemu-devel] [PATCH 09/16] net: add QemuOptsList arg to net_client_parse() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Mark McLoughlin --- net.c | 7 ++++--- net.h | 2 +- vl.c | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/net.c b/net.c index 6cd63aa..2cfdd30 100644 --- a/net.c +++ b/net.c @@ -3231,11 +3231,12 @@ int net_init_clients(void) return 0; } -int net_client_parse(const char *optarg) +int net_client_parse(QemuOptsList *opts_list, const char *optarg) { #if defined(CONFIG_SLIRP) /* handle legacy -net channel,port:chr */ - if (!strncmp(optarg, "channel,", strlen("channel,"))) { + if (!strcmp(opts_list->name, "net") && + !strncmp(optarg, "channel,", strlen("channel,"))) { int ret; optarg += strlen("channel,"); @@ -3256,7 +3257,7 @@ int net_client_parse(const char *optarg) return ret; } #endif - if (!qemu_opts_parse(&qemu_net_opts, optarg, "type")) { + if (!qemu_opts_parse(opts_list, optarg, "type")) { return -1; } diff --git a/net.h b/net.h index 79e9b47..404190c 100644 --- a/net.h +++ b/net.h @@ -136,7 +136,7 @@ extern const char *legacy_bootp_filename; int net_client_init(Monitor *mon, QemuOpts *opts); void net_client_uninit(NICInfo *nd); -int net_client_parse(const char *str); +int net_client_parse(QemuOptsList *opts_list, const char *str); int net_init_clients(void); int net_slirp_smb(const char *exported_dir); void net_slirp_hostfwd_add(Monitor *mon, const QDict *qdict); diff --git a/vl.c b/vl.c index 374f85b..13e56bc 100644 --- a/vl.c +++ b/vl.c @@ -5088,7 +5088,7 @@ int main(int argc, char **argv, char **envp) break; #endif case QEMU_OPTION_net: - if (net_client_parse(optarg) == -1) { + if (net_client_parse(&qemu_net_opts, optarg) == -1) { exit(1); } break;