From ddddff004a1dd504c1d48daef4e1700c2cd22b21 Mon Sep 17 00:00:00 2001 From: rd235 Date: Fri, 18 Nov 2005 10:08:09 +0000 Subject: [PATCH] qemu: new networking support. fixed some formatting errors for Ethernet MACs in the user interface. git-svn-id: https://vde.svn.sourceforge.net/svnroot/vde/trunk@68 d37a7db1-d92d-0410-89df-f68f52f87b57 --- vde-2/configure.ac | 2 +- vde-2/doc/vdeq.1 | 9 ++++++-- vde-2/fstp.c | 4 ++-- vde-2/qemu/Makefile.am | 2 ++ vde-2/qemu/vdeq.c | 56 ++++++++++++++++++++++++++++++++++---------------- vde-2/switch.h | 2 +- vde-2/vde_switch.c | 2 +- 7 files changed, 52 insertions(+), 25 deletions(-) diff --git a/vde-2/configure.ac b/vde-2/configure.ac index 6e9816b..60ceef7 100644 --- a/vde-2/configure.ac +++ b/vde-2/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) -AC_INIT(vde, [2.0.0], renzo@cs.unibo.it) +AC_INIT(vde, [2.0.1], renzo@cs.unibo.it) AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR([vde.h]) AC_CONFIG_HEADER([config.h]) diff --git a/vde-2/doc/vdeq.1 b/vde-2/doc/vdeq.1 index 5f6e6a7..ee95265 100644 --- a/vde-2/doc/vdeq.1 +++ b/vde-2/doc/vdeq.1 @@ -1,4 +1,4 @@ -.\" Copyright (c) 2004 Renzo Davoli +.\" Copyright (c) 2004-2005 Renzo Davoli .\" .\" This is free documentation; you can redistribute it and/or .\" modify it under the terms of the GNU General Public License as @@ -20,7 +20,7 @@ .\" Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, .\" USA. -.TH VDEQ 1 "February 23, 2004" "Virtual Distributed Ethernet" +.TH VDEQ 1 "November 18, 2005" "Virtual Distributed Ethernet" .SH NAME vdeq \- Virtual Distributed Ethernet wrapper for QEMU virtual machines .SH SYNOPSIS @@ -105,6 +105,11 @@ to the first ne2k interface and so on. .TP .B -h, -help, --help print a Usage help. +.SH NOTE +Qemu has changed its syntax for networking (cvs Nov.15 2005). +As a temporary solution use vdeoq and vdeoqemu instead of vdeq and vdeqemu +if you are running a qemu with the old syntax. +.br .SH SEE ALSO .BR vde_switch (1), .BR vde_plug (1), diff --git a/vde-2/fstp.c b/vde-2/fstp.c index 941dbed..ae83041 100644 --- a/vde-2/fstp.c +++ b/vde-2/fstp.c @@ -43,9 +43,9 @@ static int numports; BA_CHECK(fsttab[(VLAN)]->rcvhist[1],(PORT))) static int rcvhistindex; struct vlst { - char root[SWITCHID_LEN]; + unsigned char root[SWITCHID_LEN]; char rootcost[4]; - char dessw[SWITCHID_LEN]; + unsigned char dessw[SWITCHID_LEN]; char port[2]; int rootport; int bonusport; diff --git a/vde-2/qemu/Makefile.am b/vde-2/qemu/Makefile.am index 8184f76..89ab43c 100644 --- a/vde-2/qemu/Makefile.am +++ b/vde-2/qemu/Makefile.am @@ -8,6 +8,8 @@ EXTRA_DIST = README install-exec-hook: rm -f $(DESTDIR)$(bindir)/vdeqemu $(LN_S) $(DESTDIR)$(bindir)/vdeq $(DESTDIR)$(bindir)/vdeqemu + $(LN_S) $(DESTDIR)$(bindir)/vdeq $(DESTDIR)$(bindir)/vdeo + $(LN_S) $(DESTDIR)$(bindir)/vdeq $(DESTDIR)$(bindir)/vdeoqemu uninstall-local: rm -f $(bindir)/vdeqemu diff --git a/vde-2/qemu/vdeq.c b/vde-2/qemu/vdeq.c index 5b2e333..dc42df5 100644 --- a/vde-2/qemu/vdeq.c +++ b/vde-2/qemu/vdeq.c @@ -1,4 +1,5 @@ /* Copyright 2003 Renzo Davoli + * TNX: 2005.11.18 new syntax mgmt patch by Iain McFarlane * Licensed under the GPL */ @@ -168,14 +169,23 @@ int main(int argc, char **argv) pair *sp; register int i; int nb_nics; + int oldsyntax=0; vdeqname=basename(argv[0]); callerpwd=getpwuid(getuid()); - if (strcmp(vdeqname,"vdeq") != 0 && strncmp(vdeqname,"vde",3)==0) { - filename=vdeqname+3; - args=1; - } - else if (argc > 1) { + /* OLD SYNTAX MGMT */ + if (strncmp(vdeqname,"vdeo",4) == 0) { + oldsyntax=1; + if (strcmp(vdeqname,"vdeoq") != 0) { + filename=vdeqname+4; + args=1; + } + } + else if (strcmp(vdeqname,"vdeq") != 0 && strncmp(vdeqname,"vde",3)==0) { + filename=vdeqname+3; + args=1; + } + else if (argc > 1) { filename=argv[1]; args=2; } else { @@ -243,26 +253,36 @@ int main(int argc, char **argv) printf("as %s\n",argsock); for (i=0; i %s\n",i,sockname[i]); */ - newargc=argc+3+(2*nb_nics)-args; + newargc=argc+1+(2*oldsyntax)+(2*nb_nics)-args; if ((newargv=(char **) malloc ((newargc+1)* sizeof(char *))) <0) { perror("malloc"); exit(1); } newargv[0]=filename; - for (i=0; i