[Top][All Lists]

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

Re: [Qemu-devel] Re: [PATCH] networking using libpcap

From: Anthony Liguori
Subject: Re: [Qemu-devel] Re: [PATCH] networking using libpcap
Date: Tue, 22 Jul 2008 20:55:43 -0500
User-agent: Thunderbird (X11/20080501)

Jung-uk Kim wrote:
I just discovered this patch

    that implements network access using libpcap.

Since someone showed interest, I updated my patches against trunk. :-)


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.


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. ;-)

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?


I made FreeBSD ports patch for emulators/qemu-devel:




Jung-uk Kim

reply via email to

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