From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:54038) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RtwZ3-00030x-CL for qemu-devel@nongnu.org; Sun, 05 Feb 2012 02:31:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RtwYy-00053b-TJ for qemu-devel@nongnu.org; Sun, 05 Feb 2012 02:31:09 -0500 Received: from mail-pw0-f45.google.com ([209.85.160.45]:64557) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RtwYy-000539-NM for qemu-devel@nongnu.org; Sun, 05 Feb 2012 02:31:04 -0500 Received: by pbaa11 with SMTP id a11so5506353pba.4 for ; Sat, 04 Feb 2012 23:31:02 -0800 (PST) Message-ID: <4F2EAEC1.8010801@gmail.com> Date: Mon, 06 Feb 2012 01:30:57 +0900 From: Benjamin MIME-Version: 1.0 References: <4F1EF6CE.9060306@gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [QEMU] net: adapt dump to support the new syntax List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: Stefan Hajnoczi , qemu-devel On 01/24/12 20:58, Markus Armbruster wrote: > Stefan Hajnoczi writes: > >> On Tue, Jan 24, 2012 at 6:22 PM, Benjamin wrote: >>> Hello Stefan, >> >> Hi, >> Please send QEMU development emails to the mailing list so others can >> help or we can avoid duplicating work in case someone else is already >> looking into this. I have CCed the mailing list. >> >>> I've seen your blog and I hope you can help me address the issue of >>> -net dump not being compatible with the new -netdev syntax. >> >> The reason is because packet capture is implemented as a net client - >> it receives packets on the "VLAN" and writes them to the pcap file. >> In the -netdev model each client has a peer (another net client that >> is communicates with). So it's not possible to plug the "dump" net >> client together with an emulated NIC client and a host tap client, for >> example. Since "VLANs" broadcast packets to all attached net clients >> it works there. >> >>> I think it is possible to achieve but I've had a lot of trouble >>> understanding the code, VLANs are everywhere and even though the new >>> syntax doesn't use them it looks like the code still uses a VLAN logic. >>> >>> Before I really start to get serious about this task, do you have any >>> advice or recommendation? >> >> I refactored the network subsystem to drop the "VLAN" concept a while >> back but never got around to submitting the patches: >> >> http://repo.or.cz/w/qemu/stefanha.git/shortlog/refs/heads/vlan-hub >> >> This branch completely removes the "VLAN" feature. Instead it >> introduces hubs, which are net clients that have multiple ports and >> broadcast packets between them. This allows you to achieve the same >> behavior as "VLANs" except we remove all the hardcoded special cases >> in the net subsystem and instead push that feature out into the hub >> net client. > > Sounds more advanced than my experimental hackery to kill VLANs. > >> If you rebase the vlan-hub branch onto a recent qemu.git, then you can >> use -netdev syntax to create an emulated NIC, host device, dump >> device, and a hub. The three clients must be attached to the hub. >> >> I think the code is already there, it should work. I didn't submit >> this because I wanted to implement automated tests to ensure that >> these changes don't brake the old syntax for "VLANs". >> >> Feel free to play around with the vlan-hub branch, test it, and push >> it upstream along with changes that you make. > > Yes, please. I will rebase it and test it then. Thanks.