From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36000) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8p4U-0003Qn-H2 for qemu-devel@nongnu.org; Tue, 15 Dec 2015 07:51:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a8p4P-0006KR-PS for qemu-devel@nongnu.org; Tue, 15 Dec 2015 07:51:14 -0500 Received: from mail-wm0-x234.google.com ([2a00:1450:400c:c09::234]:34611) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8p4P-0006K4-IQ for qemu-devel@nongnu.org; Tue, 15 Dec 2015 07:51:09 -0500 Received: by mail-wm0-x234.google.com with SMTP id p66so108436075wmp.1 for ; Tue, 15 Dec 2015 04:51:09 -0800 (PST) Sender: Paolo Bonzini References: <1450179992-15959-1-git-send-email-thuth@redhat.com> From: Paolo Bonzini Message-ID: <56700CBA.5010505@redhat.com> Date: Tue, 15 Dec 2015 13:51:06 +0100 MIME-Version: 1.0 In-Reply-To: <1450179992-15959-1-git-send-email-thuth@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit 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: Thomas Huth , qemu-devel@nongnu.org, Jason Wang 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; > } > > + if (opts->type != NET_CLIENT_OPTIONS_KIND_NIC && > + (!default_net || opts->type != NET_CLIENT_OPTIONS_KIND_USER)) { > + error_report("Deprecated net option - " > + "this will be removed in a future version!"); > + } Honestly, I still do not believe that they will be removed. They are little more than syntactic sugar at this point. Paolo > if (!net_client_init_fun[opts->type]) { > error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "type", > "a net backend type (maybe it is not compiled " >