From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34346) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8s2z-0003jz-VT for qemu-devel@nongnu.org; Tue, 15 Dec 2015 11:02:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a8s2v-0006d7-1t for qemu-devel@nongnu.org; Tue, 15 Dec 2015 11:01:53 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37508) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8s2u-0006cz-QJ for qemu-devel@nongnu.org; Tue, 15 Dec 2015 11:01:48 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 40F373B3C7 for ; Tue, 15 Dec 2015 16:01:48 +0000 (UTC) References: <1450179992-15959-1-git-send-email-thuth@redhat.com> <56700CBA.5010505@redhat.com> From: Thomas Huth Message-ID: <56703969.9050905@redhat.com> Date: Tue, 15 Dec 2015 17:01:45 +0100 MIME-Version: 1.0 In-Reply-To: <56700CBA.5010505@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] net: Inform the user about deprecated -net options List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , qemu-devel@nongnu.org, Jason Wang On 15/12/15 13:51, Paolo Bonzini wrote: >=20 > On 15/12/2015 12:46, Thomas Huth wrote: >> We likely don't want to maintain the legacy -net options forever, >> so let's start informing the users that this option will be >> removed in a future version. However, there are two cases where >> we should not spill out a message yet: First is the "-net nic" >> option which might still be required to configure on-board NICs >> that can not be handled via "-netdev" yet, and second is the >> "-net user" default option that is created automatically when >> no other networking option has been specified. >> >> 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 ade6051..2593961 100644 >> --- a/net/net.c >> +++ b/net/net.c >> @@ -1006,6 +1006,12 @@ static int net_client_init1(const void *object,= int is_netdev, Error **errp) >> return -1; >> } >> =20 >> + if (opts->type !=3D NET_CLIENT_OPTIONS_KIND_NIC && >> + (!default_net || opts->type !=3D NET_CLIENT_OPTIONS_KIND_= USER)) { >> + error_report("Deprecated net option - " >> + "this will be removed in a future version!")= ; >> + } >=20 > Honestly, I still do not believe that they will be removed. They are > little more than syntactic sugar at this point. As far as I can tell, that "-net" vs. "-netdev" dualism causes quite ofte= n confusion for the users. Some options work with "-net", some only work with "-netde= v", and the ones that work with both often also behave slightly differently (= see [1] for example). I've already had to deal with a bug ticket in this area= , and it's just cumbersome to always find out and explain the differences. One other example is the "-net nic,model=3D?" help text. It is inaccurate= for a couple of machines - and if somebody tries to fix problems like this, you= 're often told something like "oh, it's the legacy -net option, simply forget= about that" [2]. And if you additionally ever had to deal with all that vlan code and dupl= icated option parsing stuff in the net/ code, then you certainly do not think an= ymore that this is just a little bit more than "syntactic sugar". I'm fine if we keep the "-net" options for a couple of more versions of Q= EMU, but we should be prepared to be able to remove it quickly once it is gett= ing into the way again too much. So we better start nagging the users about "-net"= being deprecated now, than discovering later that we have to deal with this leg= acy stuff for longer than we would like to. Thomas [1] http://www.linuxquestions.org/questions/linux-virtualization-and-clou= d-90/cannot-set-mac-address-with-qemu-4175490716/ [2] https://lists.gnu.org/archive/html/qemu-ppc/2013-10/msg00088.html