summaryrefslogtreecommitdiffstats
path: root/net/net.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/net.c')
-rw-r--r--net/net.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/net/net.c b/net/net.c
index 29f83983e5..efb9eaf779 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;
}