[4896] Add Virtual Distributed Ethernet native support, by Luca Bigliardi.
Revision: 4896
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4896 Author: ths Date: 2008-07-19 09:56:24 +0000 (Sat, 19 Jul 2008)
Log Message:
-----------
Add Virtual Distributed Ethernet native support, by Luca Bigliardi.
Modified Paths:
--------------
trunk/Makefile
trunk/Makefile.target
trunk/configure
trunk/qemu-doc.texi
trunk/vl.c
Modified: trunk/Makefile
===================================================================
Makefile +2 -0
@@ -133,6 +133,8 @@ OBJS+=$(addprefix slirp/, $(SLIRP_OBJS)) endif +LIBS+=$(VDE_LIBS) + cocoa.o: cocoa.m $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
Modified: trunk/Makefile.target
===================================================================
Makefile.target +1 -1
@@ -655,7 +655,7 @@ endif $(QEMU_PROG): $(OBJS) ../libqemu_common.a libqemu.a - $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS) + $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS) $(VDE_LIBS) endif # !CONFIG_USER_ONLY
Modified: trunk/configure
===================================================================
configure +28 -0
@@ -89,6 +89,7 @@ EXESUF="" gdbstub="yes" slirp="yes" +vde="no" fmod_lib="" fmod_inc="" vnc_tls="yes"
@@ -280,6 +281,8 @@ ;; --disable-slirp) slirp="no" ;; + --enable-vde) vde="yes" + ;; --disable-kqemu) kqemu="no" ;; --disable-brlapi) brlapi="no"
@@ -432,6 +435,7 @@ echo " --fmod-inc path to FMOD includes" echo " --enable-uname-release=R Return R for uname -r in usermode emulation" echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9" +echo " --enable-vde enable support for vde network [$vde]" echo "" echo "NOTE: The object files are built at the place where configure is launched" exit 1
@@ -722,6 +726,24 @@ fi ########################################## +# vde libraries probe +if test "$vde" = "yes" ; then + cat > $TMPC << EOF +#include <libvdeplug.h> +int main(void) { struct vde_open_args a = {0, 0, 0} ; return 0;} +EOF + if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then + : + else + echo + echo "Error: VDE check failed" + echo "Make sure to have the VDE libs and headers installed." + echo + exit 1 + fi +fi + +########################################## # Sound support libraries probe audio_drv_probe()
@@ -874,6 +896,7 @@ [ ! -z "$uname_release" ] && \ echo "uname -r $uname_release" echo "NPTL support $nptl" +echo "vde support $vde" if test $sdl_too_old = "yes"; then echo "-> Your SDL version is too old - please upgrade to have SDL support"
@@ -1038,6 +1061,11 @@ echo "CONFIG_SLIRP=yes" >> $config_mak echo "#define CONFIG_SLIRP 1" >> $config_h fi +if test "$vde" = "yes" ; then + echo "CONFIG_VDE=yes" >> $config_mak + echo "#define CONFIG_VDE 1" >> $config_h + echo "VDE_LIBS=-lvdeplug" >> $config_mak +fi for card in $audio_card_list; do def=CONFIG_`echo $card | tr '[:lower:]' '[:upper:]'` echo "$def=yes" >> $config_mak
Modified: trunk/qemu-doc.texi
===================================================================
qemu-doc.texi +15 -0
@@ -675,6 +675,21 @@ /path/to/linux ubd0=/path/to/root_fs eth0=mcast @end example +@item -net vde[,vlan=@var{n}][,sock=@var{socketpath}][,port=@var{n}][,group=@var{groupname}][,mode=@var{octalmode}] +Connect VLAN @var{n} to PORT @var{n} of a vde switch running on host and +listening for incoming connections on @var{socketpath}. Use GROUP @var{groupname} +and MODE @var{octalmode} to change default ownership and permissions for +communication port. This option is available only if QEMU has been compiled +with vde support enabled. + +Example: +@example +# launch vde switch +vde_switch -F -sock /tmp/myswitch +# launch QEMU instance +qemu linux.img -net nic -net vde,sock=/tmp/myswitch +@end example + @item -net none Indicate that no network devices should be configured. It is used to override the default configuration (@option{-net nic -net user}) which
Modified: trunk/vl.c
===================================================================
vl.c +101 -0
131 lines not on this page · raw message
Quoted 8 lines · Thiemo Seufer
Revision: 4896
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4896 Author: ths Date: 2008-07-19 09:56:24 +0000 (Sat, 19 Jul 2008)Log Message:
-----------
Add Virtual Distributed Ethernet native support, by Luca Bigliardi.
Thanks Thiemo and Luigu,
I have now tested this with all my Linux (32 and 64 bit) and my 32 bit FreeBSD guests on a x86_64 Linux host, including having more than one guest running at a time.
It worked beautifully.
Cheers,
Erik
Signature · 5 lines
----------------------------------------------------------------- Erik de Castro Lopo ----------------------------------------------------------------- "Projects promoting programming in natural language are intrinsically doomed to fail." -- Edsger Dijkstra