From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52919) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZHrdc-0001VU-P7 for qemu-devel@nongnu.org; Wed, 22 Jul 2015 06:52:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZHrdZ-000691-G9 for qemu-devel@nongnu.org; Wed, 22 Jul 2015 06:52:36 -0400 Received: from [59.151.112.132] (port=14247 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZHrdZ-00065r-4l for qemu-devel@nongnu.org; Wed, 22 Jul 2015 06:52:33 -0400 Message-ID: <55AF75E6.6070909@cn.fujitsu.com> Date: Wed, 22 Jul 2015 18:52:22 +0800 From: Yang Hongyang MIME-Version: 1.0 References: <1436773166-12113-1-git-send-email-thuth@redhat.com> In-Reply-To: <1436773166-12113-1-git-send-email-thuth@redhat.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 0/5] For QEMU 2.5: Network traffic dumping for -netdev devices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thomas Huth , qemu-devel@nongnu.org, Stefan Hajnoczi , Jason Wang Cc: Markus Armbruster Hi Thomas, Jason, Stefan I'm reading the QEMU network subsystem and am thinking implement a network filter between network backend and NIC devices. All packets will pass by this filter, therefore, dump can be easily done with the filter. +--------------+ +-------------+ +----------+ | filter | |frontend(NIC)| | real | | | | | | network <--+backend <-------+ | | backend | | peer +-------> peer | +----------+ +--------------+ +-------------+ The filter is actually a full featured network backend, either you can call this a transparent proxy. A prototype patch will be sent in reply to this mail. The patch tested with tap backend. I want your input about whether this is plausible or the design of this is completely wrong? Thank you in advance. On 07/13/2015 03:39 PM, Thomas Huth wrote: > The "-net dump" option only works with the "-net" option. So far, it > is not possible to dump network traffic with the "-netdev" option yet. > This patch series now fixes this ugliness by enabling dumping for the > "-netdev" option, too. > > Unlike with the "-net dump" option, the "-netdev" parameter does not > "abuse" the disliked internal vlan hub infrastructure to achieve this > functionality. This patch series introduces a new, clean "dumpfile=xxx" > option for the -netdev parameters instead. > > The patches are intended for QEMU version 2.5, but I'm sending them > now already in case somebody got some spare minutes left for reviewing > them again. > > Note: I did not address multiqueue devices yet (but added a TODO in the > source code) ... I will address that later when the basic patches have > been accepted. > > v2: > - Restructured the code a little bit > - Updated target QEMU version from 2.4. to 2.5 > - Addressed review feedback from Jason, Stefan and Markus: > - Use iov_copy() instead of copying the iov manually > - Fix return value of net_dump_receive_iov() if fd is invalid > - Use get_vhost_net() to detect vhost devices > - Close the fd when netdev is deleted > - Added some more comments in the source code > > Thomas Huth (5): > net/dump: Add support for receive_iov function > net/dump: Move DumpState into NetClientState > net/dump: Rework net-dump init functions > net/dump: Add dump option for netdev devices > qemu options: Add information about dumpfile to help text > > include/net/net.h | 8 +++++ > net/clients.h | 6 ++++ > net/dump.c | 99 +++++++++++++++++++++++++++++++++++++++---------------- > net/net.c | 38 ++++++++++++++++++++- > qapi-schema.json | 12 +++++-- > qemu-options.hx | 26 ++++++++++----- > 6 files changed, 149 insertions(+), 40 deletions(-) > -- Thanks, Yang.