net: Get rid of 'vlan' terminology and use 'hub' instead in the source files

'vlan' is very confusing since it does not mean something like IEEE
802.1Q, but rather emulated hubs, so let's switch to that terminology
instead.

Buglink: https://bugs.launchpad.net/qemu/+bug/658904
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
This commit is contained in:
Thomas Huth 2018-04-30 20:02:24 +02:00 committed by Jason Wang
parent af1a5c3eb4
commit 442da403ea
3 changed files with 9 additions and 10 deletions

View File

@ -23,8 +23,7 @@
/* /*
* A hub broadcasts incoming packets to all its ports except the source port. * A hub broadcasts incoming packets to all its ports except the source port.
* Hubs can be used to provide independent network segments, also confusingly * Hubs can be used to provide independent emulated network segments.
* named the QEMU 'vlan' feature.
*/ */
typedef struct NetHub NetHub; typedef struct NetHub NetHub;
@ -345,10 +344,10 @@ void net_hub_check_clients(void)
} }
} }
if (has_host_dev && !has_nic) { if (has_host_dev && !has_nic) {
warn_report("vlan %d with no nics", hub->id); warn_report("hub %d with no nics", hub->id);
} }
if (has_nic && !has_host_dev) { if (has_nic && !has_host_dev) {
warn_report("vlan %d is not connected to host network", hub->id); warn_report("hub %d is not connected to host network", hub->id);
} }
} }
} }

View File

@ -415,7 +415,7 @@ static SlirpState *slirp_lookup(Monitor *mon, const char *hub_id,
if (hub_id) { if (hub_id) {
nc = net_hub_find_client_by_name(strtol(hub_id, NULL, 0), name); nc = net_hub_find_client_by_name(strtol(hub_id, NULL, 0), name);
if (!nc) { if (!nc) {
monitor_printf(mon, "unrecognized (vlan-id, stackname) pair\n"); monitor_printf(mon, "unrecognized (hub-id, stackname) pair\n");
return NULL; return NULL;
} }
} else { } else {
@ -870,9 +870,9 @@ void hmp_info_usernet(Monitor *mon, const QDict *qdict)
QTAILQ_FOREACH(s, &slirp_stacks, entry) { QTAILQ_FOREACH(s, &slirp_stacks, entry) {
int id; int id;
bool got_vlan_id = net_hub_id_for_client(&s->nc, &id) == 0; bool got_hub_id = net_hub_id_for_client(&s->nc, &id) == 0;
monitor_printf(mon, "VLAN %d (%s):\n", monitor_printf(mon, "Hub %d (%s):\n",
got_vlan_id ? id : -1, got_hub_id ? id : -1,
s->nc.name); s->nc.name);
slirp_connection_info(s->slirp, mon); slirp_connection_info(s->slirp, mon);
} }

View File

@ -766,10 +766,10 @@ int net_init_tap(const Netdev *netdev, const char *name,
queues = tap->has_queues ? tap->queues : 1; queues = tap->has_queues ? tap->queues : 1;
vhostfdname = tap->has_vhostfd ? tap->vhostfd : NULL; vhostfdname = tap->has_vhostfd ? tap->vhostfd : NULL;
/* QEMU vlans does not support multiqueue tap, in this case peer is set. /* QEMU hubs do not support multiqueue tap, in this case peer is set.
* For -netdev, peer is always NULL. */ * For -netdev, peer is always NULL. */
if (peer && (tap->has_queues || tap->has_fds || tap->has_vhostfds)) { if (peer && (tap->has_queues || tap->has_fds || tap->has_vhostfds)) {
error_setg(errp, "Multiqueue tap cannot be used with QEMU vlans"); error_setg(errp, "Multiqueue tap cannot be used with hubs");
return -1; return -1;
} }