qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] net: Mark the 'hubport' netdev as deprecated


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH] net: Mark the 'hubport' netdev as deprecated
Date: Wed, 20 Sep 2017 18:50:21 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0

On 20/09/2017 13:57, Thomas Huth wrote:
> On 20.09.2017 13:07, Paolo Bonzini wrote:
>> On 20/09/2017 09:45, Thomas Huth wrote:
>>> On 24.05.2017 10:04, Thomas Huth wrote:
>>>> The 'hubport' netdev is closely tied to the 'vlan' concept which
>>>> has been marked as deprecated in commit a2dbe1356faff3cb6 already.
>>>> Thus we should also mark the hubport netdevs as deprecated to make
>>>> the remaining users aware that they should not use this anymore.
>>>>
>>>> Signed-off-by: Thomas Huth <address@hidden>
>>
>> What is the replacement for VLANs?
>>
>> The point of hub/hubport was to implement this without needing
>> special-casing of VLANs everywhere in the net/ directory.  VLANs remain
>> messy in terms of command-line expression for -net, but that's where the
>> problems end.
> 
> The QEMU "VLAN"s are a complete PITA for the users, they are causing
> confusion (e.g. https://bugs.launchpad.net/qemu/+bug/658904) and
> mis-configurations (see e.g.
> http://lists.gnu.org/archive/html/qemu-discuss/2017-08/msg00031.html).
> So I hope you agree that we should get rid of this "vlan" stuff in QEMU
> (no matter whether we continue to provide some kind of "hub" or "switch"
> instead or completely remove it).
> 
>> In fact, while there are some uses of VLANs that have been replaced by
>> filters, VLANs are still needed to place 2 NICs to be on the same guest
>> network without using a host bridge.  This should be a supported use
>> case for e.g. L2TP backends, and it can be important for users that
>> don't have the ability to configure a host bridge.
> 
> I don't think that anybody really wants to connect two NICs of one
> machine to a *hub* - all the network traffic of one NIC will go to the
> other, too! That might only make sense if you want to do some basic
> network driver tests in your guest, but for every normal OS, this is
> nonsense. You normally are also not doing this with real hardware (note
> that we're talking about hubs, not switches!).

Whether it's a hub or switch is an implementation detail; currently QEMU
supports hubs, which is probably a good idea because this _is_ a
somewhat fringe use and performance isn't super important.

> While that looks at least way more logical than the "vlan" parameter, I
> really doubt that we need a *hub* within QEMU. Emulating a switch might
> make at least a little bit more sense ... but still, do we really need
> this? Do you have any real world example where somebody is using QEMU
> for a configuration like this?

If you have two NICs and SLIRP, for example, the two NICs will be in
entirely different subnets and cannot talk to each other without setting
up something like proxy ARP in the guest.

> PS: Or are you just afraid that we might finally get rid of the short
> "-net nic -net tap" syntax, which is way easier to type than its -netdev
> equivalent? Well, I'd say that's a different topic, and we should come
> up with a new convenience option instead before we remove the old one.

No, this is a different topic.  It's just about hubs and providing a
replacement for these four lines of net/net.c:

     if (netdev->type != NET_CLIENT_DRIVER_NIC ||
         !opts->u.nic.has_netdev) {
         peer = net_hub_add_port(net->has_vlan ? net->vlan : 0, NULL);
     }

Regarding "-net", a replacement for "-net nic,vlan=0 -net tap,vlan=0
-net nic,vlan=1 -net tap,vlan=1" (where the connection is point-to-point
and vlans are pointless) already exists using "-net nic,netdev".  If you
removed VLANs then "-net nic -net tap" could be kept as syntactic sugar,
but "-net nic -net nic -net tap" would not.  Instead, you'd have to
declare the three hubports manually and use "-net nic,netdev=hubportN".

Paolo



reply via email to

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