qemu_opt_set(opts, "type", "nic");
- ret = net_client_init(mon, opts, 0);
+ ret = net_client_init(opts, 0);
if (ret < 0)
return NULL;
if (nd_table[ret].devaddr) {
qemu_opt_set(opts, "type", "nic");
qemu_opt_set(opts, "model", "usb");
- idx = net_client_init(NULL, opts, 0);
+ idx = net_client_init(opts, 0);
if (idx == -1) {
return NULL;
}
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;
}
typedef int (*net_client_init_func)(QemuOpts *opts,
- Monitor *mon,
const char *name,
VLANState *vlan);
#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;
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);
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);
}
}
return -1;
}
- res = net_client_init(mon, opts, 1);
+ res = net_client_init(opts, 1);
if (res < 0) {
qemu_opts_del(opts);
}
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)
extern const char *legacy_tftp_prefix;
extern const char *legacy_bootp_filename;
-int net_client_init(Monitor *mon, QemuOpts *opts, int is_netdev);
+int net_client_init(QemuOpts *opts, int is_netdev);
int net_client_parse(QemuOptsList *opts_list, const char *str);
int net_init_clients(void);
void net_check_clients(void);
return 0;
}
-int net_init_dump(QemuOpts *opts, Monitor *mon, const char *name, VLANState *vlan)
+int net_init_dump(QemuOpts *opts, const char *name, VLANState *vlan)
{
int len;
const char *file;
#include "net.h"
#include "qemu-common.h"
-int net_init_dump(QemuOpts *opts, Monitor *mon,
- const char *name, VLANState *vlan);
+int net_init_dump(QemuOpts *opts, const char *name, VLANState *vlan);
#endif /* QEMU_NET_DUMP_H */
return 0;
}
-int net_init_slirp(QemuOpts *opts,
- Monitor *mon,
- const char *name,
- VLANState *vlan)
+int net_init_slirp(QemuOpts *opts, const char *name, VLANState *vlan)
{
struct slirp_config_str *config;
const char *vhost;
#ifdef CONFIG_SLIRP
-int net_init_slirp(QemuOpts *opts,
- Monitor *mon,
- const char *name,
- VLANState *vlan);
+int net_init_slirp(QemuOpts *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);
#include "config-host.h"
#include "net.h"
+#include "monitor.h"
#include "qemu-char.h"
#include "qemu-common.h"
#include "qemu-error.h"
return 0;
}
-int net_init_socket(QemuOpts *opts,
- Monitor *mon,
- const char *name,
- VLANState *vlan)
+int net_init_socket(QemuOpts *opts, const char *name, VLANState *vlan)
{
if (qemu_opt_get(opts, "fd")) {
int fd;
return -1;
}
- fd = net_handle_fd_param(mon, qemu_opt_get(opts, "fd"));
+ fd = net_handle_fd_param(cur_mon, qemu_opt_get(opts, "fd"));
if (fd == -1) {
return -1;
}
#include "net.h"
#include "qemu-common.h"
-int net_init_socket(QemuOpts *opts, Monitor *mon,
- const char *name, VLANState *vlan);
+int net_init_socket(QemuOpts *opts, const char *name, VLANState *vlan);
#endif /* QEMU_NET_SOCKET_H */
return 0;
}
-int net_init_tap(QemuOpts *opts, Monitor *mon, const char *name, VLANState *vlan)
+int net_init_tap(QemuOpts *opts, const char *name, VLANState *vlan)
{
const char *ifname;
return -1;
}
-int net_init_bridge(QemuOpts *opts, Monitor *mon, const char *name,
- VLANState *vlan)
+int net_init_bridge(QemuOpts *opts, const char *name, VLANState *vlan)
{
TAPState *s;
int fd, vnet_hdr;
return fd;
}
-int net_init_tap(QemuOpts *opts, Monitor *mon, const char *name, VLANState *vlan)
+int net_init_tap(QemuOpts *opts, const char *name, VLANState *vlan)
{
TAPState *s;
int fd, vnet_hdr = 0;
return -1;
}
- fd = net_handle_fd_param(mon, qemu_opt_get(opts, "fd"));
+ fd = net_handle_fd_param(cur_mon, qemu_opt_get(opts, "fd"));
if (fd == -1) {
return -1;
}
int vhostfd, r;
bool force = qemu_opt_get_bool(opts, "vhostforce", false);
if (qemu_opt_get(opts, "vhostfd")) {
- r = net_handle_fd_param(mon, qemu_opt_get(opts, "vhostfd"));
+ r = net_handle_fd_param(cur_mon, qemu_opt_get(opts, "vhostfd"));
if (r == -1) {
return -1;
}
#define DEFAULT_NETWORK_SCRIPT "/etc/qemu-ifup"
#define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/qemu-ifdown"
-int net_init_tap(QemuOpts *opts, Monitor *mon, const char *name, VLANState *vlan);
+int net_init_tap(QemuOpts *opts, const char *name, VLANState *vlan);
int tap_open(char *ifname, int ifname_size, int *vnet_hdr, int vnet_hdr_required);
struct vhost_net;
struct vhost_net *tap_get_vhost_net(VLANClientState *vc);
-int net_init_bridge(QemuOpts *opts, Monitor *mon, const char *name,
- VLANState *vlan);
+int net_init_bridge(QemuOpts *opts, const char *name, VLANState *vlan);
#endif /* QEMU_NET_TAP_H */
return 0;
}
-int net_init_vde(QemuOpts *opts, Monitor *mon, const char *name, VLANState *vlan)
+int net_init_vde(QemuOpts *opts, const char *name, VLANState *vlan)
{
const char *sock;
const char *group;
#ifdef CONFIG_VDE
-int net_init_vde(QemuOpts *opts, Monitor *mon, const char *name, VLANState *vlan);
+int net_init_vde(QemuOpts *opts, const char *name, VLANState *vlan);
#endif /* CONFIG_VDE */