void *opaque);
VLANClientState *qemu_new_net_client(NetClientInfo *info,
- VLANState *vlan,
VLANClientState *peer,
const char *model,
const char *name)
vc->name = assign_name(vc, model);
}
- if (vlan) {
- assert(!peer);
- vc->vlan = vlan;
- QTAILQ_INSERT_TAIL(&vc->vlan->clients, vc, next);
- } else {
- if (peer) {
- assert(!peer->peer);
- vc->peer = peer;
- peer->peer = vc;
- }
- QTAILQ_INSERT_TAIL(&non_vlan_clients, vc, next);
-
- vc->send_queue = qemu_new_net_queue(qemu_deliver_packet,
- qemu_deliver_packet_iov,
- vc);
+ if (peer) {
+ assert(!peer->peer);
+ vc->peer = peer;
+ peer->peer = vc;
}
+ QTAILQ_INSERT_TAIL(&non_vlan_clients, vc, next);
+
+ vc->send_queue = qemu_new_net_queue(qemu_deliver_packet,
+ qemu_deliver_packet_iov,
+ vc);
return vc;
}
assert(info->type == NET_CLIENT_OPTIONS_KIND_NIC);
assert(info->size >= sizeof(NICState));
- nc = qemu_new_net_client(info, conf->vlan, conf->peer, model, name);
+ nc = qemu_new_net_client(info, conf->peer, model, name);
nic = DO_UPCAST(NICState, nc, nc);
nic->conf = conf;
VLANState *qemu_find_vlan(int id, int allocate);
VLANClientState *qemu_find_netdev(const char *id);
VLANClientState *qemu_new_net_client(NetClientInfo *info,
- VLANState *vlan,
VLANClientState *peer,
const char *model,
const char *name);
return -1;
}
- nc = qemu_new_net_client(&net_dump_info, NULL, peer, device, name);
+ nc = qemu_new_net_client(&net_dump_info, peer, device, name);
snprintf(nc->info_str, sizeof(nc->info_str),
"dump to %s (len=%d)", filename, len);
name = default_name;
}
- nc = qemu_new_net_client(&net_hub_port_info, NULL, NULL, "hub", name);
+ nc = qemu_new_net_client(&net_hub_port_info, NULL, "hub", name);
port = DO_UPCAST(NetHubPort, nc, nc);
port->id = id;
port->hub = hub;
}
#endif
- nc = qemu_new_net_client(&net_slirp_info, NULL, peer, model, name);
+ nc = qemu_new_net_client(&net_slirp_info, peer, model, name);
snprintf(nc->info_str, sizeof(nc->info_str),
"net=%s,restrict=%s", inet_ntoa(net),
}
}
- nc = qemu_new_net_client(&net_dgram_socket_info, NULL, peer, model, name);
+ nc = qemu_new_net_client(&net_dgram_socket_info, peer, model, name);
snprintf(nc->info_str, sizeof(nc->info_str),
"socket: fd=%d (%s mcast=%s:%d)",
VLANClientState *nc;
NetSocketState *s;
- nc = qemu_new_net_client(&net_socket_info, NULL, peer, model, name);
+ nc = qemu_new_net_client(&net_socket_info, peer, model, name);
snprintf(nc->info_str, sizeof(nc->info_str), "socket: fd=%d", fd);
return -1;
}
- nc = qemu_new_net_client(&net_tap_win32_info, NULL, peer, model, name);
+ nc = qemu_new_net_client(&net_tap_win32_info, peer, model, name);
s = DO_UPCAST(TAPState, nc, nc);
VLANClientState *nc;
TAPState *s;
- nc = qemu_new_net_client(&net_tap_info, NULL, peer, model, name);
+ nc = qemu_new_net_client(&net_tap_info, peer, model, name);
s = DO_UPCAST(TAPState, nc, nc);
return -1;
}
- nc = qemu_new_net_client(&net_vde_info, NULL, peer, model, name);
+ nc = qemu_new_net_client(&net_vde_info, peer, model, name);
snprintf(nc->info_str, sizeof(nc->info_str), "sock=%s,fd=%d",
sock, vde_datafd(vde));