qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Kazu" <kazoo@r3.dion.ne.jp>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel][PATCH] Tap and VLAN socket support for win32
Date: Thu, 2 Feb 2006 19:03:58 +0900	[thread overview]
Message-ID: <000a01c627df$fc48d660$0464a8c0@athlon> (raw)
In-Reply-To: 43E13FEC.7050804@bellard.org

[-- Attachment #1: Type: text/plain, Size: 1706 bytes --]

Thursday, February 02, 2006 8:10 AM Fabrice Bellard wrote:

> Hi,
>
> I merged your patches and I made important changes to simplify them. I
> did not do any tests so tell me if you see problems.
>

-net socket,connect doesn't work. On Windows host, connect returns with err
= WSAEWOULDBLOCK and second time err = WSAEINVAL. I think changing the place
of EWOULDBLOCK would be good. On Linux host, EWOULDBLOCK is the same as
EAGAIN but a patch works on both Linux and Windows.

For -net socket,mcast, bind have to be done by sin_addr.s_addr = INADDR_ANY.
It seems that it works on Linux host.

Regards,
Kazu

Index: vl.c
===================================================================
RCS file: /sources/qemu/qemu/vl.c,v
retrieving revision 1.160
diff -u -r1.160 vl.c
--- vl.c 1 Feb 2006 23:06:55 -0000 1.160
+++ vl.c 2 Feb 2006 09:28:19 -0000
@@ -2335,7 +2335,13 @@
  goto fail;
     }

-    ret = bind(fd, (struct sockaddr *)mcastaddr, sizeof(*mcastaddr));
+    struct sockaddr_in addr;
+    memset(&addr, 0, sizeof(addr));
+    addr.sin_family = AF_INET;
+    addr.sin_port = mcastaddr->sin_port;
+    addr.sin_addr.s_addr = INADDR_ANY;
+
+    ret = bind(fd, (struct sockaddr *)&addr, sizeof(addr));
     if (ret < 0) {
         perror("bind");
         goto fail;
@@ -2561,8 +2567,8 @@
         ret = connect(fd, (struct sockaddr *)&saddr, sizeof(saddr));
         if (ret < 0) {
             err = socket_error();
-            if (err == EINTR || err == EWOULDBLOCK) {
-            } else if (err == EINPROGRESS) {
+            if (err == EINTR) {
+            } else if (err == EINPROGRESS || err == EWOULDBLOCK) {
                 break;
             } else {
                 perror("connect");

[-- Attachment #2: qemu-20060202-vlan.patch --]
[-- Type: application/octet-stream, Size: 1132 bytes --]

Index: vl.c
===================================================================
RCS file: /sources/qemu/qemu/vl.c,v
retrieving revision 1.160
diff -u -r1.160 vl.c
--- vl.c	1 Feb 2006 23:06:55 -0000	1.160
+++ vl.c	2 Feb 2006 09:28:19 -0000
@@ -2335,7 +2335,13 @@
 	goto fail;
     }
 
-    ret = bind(fd, (struct sockaddr *)mcastaddr, sizeof(*mcastaddr));
+    struct sockaddr_in addr;
+    memset(&addr, 0, sizeof(addr));
+    addr.sin_family = AF_INET;
+    addr.sin_port = mcastaddr->sin_port;
+    addr.sin_addr.s_addr = INADDR_ANY;
+
+    ret = bind(fd, (struct sockaddr *)&addr, sizeof(addr));
     if (ret < 0) {
         perror("bind");
         goto fail;
@@ -2561,8 +2567,8 @@
         ret = connect(fd, (struct sockaddr *)&saddr, sizeof(saddr));
         if (ret < 0) {
             err = socket_error();
-            if (err == EINTR || err == EWOULDBLOCK) {
-            } else if (err == EINPROGRESS) {
+            if (err == EINTR) {
+            } else if (err == EINPROGRESS || err == EWOULDBLOCK) {
                 break;
             } else {
                 perror("connect");

  reply	other threads:[~2006-02-02 14:30 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-31  7:34 [Qemu-devel][PATCH] Tap and VLAN socket support for win32 Kazu
2006-01-31 16:00 ` André Braga
2006-02-01 23:10 ` Fabrice Bellard
2006-02-02 10:03   ` Kazu [this message]
2006-02-04 18:28     ` Fabrice Bellard
2006-02-09  2:29       ` Kazu
2006-02-09 14:00       ` Kazu
2006-02-05  4:05   ` Jim C. Brown
2006-02-07 21:18   ` Jim C. Brown
2006-02-07 21:44     ` Fabrice Bellard
2006-02-08  7:23       ` David Fraser
2006-02-08  7:32         ` M. Warner Losh

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='000a01c627df$fc48d660$0464a8c0@athlon' \
    --to=kazoo@r3.dion.ne.jp \
    --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).