qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] net: Inform the user about deprecated -net opti


From: Thomas Huth
Subject: Re: [Qemu-devel] [PATCH] net: Inform the user about deprecated -net options
Date: Tue, 15 Dec 2015 17:01:45 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 15/12/15 13:51, Paolo Bonzini wrote:
> 
> 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 <address@hidden>
>> ---
>>  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.

As far as I can tell, that "-net" vs. "-netdev" dualism causes quite often 
confusion
for the users. Some options work with "-net", some only work with "-netdev",
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=?" 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 duplicated
option parsing stuff in the net/ code, then you certainly do not think anymore
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 QEMU,
but we should be prepared to be able to remove it quickly once it is getting 
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 legacy
stuff for longer than we would like to.

 Thomas


[1] 
http://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/cannot-set-mac-address-with-qemu-4175490716/
[2] https://lists.gnu.org/archive/html/qemu-ppc/2013-10/msg00088.html




reply via email to

[Prev in Thread] Current Thread [Next in Thread]