Skip to contentSkip to conversation

-parallel and -serial on Windows host - second try

PATCH In review alex 3 participants 4 messages Jan 12, 2007 – Jan 13, 2007

lore
Share & tools
lore

alex

author
#0 lore raw

PATCH 1/1 -parallel and -serial on Windows host - second try

This is a second attempt to post, first one did not get through.

This patch fixes -parallel and -serial options work with TCP targets on Windows host.

Alex.

vl.c Fri Jan 12 10:49:37 2007 renamed from d/qemu/vl.c Fri Jan 12 10:43:12 2007 +5 -1
@@ -2692,8 +2692,13 @@
             if (ret < 0) {
                 err = socket_error();
                 if (err == EINTR || err == EWOULDBLOCK) {
+#ifndef _WIN32
                 } else if (err == EINPROGRESS) {
                     break;
+#else
+                } else if (err == EINPROGRESS | err == WSAEALREADY) {
+                    break;
+#endif
                 } else {
                     goto fail;
                 }
@@ -2708,7 +2713,6 @@
         else
             qemu_set_fd_handler(s->fd, NULL, tcp_chr_connect, chr);
     }
-
     if (is_listen && is_waitconnect) {
         printf("QEMU waiting for connection on: %s\n", host_str);
         tcp_chr_accept(chr);
#1 lore raw
Quoted 10 lines · alex

This is a second attempt to post, first one did not get through.

This patch fixes -parallel and -serial options work with TCP targets on Windows host.

Alex.

vl.c Fri Jan 12 10:49:37 2007 line 2699

Quoted 8 lines
vl.c Fri Jan 12 10:49:37 2007 renamed from d/qemu/vl.c Fri Jan 12 10:43:12 2007 +3 -0
@@ -2692,8 +2692,13 @@
            if (ret < 0) {
                err = socket_error();
                if (err == EINTR || err == EWOULDBLOCK) {
+#ifndef _WIN32
                } else if (err == EINPROGRESS) {
                    break;
+#else
+                } else if (err == EINPROGRESS | err == WSAEALREADY) {

Doesn't sound like it would be correct ("|" != "||"), even for Windows.. cheers,

#2 lore raw

Hi,

Quoted 16 lines · Bernhard Fischer

vl.c Fri Jan 12 10:49:37 2007 line 2699

Quoted 12 lines · alex
vl.c Fri Jan 12 10:49:37 2007 renamed from d/qemu/vl.c Fri Jan 12 10:43:12 2007 +3 -0
@@ -2692,8 +2692,13 @@
            if (ret < 0) {
                err = socket_error();
                if (err == EINTR || err == EWOULDBLOCK) {
+#ifndef _WIN32
                } else if (err == EINPROGRESS) {
                    break;
+#else
+                } else if (err == EINPROGRESS | err == WSAEALREADY) {

Doesn't sound like it would be correct ("|" != "||"), even for Windows..

Well, it might be not intended, but it still works correctly: "==" has a higher priority than "|", and the value of "err == EINPROGRESS" is 0 or 1, depending on the value of EINPROGRESS. It is never anything else but 0 or 1, so the operator "|" has the same result as "||" (at least in this case).

Ciao,
Dscho

#3 lore raw
Quoted 21 lines · Johannes Schindelin

Hi,

Quoted 16 lines · Bernhard Fischer

vl.c Fri Jan 12 10:49:37 2007 line 2699

Quoted 12 lines · alex
vl.c Fri Jan 12 10:49:37 2007 renamed from d/qemu/vl.c Fri Jan 12 10:43:12 2007 +3 -0
@@ -2692,8 +2692,13 @@
            if (ret < 0) {
                err = socket_error();
                if (err == EINTR || err == EWOULDBLOCK) {
+#ifndef _WIN32
                } else if (err == EINPROGRESS) {
                    break;
+#else
+                } else if (err == EINPROGRESS | err == WSAEALREADY) {

Doesn't sound like it would be correct ("|" != "||"), even for Windows..

Quoted 5 lines

Well, it might be not intended, but it still works correctly: "==" has a higher priority than "|", and the value of "err == EINPROGRESS" is 0 or 1, depending on the value of EINPROGRESS. It is never anything else but 0 or 1, so the operator "|" has the same result as "||" (at least in this case).

Your right, sorry for the noise.