}
nd->vlan = vlan;
nb_nics++;
+ vlan->nb_guest_devs++;
ret = 0;
} else
if (!strcmp(device, "none")) {
if (get_param_value(buf, sizeof(buf), "hostname", p)) {
pstrcpy(slirp_hostname, sizeof(slirp_hostname), buf);
}
+ vlan->nb_host_devs++;
ret = net_slirp_init(vlan);
} else
#endif
fprintf(stderr, "tap: no interface name\n");
return -1;
}
+ vlan->nb_host_devs++;
ret = tap_win32_init(vlan, ifname);
} else
#else
if (get_param_value(setup_script, sizeof(setup_script), "script", p) == 0) {
pstrcpy(setup_script, sizeof(setup_script), DEFAULT_NETWORK_SCRIPT);
}
+ vlan->nb_host_devs++;
ret = net_tap_init(vlan, ifname, setup_script);
}
} else
fprintf(stderr, "Unknown socket options: %s\n", p);
return -1;
}
+ vlan->nb_host_devs++;
} else
{
fprintf(stderr, "Unknown network device: %s\n", device);
int usb_devices_index;
int fds[2];
const char *pid_file = NULL;
+ VLANState *vlan;
LIST_INIT (&vm_change_state_head);
#ifndef _WIN32
if (net_client_init(net_clients[i]) < 0)
exit(1);
}
+ for(vlan = first_vlan; vlan != NULL; vlan = vlan->next) {
+ if (vlan->nb_guest_devs == 0 && vlan->nb_host_devs == 0)
+ continue;
+ if (vlan->nb_guest_devs == 0) {
+ fprintf(stderr, "Invalid vlan (%d) with no nics\n", vlan->id);
+ exit(1);
+ }
+ if (vlan->nb_host_devs == 0)
+ fprintf(stderr,
+ "Warning: vlan %d is not connected to host network\n",
+ vlan->id);
+ }
#ifdef TARGET_I386
if (boot_device == 'n') {