From: renzo@cs.unibo.it (Renzo Davoli)
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [patch] problems with dual ethernet networking
Date: Wed, 3 Nov 2004 13:40:25 +0100 [thread overview]
Message-ID: <20041103124025.GF23923@cs.unibo.it> (raw)
In-Reply-To: <20041103093553.GA23923@cs.unibo.it>
[-- Attachment #1: Type: text/plain, Size: 1078 bytes --]
On Wed, Nov 03, 2004 at 10:35:53AM +0100, Renzo Davoli wrote:
> Actually, it was implemented in qemu and vdeq used the multiple
> -tun-fd option provided bu qemu.
>
qemu has changed recently the option management, now it wants multiple
-tun-fd options for several tun interfaces (previously it accepted several
comma separated numbers).
I have just committed on cvs an updated version of vde that should be able
to work with multiple interfaces.
the -nics option should not be needed.
Sourceforge sometimes is late in updating the public access cvs, thus I
am sending here enclosed the patch for vdeq.c.
I have had no time to test it personally, please let me know if it works
correctly.
BTW: if you are connecting also several qemu machines on the same vde
network remember to change the MAC addresses!
The default configuration MAC is 52:54:00:12:34:56. (for eth0,
52:54:00:12:34:57 for eth1 etc.).
Several machines on the same network using the standard configuration
end up having the same MAC: networking does not work. i.e. it is a
net-does-not-work.
renzo
[-- Attachment #2: vdeq.diff --]
[-- Type: text/plain, Size: 1556 bytes --]
--- vde-1.5.7/qemu/vdeq.c 2004-11-03 12:57:35.185373176 +0100
+++ vde-1.5.8/qemu/vdeq.c 2004-11-03 13:11:43.333435072 +0100
@@ -78,12 +78,10 @@
unsigned char bufin[BUFSIZE];
-//struct pollfd pollv[]={{STDIN_FILENO,POLLIN|POLLHUP,0},{0,POLLIN|POLLHUP,0}};
struct pollfd *pollv;
char *filename;
char *vdeqname;
-char *numfd;
#define NUMW 10
static int countnics(const char *s)
@@ -169,19 +167,12 @@
perror("malloc nics");
exit(1);
}
- if ((numfd= (char *) malloc(nb_nics * NUMW * sizeof (char)))<0) {
- perror("malloc numfd");
- exit(1);
- }
for (i=0; i<nb_nics; i++) {
- char curfd[NUMW];
if (socketpair(AF_UNIX, SOCK_DGRAM, 0, sp[i]) < 0){
perror("socketpair");
exit(1);
}
- snprintf(curfd,NUMW,"%d%c",sp[i][0],(i<nb_nics-1)?',':0);
- strcat(numfd,curfd);
}
if ((sockname= (char **) malloc(sizeof(char *) * nb_nics))<0) {
@@ -207,17 +198,21 @@
printf("as %s\n",argsock);
for (i=0; i<nb_nics; i++)
printf("%d -> %s\n",i,sockname[i]); */
- newargc=argc+3-args;
+ newargc=argc+1+(2*nb_nics)-args;
if ((newargv=(char **) malloc ((newargc+1)* sizeof(char *))) <0) {
perror("malloc");
exit(1);
}
newargv[0]=filename;
- newargv[1]="-tun-fd";
- newargv[2]=numfd;
+ for (i=0; i<nb_nics; i++) {
+ char numfd[10];
+ sprintf(numfd,"%d",sp[i][0]);
+ newargv[2*i+1]="-tun-fd";
+ newargv[2*i+2]=strdup(numfd);
+ }
- for (i=3;args<argc;i++,args++) newargv[i]=argv[args];
+ for (i=(2*nb_nics)+1;args<argc;i++,args++) newargv[i]=argv[args];
newargv[i]=0;
next prev parent reply other threads:[~2004-11-03 12:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-02 18:44 [Qemu-devel] problems with dual ethernet networking marco ghidinelli
2004-11-03 2:45 ` Jim C. Brown
2004-11-03 9:35 ` Renzo Davoli
2004-11-03 12:40 ` Renzo Davoli [this message]
2004-11-03 13:48 ` [Qemu-devel] [patch] " marco ghidinelli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20041103124025.GF23923@cs.unibo.it \
--to=renzo@cs.unibo.it \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).