aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2018-05-14 14:15:27 +0100
committerPeter Maydell <peter.maydell@linaro.org>2018-05-14 14:15:27 +0100
commit7a9180b77eca258ab418ec00ab397392e70e55d9 (patch)
tree32f36e18f92dc949195da0db6fe7ee3985f18ec1 /net
parentbbd87423ea0c436c55bbc3f9c23d4f811d1f3f29 (diff)
parent0e0266c2e475b82b39a757c875fa03e64272fbe7 (diff)
downloadqemu-7a9180b77eca258ab418ec00ab397392e70e55d9.zip
qemu-7a9180b77eca258ab418ec00ab397392e70e55d9.tar.gz
qemu-7a9180b77eca258ab418ec00ab397392e70e55d9.tar.bz2
Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging
# gpg: Signature made Mon 14 May 2018 08:51:53 BST # gpg: using RSA key EF04965B398D6211 # gpg: Good signature from "Jason Wang (Jason Wang on RedHat) <jasowang@redhat.com>" # gpg: WARNING: This key is not certified with sufficiently trusted signatures! # gpg: It is not certain that the signature belongs to the owner. # Primary key fingerprint: 215D 46F4 8246 689E C77F 3562 EF04 965B 398D 6211 * remotes/jasowang/tags/net-pull-request: net: Get rid of 'vlan' terminology and use 'hub' instead in the doc files net: Get rid of 'vlan' terminology and use 'hub' instead in the source files net: Remove the deprecated "vlan" parameter net: Fix memory leak in net_param_nic() Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'net')
-rw-r--r--net/hub.c7
-rw-r--r--net/net.c18
-rw-r--r--net/slirp.c8
-rw-r--r--net/tap.c4
4 files changed, 16 insertions, 21 deletions
diff --git a/net/hub.c b/net/hub.c
index 5e84a9a..78b671e 100644
--- a/net/hub.c
+++ b/net/hub.c
@@ -23,8 +23,7 @@
/*
* A hub broadcasts incoming packets to all its ports except the source port.
- * Hubs can be used to provide independent network segments, also confusingly
- * named the QEMU 'vlan' feature.
+ * Hubs can be used to provide independent emulated network segments.
*/
typedef struct NetHub NetHub;
@@ -345,10 +344,10 @@ void net_hub_check_clients(void)
}
}
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) {
- warn_report("vlan %d is not connected to host network", hub->id);
+ warn_report("hub %d is not connected to host network", hub->id);
}
}
}
diff --git a/net/net.c b/net/net.c
index 29f8398..efb9eaf 100644
--- a/net/net.c
+++ b/net/net.c
@@ -965,7 +965,6 @@ static int net_client_init1(const void *object, bool is_netdev, Error **errp)
const Netdev *netdev;
const char *name;
NetClientState *peer = NULL;
- static bool vlan_warned;
if (is_netdev) {
netdev = object;
@@ -1036,15 +1035,10 @@ static int net_client_init1(const void *object, bool is_netdev, Error **errp)
return -1;
}
- /* Do not add to a vlan if it's a nic with a netdev= parameter. */
+ /* Do not add to a hub if it's a nic with a netdev= parameter. */
if (netdev->type != NET_CLIENT_DRIVER_NIC ||
!opts->u.nic.has_netdev) {
- peer = net_hub_add_port(net->has_vlan ? net->vlan : 0, NULL, NULL);
- }
-
- if (net->has_vlan && !vlan_warned) {
- error_report("'vlan' is deprecated. Please use 'netdev' instead.");
- vlan_warned = true;
+ peer = net_hub_add_port(0, NULL, NULL);
}
}
@@ -1365,7 +1359,7 @@ void qmp_set_link(const char *name, bool up, Error **errp)
* If the peer is a HUBPORT or a backend, we do not change the
* link status.
*
- * This behavior is compatible with qemu vlans where there could be
+ * This behavior is compatible with qemu hubs where there could be
* multiple clients that can still communicate with each other in
* disconnected mode. For now maintain this compatibility.
*/
@@ -1502,11 +1496,12 @@ static int net_param_nic(void *dummy, QemuOpts *opts, Error **errp)
g_free(mac);
if (ret) {
error_setg(errp, "invalid syntax for ethernet address");
- return -1;
+ goto out;
}
if (is_multicast_ether_addr(ni->macaddr.a)) {
error_setg(errp, "NIC cannot have multicast MAC address");
- return -1;
+ ret = -1;
+ goto out;
}
}
qemu_macaddr_default_if_unset(&ni->macaddr);
@@ -1518,6 +1513,7 @@ static int net_param_nic(void *dummy, QemuOpts *opts, Error **errp)
nb_nics++;
}
+out:
g_free(nd_id);
return ret;
}
diff --git a/net/slirp.c b/net/slirp.c
index 8991816..6922524 100644
--- a/net/slirp.c
+++ b/net/slirp.c
@@ -415,7 +415,7 @@ static SlirpState *slirp_lookup(Monitor *mon, const char *hub_id,
if (hub_id) {
nc = net_hub_find_client_by_name(strtol(hub_id, NULL, 0), name);
if (!nc) {
- monitor_printf(mon, "unrecognized (vlan-id, stackname) pair\n");
+ monitor_printf(mon, "unrecognized (hub-id, stackname) pair\n");
return NULL;
}
} else {
@@ -870,9 +870,9 @@ void hmp_info_usernet(Monitor *mon, const QDict *qdict)
QTAILQ_FOREACH(s, &slirp_stacks, entry) {
int id;
- bool got_vlan_id = net_hub_id_for_client(&s->nc, &id) == 0;
- monitor_printf(mon, "VLAN %d (%s):\n",
- got_vlan_id ? id : -1,
+ bool got_hub_id = net_hub_id_for_client(&s->nc, &id) == 0;
+ monitor_printf(mon, "Hub %d (%s):\n",
+ got_hub_id ? id : -1,
s->nc.name);
slirp_connection_info(s->slirp, mon);
}
diff --git a/net/tap.c b/net/tap.c
index 2b3a36f..de05f20 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -766,10 +766,10 @@ int net_init_tap(const Netdev *netdev, const char *name,
queues = tap->has_queues ? tap->queues : 1;
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. */
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;
}