[Top][All Lists]

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

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

From: Jung-uk Kim
Subject: [Qemu-devel] Re: [PATCH] networking using libpcap
Date: Thu, 17 Jul 2008 18:12:38 -0400
User-agent: KMail/1.6.2

> 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

> 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?


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




Jung-uk Kim

reply via email to

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