From patchwork Mon Jul 23 11:50:44 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 172638 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)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 75D852C0347 for ; Mon, 23 Jul 2012 21:51:33 +1000 (EST) Received: from localhost ([::1]:54440 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1StHAh-0005go-J1 for incoming@patchwork.ozlabs.org; Mon, 23 Jul 2012 07:51:31 -0400 Received: from eggs.gnu.org ([208.118.235.92]:53976) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1StHAK-0005RX-Vg for qemu-devel@nongnu.org; Mon, 23 Jul 2012 07:51:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1StHAJ-0000Wy-A7 for qemu-devel@nongnu.org; Mon, 23 Jul 2012 07:51:08 -0400 Received: from e06smtp12.uk.ibm.com ([195.75.94.108]:38567) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1StHAI-0000WY-VH for qemu-devel@nongnu.org; Mon, 23 Jul 2012 07:51:07 -0400 Received: from /spool/local by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 23 Jul 2012 12:51:06 +0100 Received: from d06nrmr1507.portsmouth.uk.ibm.com (9.149.38.233) by e06smtp12.uk.ibm.com (192.168.101.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 23 Jul 2012 12:51:03 +0100 Received: from d06av05.portsmouth.uk.ibm.com (d06av05.portsmouth.uk.ibm.com [9.149.37.229]) by d06nrmr1507.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q6NBp3FK2609250 for ; Mon, 23 Jul 2012 12:51:03 +0100 Received: from d06av05.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q6NBp2uc008264 for ; Mon, 23 Jul 2012 05:51:02 -0600 Received: from localhost (stefanha-thinkpad.manchester-maybrook.uk.ibm.com [9.174.219.145]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q6NBp2fF008248; Mon, 23 Jul 2012 05:51:02 -0600 From: Stefan Hajnoczi To: Anthony Liguori Date: Mon, 23 Jul 2012 12:50:44 +0100 Message-Id: <1343044244-28728-20-git-send-email-stefanha@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1343044244-28728-1-git-send-email-stefanha@linux.vnet.ibm.com> References: <1343044244-28728-1-git-send-email-stefanha@linux.vnet.ibm.com> x-cbid: 12072311-8372-0000-0000-00000343D0F7 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 195.75.94.108 Cc: Laszlo Ersek , qemu-devel@nongnu.org, Stefan Hajnoczi Subject: [Qemu-devel] [PATCH 19/19] remove unused QemuOpts parameter from net init functions 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 From: Laszlo Ersek v1->v2: - unchanged v2->v3: - keep "qemu-option.h" included in "net/slirp.h" Signed-off-by: Laszlo Ersek Signed-off-by: Stefan Hajnoczi --- net.c | 14 ++++++-------- net/dump.c | 4 ++-- net/dump.h | 5 ++--- net/slirp.c | 4 ++-- net/slirp.h | 4 ++-- net/socket.c | 4 ++-- net/socket.h | 5 ++--- net/tap-win32.c | 4 ++-- net/tap.c | 8 ++++---- net/tap.h | 9 ++++----- net/vde.c | 4 ++-- net/vde.h | 5 ++--- 12 files changed, 32 insertions(+), 38 deletions(-) diff --git a/net.c b/net.c index a62e902..dbca77b 100644 --- a/net.c +++ b/net.c @@ -748,8 +748,8 @@ int net_handle_fd_param(Monitor *mon, const char *param) return fd; } -static int net_init_nic(QemuOpts *old_opts, const NetClientOptions *opts, - const char *name, VLANState *vlan) +static int net_init_nic(const NetClientOptions *opts, const char *name, + VLANState *vlan) { int idx; NICInfo *nd; @@ -813,8 +813,7 @@ static int net_init_nic(QemuOpts *old_opts, const NetClientOptions *opts, static int (* const net_client_init_fun[NET_CLIENT_OPTIONS_KIND_MAX])( - QemuOpts *old_opts, - const NetClientOptions *new_opts, + const NetClientOptions *opts, const char *name, VLANState *vlan) = { [NET_CLIENT_OPTIONS_KIND_NIC] = net_init_nic, @@ -833,8 +832,7 @@ static int (* const net_client_init_fun[NET_CLIENT_OPTIONS_KIND_MAX])( }; -static int net_client_init1(const void *object, int is_netdev, - QemuOpts *old_opts, Error **errp) +static int net_client_init1(const void *object, int is_netdev, Error **errp) { union { const Netdev *netdev; @@ -885,7 +883,7 @@ static int net_client_init1(const void *object, int is_netdev, vlan = qemu_find_vlan(u.net->has_vlan ? u.net->vlan : 0, true); } - if (net_client_init_fun[opts->kind](old_opts, opts, name, vlan) < 0) { + if (net_client_init_fun[opts->kind](opts, name, vlan) < 0) { /* TODO push error reporting into init() methods */ error_set(errp, QERR_DEVICE_INIT_FAILED, NetClientOptionsKind_lookup[opts->kind]); @@ -920,7 +918,7 @@ int net_client_init(QemuOpts *opts, int is_netdev, Error **errp) } if (!err) { - ret = net_client_init1(object, is_netdev, opts, &err); + ret = net_client_init1(object, is_netdev, &err); } if (object) { diff --git a/net/dump.c b/net/dump.c index f3d2fa9..b575430 100644 --- a/net/dump.c +++ b/net/dump.c @@ -144,8 +144,8 @@ static int net_dump_init(VLANState *vlan, const char *device, return 0; } -int net_init_dump(QemuOpts *old_opts, const NetClientOptions *opts, - const char *name, VLANState *vlan) +int net_init_dump(const NetClientOptions *opts, const char *name, + VLANState *vlan) { int len; const char *file; diff --git a/net/dump.h b/net/dump.h index 85ac00b..0fa2dd7 100644 --- a/net/dump.h +++ b/net/dump.h @@ -25,10 +25,9 @@ #define QEMU_NET_DUMP_H #include "net.h" -#include "qemu-common.h" #include "qapi-types.h" -int net_init_dump(QemuOpts *opts, const NetClientOptions *new_opts, - const char *name, VLANState *vlan); +int net_init_dump(const NetClientOptions *opts, const char *name, + VLANState *vlan); #endif /* QEMU_NET_DUMP_H */ diff --git a/net/slirp.c b/net/slirp.c index 44b059f..5c2e6b2 100644 --- a/net/slirp.c +++ b/net/slirp.c @@ -702,8 +702,8 @@ net_init_slirp_configs(const StringList *fwd, int flags) } } -int net_init_slirp(QemuOpts *old_opts, const NetClientOptions *opts, - const char *name, VLANState *vlan) +int net_init_slirp(const NetClientOptions *opts, const char *name, + VLANState *vlan) { struct slirp_config_str *config; char *vnet; diff --git a/net/slirp.h b/net/slirp.h index ef13a65..e2c71ee 100644 --- a/net/slirp.h +++ b/net/slirp.h @@ -31,8 +31,8 @@ #ifdef CONFIG_SLIRP -int net_init_slirp(QemuOpts *opts, const NetClientOptions *new_opts, - const char *name, VLANState *vlan); +int net_init_slirp(const NetClientOptions *opts, const char *name, + VLANState *vlan); void net_slirp_hostfwd_add(Monitor *mon, const QDict *qdict); void net_slirp_hostfwd_remove(Monitor *mon, const QDict *qdict); diff --git a/net/socket.c b/net/socket.c index e3cba20..600c287 100644 --- a/net/socket.c +++ b/net/socket.c @@ -586,8 +586,8 @@ static int net_socket_udp_init(VLANState *vlan, return 0; } -int net_init_socket(QemuOpts *old_opts, const NetClientOptions *opts, - const char *name, VLANState *vlan) +int net_init_socket(const NetClientOptions *opts, const char *name, + VLANState *vlan) { const NetdevSocketOptions *sock; diff --git a/net/socket.h b/net/socket.h index e44d26e..c4809ad 100644 --- a/net/socket.h +++ b/net/socket.h @@ -25,10 +25,9 @@ #define QEMU_NET_SOCKET_H #include "net.h" -#include "qemu-common.h" #include "qapi-types.h" -int net_init_socket(QemuOpts *opts, const NetClientOptions *new_opts, - const char *name, VLANState *vlan); +int net_init_socket(const NetClientOptions *opts, const char *name, + VLANState *vlan); #endif /* QEMU_NET_SOCKET_H */ diff --git a/net/tap-win32.c b/net/tap-win32.c index b6099cd..2328072 100644 --- a/net/tap-win32.c +++ b/net/tap-win32.c @@ -699,8 +699,8 @@ static int tap_win32_init(VLANState *vlan, const char *model, return 0; } -int net_init_tap(QemuOpts *old_opts, const NetClientOptions *opts, - const char *name, VLANState *vlan) +int net_init_tap(const NetClientOptions *opts, const char *name, + VLANState *vlan) { const NetdevTapOptions *tap; diff --git a/net/tap.c b/net/tap.c index d2736ea..7206227 100644 --- a/net/tap.c +++ b/net/tap.c @@ -513,8 +513,8 @@ static int net_bridge_run_helper(const char *helper, const char *bridge) return -1; } -int net_init_bridge(QemuOpts *old_opts, const NetClientOptions *opts, - const char *name, VLANState *vlan) +int net_init_bridge(const NetClientOptions *opts, const char *name, + VLANState *vlan) { const NetdevBridgeOptions *bridge; const char *helper, *br; @@ -586,8 +586,8 @@ static int net_tap_init(const NetdevTapOptions *tap, int *vnet_hdr, return fd; } -int net_init_tap(QemuOpts *old_opts, const NetClientOptions *opts, - const char *name, VLANState *vlan) +int net_init_tap(const NetClientOptions *opts, const char *name, + VLANState *vlan) { const NetdevTapOptions *tap; diff --git a/net/tap.h b/net/tap.h index f092129..19dea58 100644 --- a/net/tap.h +++ b/net/tap.h @@ -27,14 +27,13 @@ #define QEMU_NET_TAP_H #include "qemu-common.h" -#include "qemu-option.h" #include "qapi-types.h" #define DEFAULT_NETWORK_SCRIPT "/etc/qemu-ifup" #define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/qemu-ifdown" -int net_init_tap(QemuOpts *opts, const NetClientOptions *new_opts, - const char *name, VLANState *vlan); +int net_init_tap(const NetClientOptions *opts, const char *name, + VLANState *vlan); int tap_open(char *ifname, int ifname_size, int *vnet_hdr, int vnet_hdr_required); @@ -59,7 +58,7 @@ int tap_get_fd(VLANClientState *vc); struct vhost_net; struct vhost_net *tap_get_vhost_net(VLANClientState *vc); -int net_init_bridge(QemuOpts *opts, const NetClientOptions *new_opts, - const char *name, VLANState *vlan); +int net_init_bridge(const NetClientOptions *opts, const char *name, + VLANState *vlan); #endif /* QEMU_NET_TAP_H */ diff --git a/net/vde.c b/net/vde.c index 703888c..ee19f5c 100644 --- a/net/vde.c +++ b/net/vde.c @@ -110,8 +110,8 @@ static int net_vde_init(VLANState *vlan, const char *model, return 0; } -int net_init_vde(QemuOpts *old_opts, const NetClientOptions *opts, - const char *name, VLANState *vlan) +int net_init_vde(const NetClientOptions *opts, const char *name, + VLANState *vlan) { const NetdevVdeOptions *vde; diff --git a/net/vde.h b/net/vde.h index 5fc17f9..ad502ef 100644 --- a/net/vde.h +++ b/net/vde.h @@ -25,13 +25,12 @@ #define QEMU_NET_VDE_H #include "qemu-common.h" -#include "qemu-option.h" #include "qapi-types.h" #ifdef CONFIG_VDE -int net_init_vde(QemuOpts *opts, const NetClientOptions *new_opts, - const char *name, VLANState *vlan); +int net_init_vde(const NetClientOptions *opts, const char *name, + VLANState *vlan); #endif /* CONFIG_VDE */