From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:48823) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rpf1V-0006Ti-3q for qemu-devel@nongnu.org; Tue, 24 Jan 2012 06:58:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rpf1P-0006ru-1i for qemu-devel@nongnu.org; Tue, 24 Jan 2012 06:58:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:10466) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rpf1O-0006ro-Op for qemu-devel@nongnu.org; Tue, 24 Jan 2012 06:58:43 -0500 From: Markus Armbruster References: <4F1EF6CE.9060306@gmail.com> Date: Tue, 24 Jan 2012 12:58:38 +0100 In-Reply-To: (Stefan Hajnoczi's message of "Tue, 24 Jan 2012 10:42:06 +0000") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: Stefan Hajnoczi Cc: Benjamin , qemu-devel 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.