aboutsummaryrefslogtreecommitdiff
path: root/net.c
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@redhat.com>2012-04-12 13:20:40 -0300
committerLuiz Capitulino <lcapitulino@redhat.com>2012-06-04 13:49:35 -0300
commit42dcc547e1982f31d0f678e02f0aae5be570384a (patch)
tree79b4c258f03b57ea509d5a111848ea9f3ec0bb98 /net.c
parent60d5666f7d4eec6df4a3d066769009f0c1a685bf (diff)
downloadqemu-42dcc547e1982f31d0f678e02f0aae5be570384a.zip
qemu-42dcc547e1982f31d0f678e02f0aae5be570384a.tar.gz
qemu-42dcc547e1982f31d0f678e02f0aae5be570384a.tar.bz2
net: purge the monitor object from all init functions
The only backend that really uses it is the socket one, which calls monitor_get_fd(). But it can use 'cur_mon' instead. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-By: Laszlo Ersek <lersek@redhat.com>
Diffstat (limited to 'net.c')
-rw-r--r--net.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/net.c b/net.c
index 246209f..adb7e20 100644
--- a/net.c
+++ b/net.c
@@ -745,10 +745,7 @@ int net_handle_fd_param(Monitor *mon, const char *param)
return fd;
}
-static int net_init_nic(QemuOpts *opts,
- Monitor *mon,
- const char *name,
- VLANState *vlan)
+static int net_init_nic(QemuOpts *opts, const char *name, VLANState *vlan)
{
int idx;
NICInfo *nd;
@@ -821,7 +818,6 @@ static int net_init_nic(QemuOpts *opts,
}
typedef int (*net_client_init_func)(QemuOpts *opts,
- Monitor *mon,
const char *name,
VLANState *vlan);
@@ -1085,7 +1081,7 @@ static const struct {
#endif /* CONFIG_NET_BRIDGE */
};
-int net_client_init(Monitor *mon, QemuOpts *opts, int is_netdev)
+int net_client_init(QemuOpts *opts, int is_netdev)
{
const char *name;
const char *type;
@@ -1156,7 +1152,7 @@ int net_client_init(Monitor *mon, QemuOpts *opts, int is_netdev)
ret = 0;
if (net_client_types[i].init) {
- ret = net_client_types[i].init(opts, mon, name, vlan);
+ ret = net_client_types[i].init(opts, name, vlan);
if (ret < 0) {
/* TODO push error reporting into init() methods */
qerror_report(QERR_DEVICE_INIT_FAILED, type);
@@ -1213,7 +1209,7 @@ void net_host_device_add(Monitor *mon, const QDict *qdict)
qemu_opt_set(opts, "type", device);
- if (net_client_init(mon, opts, 0) < 0) {
+ if (net_client_init(opts, 0) < 0) {
monitor_printf(mon, "adding host network device %s failed\n", device);
}
}
@@ -1248,7 +1244,7 @@ int do_netdev_add(Monitor *mon, const QDict *qdict, QObject **ret_data)
return -1;
}
- res = net_client_init(mon, opts, 1);
+ res = net_client_init(opts, 1);
if (res < 0) {
qemu_opts_del(opts);
}
@@ -1431,14 +1427,14 @@ void net_check_clients(void)
static int net_init_client(QemuOpts *opts, void *dummy)
{
- if (net_client_init(NULL, opts, 0) < 0)
+ if (net_client_init(opts, 0) < 0)
return -1;
return 0;
}
static int net_init_netdev(QemuOpts *opts, void *dummy)
{
- return net_client_init(NULL, opts, 1);
+ return net_client_init(opts, 1);
}
int net_init_clients(void)