aboutsummaryrefslogtreecommitdiff
path: root/net/net.c
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2017-01-24 10:42:49 +0100
committerJason Wang <jasowang@redhat.com>2017-02-15 11:18:57 +0800
commita2dbe1356faff3cb613ae83b77c484a203be5f15 (patch)
treef8a4c65f79293a55244b104d04e1aaba6708f5da /net/net.c
parent5dae13cd71f0755a1395b5a4cde635b8a6ee3f58 (diff)
net: Mark 'vlan' parameter as deprecated
The 'vlan' parameter is a continuous source of confusion for the users, many people mix it up with the more common term VLAN (the link layer packet encapsulation), and even if they realize that the QEMU 'vlan' is rather some kind of network hub emulation, there is still a high risk that they configure their QEMU networking in a wrong way with this parameter (e.g. by hooking NICs together, so they get a 'loopback' between one and the other NIC). Thus at one point in time, we should finally get rid of the 'vlan' feature in QEMU. Let's do a first step in this direction by declaring the 'vlan' parameter as deprecated and informing the users to use the 'netdev' parameter instead. Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'net/net.c')
-rw-r--r--net/net.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/net.c b/net/net.c
index 939fe3193a..fb7af3a432 100644
--- a/net/net.c
+++ b/net/net.c
@@ -970,6 +970,7 @@ 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;
@@ -1050,6 +1051,11 @@ static int net_client_init1(const void *object, bool is_netdev, Error **errp)
!opts->u.nic.data->has_netdev) {
peer = net_hub_add_port(net->has_vlan ? net->vlan : 0, NULL);
}
+
+ if (net->has_vlan && !vlan_warned) {
+ error_report("'vlan' is deprecated. Please use 'netdev' instead.");
+ vlan_warned = true;
+ }
}
if (net_client_init_fun[netdev->type](netdev, name, peer, errp) < 0) {