net: Drop vlan argument to qemu_new_net_client()

Since hubs are now used to implement the 'vlan' feature and the vlan
argument is always NULL, remove the argument entirely and update all net
clients that use qemu_new_net_client().

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
This commit is contained in:
Stefan Hajnoczi 2012-07-24 16:35:08 +01:00
parent 81017645e4
commit ab5f3f84c4
9 changed files with 18 additions and 26 deletions

27
net.c
View file

@ -197,7 +197,6 @@ static ssize_t qemu_deliver_packet_iov(VLANClientState *sender,
void *opaque);
VLANClientState *qemu_new_net_client(NetClientInfo *info,
VLANState *vlan,
VLANClientState *peer,
const char *model,
const char *name)
@ -216,22 +215,16 @@ VLANClientState *qemu_new_net_client(NetClientInfo *info,
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;
}
@ -248,7 +241,7 @@ NICState *qemu_new_nic(NetClientInfo *info,
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;