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

@ -135,7 +135,7 @@ static NetClientInfo net_slirp_info = {
.cleanup = net_slirp_cleanup,
};
static int net_slirp_init(VLANState *vlan, const char *model,
static int net_slirp_init(VLANClientState *peer, const char *model,
const char *name, int restricted,
const char *vnetwork, const char *vhost,
const char *vhostname, const char *tftp_export,
@ -238,7 +238,7 @@ static int net_slirp_init(VLANState *vlan, const char *model,
}
#endif
nc = qemu_new_net_client(&net_slirp_info, vlan, NULL, model, name);
nc = qemu_new_net_client(&net_slirp_info, NULL, peer, model, name);
snprintf(nc->info_str, sizeof(nc->info_str),
"net=%s,restrict=%s", inet_ntoa(net),
@ -703,7 +703,7 @@ net_init_slirp_configs(const StringList *fwd, int flags)
}
int net_init_slirp(const NetClientOptions *opts, const char *name,
VLANState *vlan)
VLANClientState *peer)
{
struct slirp_config_str *config;
char *vnet;
@ -722,7 +722,7 @@ int net_init_slirp(const NetClientOptions *opts, const char *name,
net_init_slirp_configs(user->hostfwd, SLIRP_CFG_HOSTFWD);
net_init_slirp_configs(user->guestfwd, 0);
ret = net_slirp_init(vlan, "user", name, user->restrict, vnet, user->host,
ret = net_slirp_init(peer, "user", name, user->restrict, vnet, user->host,
user->hostname, user->tftp, user->bootfile,
user->dhcpstart, user->dns, user->smb,
user->smbserver);