return -1;
}
s = net_tap_fd_init(vlan, model, name, fd);
- if (!s)
- return -1;
snprintf(s->vc->info_str, sizeof(s->vc->info_str),
"ifname=%s,script=%s,downscript=%s",
ifname, setup_script, down_script);
vlan_id = strtol(buf, NULL, 0);
}
vlan = qemu_find_vlan(vlan_id);
- if (!vlan) {
- fprintf(stderr, "Could not create vlan %d\n", vlan_id);
- return -1;
- }
+
if (get_param_value(buf, sizeof(buf), "name", p)) {
name = strdup(buf);
}
if (get_param_value(buf, sizeof(buf), "fd", p) > 0) {
fd = strtol(buf, NULL, 0);
fcntl(fd, F_SETFL, O_NONBLOCK);
- ret = -1;
- if (net_tap_fd_init(vlan, device, name, fd))
- ret = 0;
+ net_tap_fd_init(vlan, device, name, fd);
+ ret = 0;
} else {
if (get_param_value(ifname, sizeof(ifname), "ifname", p) <= 0) {
ifname[0] = '\0';
VLANClientState *vc;
vlan = qemu_find_vlan(vlan_id);
- if (!vlan) {
- monitor_printf(mon, "can't find vlan %d\n", vlan_id);
- return;
- }
for(vc = vlan->first_client; vc != NULL; vc = vc->next)
if (!strcmp(vc->name, device))