qemu_opt_set(opts, "type", "nic");
qemu_opt_set(opts, "model", "usb");
- idx = net_client_init_from_opts(NULL, opts);
+ idx = net_client_init(NULL, opts);
if (idx == -1) {
return -1;
}
return 0;
}
-#define MAX_NET_CLIENTS 32
-
#ifndef _WIN32
static void termsig_handler(int signal)
DisplayState *ds;
DisplayChangeListener *dcl;
int cyls, heads, secs, translation;
- const char *net_clients[MAX_NET_CLIENTS];
- int nb_net_clients;
QemuOpts *hda_opts = NULL, *opts;
int optind;
const char *r, *optarg;
node_cpumask[i] = 0;
}
- nb_net_clients = 0;
nb_numa_nodes = 0;
nb_nics = 0;
break;
#endif
case QEMU_OPTION_net:
- if (nb_net_clients >= MAX_NET_CLIENTS) {
- fprintf(stderr, "qemu: too many network clients\n");
+ if (net_client_parse(optarg) == -1) {
exit(1);
}
- net_clients[nb_net_clients] = optarg;
- nb_net_clients++;
break;
#ifdef CONFIG_SLIRP
case QEMU_OPTION_tftp:
socket_init();
#endif
- /* init network clients */
- if (nb_net_clients == 0) {
- /* if no clients, we use a default config */
- net_clients[nb_net_clients++] = "nic";
-#ifdef CONFIG_SLIRP
- net_clients[nb_net_clients++] = "user";
-#endif
- }
-
- for(i = 0;i < nb_net_clients; i++) {
- if (net_client_parse(net_clients[i]) < 0)
- exit(1);
+ if (net_init_clients() < 0) {
+ exit(1);
}
net_boot = (boot_devices_bitmap >> ('n' - 'a')) & 0xF;
net_set_boot_mask(net_boot);
- net_client_check();
-
/* init the bluetooth world */
if (foreach_device_config(DEV_BT, bt_parse))
exit(1);