net: Use hubs for the vlan feature

Stop using the special-case vlan code in net.c.  Instead use the hub net
client to implement the vlan feature.  The next patch will remove vlan
code from net.c completely.

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:05 +01:00
parent f6c874e300
commit d33d93b2c4
14 changed files with 85 additions and 75 deletions

View File

@ -673,7 +673,7 @@ static NetClientInfo net_tap_win32_info = {
.cleanup = tap_cleanup,
};
static int tap_win32_init(VLANState *vlan, const char *model,
static int tap_win32_init(VLANClientState *peer, const char *model,
const char *name, const char *ifname)
{
VLANClientState *nc;
@ -685,7 +685,7 @@ static int tap_win32_init(VLANState *vlan, const char *model,
return -1;
}
nc = qemu_new_net_client(&net_tap_win32_info, vlan, NULL, model, name);
nc = qemu_new_net_client(&net_tap_win32_info, NULL, peer, model, name);
s = DO_UPCAST(TAPState, nc, nc);
@ -700,7 +700,7 @@ static int tap_win32_init(VLANState *vlan, const char *model,
}
int net_init_tap(const NetClientOptions *opts, const char *name,
VLANState *vlan)
VLANClientState *peer)
{
const NetdevTapOptions *tap;
@ -712,7 +712,7 @@ int net_init_tap(const NetClientOptions *opts, const char *name,
return -1;
}
if (tap_win32_init(vlan, "tap", name, tap->ifname) == -1) {
if (tap_win32_init(peer, "tap", name, tap->ifname) == -1) {
return -1;
}