Here's a very simple patch against the latest svn version (r371) of vde. In the event of an error, it just drops the packet instead of killing everything. This does not require the VDE compatible vswitch to operate.

Hopefully, this will fix your problem but I'm not experiencing it, so I can't verify. Let me know how it goes.

Jesse

Jesse Gross wrote:
We're actually currently using the VDE peripheral programs (including vdeq) for the vswitch and just replacing the core. However, this is a good incentive to fix/replace vqeq as well.

I can come up with a patch pretty quickly to prevent vdeq from dying on error. I don't have a repro of the problem though.

Jesse

Martin Casado wrote:
This will all go away when we release VDE compatible vswitch ... :)

Brandon Heller <[email protected]> writes:

Before installing the latest VDE from Subversion source, does
anyone have any suggestions or notes about bugs that have come
up?

I've occasionally seen this problem too, but for me it is
somewhat difficult to reproduce: when I see it, I just rerun my
test and everything generally works that time.

I think that this is really a bug in the vdeq program.  At least,
it's involved: vdeq has a loop that reads from one socket and
writes to another, and any error return causes it to exit, which
in turn kills the VM that was using it, which in turn causes the
monitor script (if I recall correctly) to kill off all the other
VMs.

Fixes welcomed.

_______________________________________________
nox-dev mailing list
[email protected]
http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org



_______________________________________________
nox-dev mailing list
[email protected]
http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org
Index: src/vdeq.c
===================================================================
--- src/vdeq.c	(revision 371)
+++ src/vdeq.c	(working copy)
@@ -507,31 +507,43 @@
 						break;
 					if (pollv[2*i].revents & POLLIN) {
 						if ((nx=read(sp[i][1],bufin,sizeof(bufin))) <= 0) {
-							if (nx < 0) 
+							if ((errno == ENOTCONN) || (errno == ECONNREFUSED)) {
+								cleanup();
+								exit(nx < 0);
+							} else {
 								perror("read");
-							cleanup();
-							exit(nx < 0);
+							} 
+						} else {
+							//fprintf(stderr,"RX from qemu %d\n",nx);
+							if (vde_send(conn[i],bufin,nx,0) < 0) {
+								if ((errno == ENOTCONN) || (errno == ECONNREFUSED)) {
+									cleanup();
+									exit(nx < 0);
+								} else {
+									perror("sendto");
+								}
+							}
 						}
-						//fprintf(stderr,"RX from qemu %d\n",nx);
-						if (vde_send(conn[i],bufin,nx,0) < 0) {
-							perror("sendto");
-							cleanup();
-							exit(1);
-						}
 					}
 					if (pollv[2*i+1].revents & POLLIN) {
 						if ((nx=vde_recv(conn[i],bufin,BUFSIZE,0)) < 0) {
-							perror("recvfrom");
-							cleanup();
-							exit(1);
+							if ((errno == ENOTCONN) || (errno == ECONNREFUSED)) {
+								cleanup();
+								exit(nx < 0);
+							} else {
+								perror("recvfrom");
+							}
+						} else {
+							//fprintf(stderr,"TX to qemu %d\n",nx);
+							if (write(sp[i][1],bufin,nx) < 0) {
+								if ((errno == ENOTCONN) || (errno == ECONNREFUSED)) {
+									cleanup();
+									exit(errno != ECONNREFUSED);
+								} else {
+									perror("write");
+								}
+							}
 						}
-						//fprintf(stderr,"TX to qemu %d\n",nx);
-						if (write(sp[i][1],bufin,nx) < 0) {
-							if (errno != ECONNREFUSED)
-								perror("write");
-							cleanup();
-							exit(errno != ECONNREFUSED);
-						}
 					}
 				}
 			}
_______________________________________________
nox-dev mailing list
[email protected]
http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org

Reply via email to