From patchwork Tue Jan 24 09:42:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 9534719 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 087EE601D3 for ; Tue, 24 Jan 2017 10:05:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F06FC24DA2 for ; Tue, 24 Jan 2017 10:05:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E3CD326BE9; Tue, 24 Jan 2017 10:05:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 59C3126907 for ; Tue, 24 Jan 2017 10:05:34 +0000 (UTC) Received: from localhost ([::1]:47329 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cVxyn-0002U9-2U for patchwork-qemu-devel@patchwork.kernel.org; Tue, 24 Jan 2017 05:05:33 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41828) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cVxct-00004q-In for qemu-devel@nongnu.org; Tue, 24 Jan 2017 04:42:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cVxcp-0001qk-C6 for qemu-devel@nongnu.org; Tue, 24 Jan 2017 04:42:55 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46364) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cVxcp-0001qP-5y for qemu-devel@nongnu.org; Tue, 24 Jan 2017 04:42:51 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4F71F80508 for ; Tue, 24 Jan 2017 09:42:51 +0000 (UTC) Received: from thh440s.redhat.com (ovpn-116-35.ams2.redhat.com [10.36.116.35]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v0O9gnAc006681; Tue, 24 Jan 2017 04:42:50 -0500 From: Thomas Huth To: Jason Wang , qemu-devel@nongnu.org Date: Tue, 24 Jan 2017 10:42:49 +0100 Message-Id: <1485250969-5472-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 24 Jan 2017 09:42:51 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] net: Mark 'vlan' parameter as deprecated X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 --- net/net.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/net/net.c b/net/net.c index 939fe31..fb7af3a 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) {