qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: peter.maydell@linaro.org
Cc: qemu-devel@nongnu.org, Thomas Huth <thuth@redhat.com>,
	Jason Wang <jasowang@redhat.com>
Subject: [Qemu-devel] [PULL 1/5] net: Mark 'vlan' parameter as deprecated
Date: Wed, 15 Feb 2017 11:53:18 +0800	[thread overview]
Message-ID: <1487130802-27953-2-git-send-email-jasowang@redhat.com> (raw)
In-Reply-To: <1487130802-27953-1-git-send-email-jasowang@redhat.com>

From: Thomas Huth <thuth@redhat.com>

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>
---
 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) {
-- 
2.7.4

  reply	other threads:[~2017-02-15  3:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-15  3:53 [Qemu-devel] [PULL 0/5] Net patches Jason Wang
2017-02-15  3:53 ` Jason Wang [this message]
2017-02-15  3:53 ` [Qemu-devel] [PULL 2/5] net: e1000e: fix dead code in e1000e_write_packet_to_guest Jason Wang
2017-02-15  3:53 ` [Qemu-devel] [PULL 3/5] colo-compare: sort TCP packet queue by sequence number Jason Wang
2017-02-15  3:53 ` [Qemu-devel] [PULL 4/5] net: imx: limit buffer descriptor count Jason Wang
2017-02-15  3:53 ` [Qemu-devel] [PULL 5/5] net: e1000e: fix an infinite loop issue Jason Wang
2017-02-16 14:23 ` [Qemu-devel] [PULL 0/5] Net patches Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1487130802-27953-2-git-send-email-jasowang@redhat.com \
    --to=jasowang@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).