From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KLTaT-0005rY-Q9 for qemu-devel@nongnu.org; Tue, 22 Jul 2008 21:56:17 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KLTaR-0005qw-5X for qemu-devel@nongnu.org; Tue, 22 Jul 2008 21:56:16 -0400 Received: from [199.232.76.173] (port=34093 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KLTaR-0005qp-2Y for qemu-devel@nongnu.org; Tue, 22 Jul 2008 21:56:15 -0400 Received: from an-out-0708.google.com ([209.85.132.247]:58104) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KLTaQ-0003So-Ju for qemu-devel@nongnu.org; Tue, 22 Jul 2008 21:56:14 -0400 Received: by an-out-0708.google.com with SMTP id d18so851623and.130 for ; Tue, 22 Jul 2008 18:56:14 -0700 (PDT) Message-ID: <48868F9F.5060707@codemonkey.ws> Date: Tue, 22 Jul 2008 20:55:43 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [PATCH] networking using libpcap References: <200807171812.41200.jkim@FreeBSD.org> In-Reply-To: <200807171812.41200.jkim@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Juergen Lock , herbszt@gmx.de Jung-uk Kim wrote: >> I just discovered this patch >> >> > http://lists.freebsd.org/pipermail/freebsd-emulation/2007-February/003107.html > >> that implements network access using libpcap. >> > > Since someone showed interest, I updated my patches against trunk. :-) > > http://people.freebsd.org/~jkim/qemu-pcap-20080717.diff > > I turned it off by default for now. If you want to enable it, do: > > configure --enable-pcap > Please have it be enabled by default and autodetect whether libpcap is available (like most other things in QEMU). Also, if you'd like the patch to be applied, please send it to qemu-devel as an attached patch including an appropriate description and Signed-off-by line. Regards, Anthony Liguori >> Works perfect for me and allows access to the local Ethernet right >> out of the box, very much unlike tap and bridging. The attached >> version applies to trunk. >> >> I have modified (e.g. got rid of threads) the original patch from >> the forum and am using it here on Windows. It works fine but >> performance is pretty low. >> > > *After* applying the new patch: > > cp -p vl.c vl.c.orig > sed -e 's/#ifdef PCAP_SET_FILTER/#if 1/g' vl.c > vl.c.tmp > mv vl.c.tmp vl.c > > and try again? BTW, I have no real experience with WinPcap, so don't > kill me if it does not work for you. ;-) > > >> +ifdef CONFIG_PCAP >> +LIBS+=-lpcap >> +endif >> >> On Windows it should be -lwpcap. >> > > Thanks for the tip! > > >> + if ((fd = pcap_get_selectable_fd(s->handle)) < 0) { >> + fprintf(stderr, "qemu: pcap_get_selectable_fd failed\n"); >> + goto fail; >> + } >> + qemu_set_fd_handler(fd, pcap_send, NULL, s); >> >> pcap_get_selectable_fd() is not available on Windows. I just put >> pcap_send() in main_loop_wait(). >> > > I added WinPcap API support from WinPcap manual pages but I have no > way of checking. Can you try the patch and letting me know? > > Juergen, > > I made FreeBSD ports patch for emulators/qemu-devel: > > http://people.freebsd.org/~jkim/qemu-devel-20080620-pcap.diff > > FYI... > > Thanks, > > Jung-uk Kim > > >