qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] access to -smb directory does not work reliable


From: Juergen Keil
Subject: [Qemu-devel] [PATCH] access to -smb directory does not work reliable
Date: Fri, 10 Dec 2004 19:20:32 +0100 (CET)

A windows guest OS is sometimes unable to mount a "-smb directory", when 
qemu runs on a Solaris host.

Problem is the accept() call in qemu that waits for a connect() from the
forked subprocess (the future smbd subprocess).   The accept() call is
interrupted by a SIGALRM signal and returns with return value -1 and
errno == EINTR.

qemu does not restart the accept() under these conditions; the -smb directory
cannot be mounted by the Windows guest OS.

Fix:

Index: slirp/misc.c
===================================================================
RCS file: /cvsroot/qemu/qemu/slirp/misc.c,v
retrieving revision 1.4
diff -u -B -r1.4 misc.c
--- slirp/misc.c        10 Oct 2004 18:00:00 -0000      1.4
+++ slirp/misc.c        10 Dec 2004 18:12:32 -0000
@@ -436,7 +440,9 @@
                         * The only reason this will block forever is if 
socket()
                         * of connect() fail in the child process
                         */
-                       so->s = accept(s, (struct sockaddr *)&addr, &addrlen);
+                       do
+                           so->s = accept(s, (struct sockaddr *)&addr, 
&addrlen);
+                       while (so->s < 0 && errno == EINTR);
                        closesocket(s);
                        opt = 1;
                        setsockopt(so->s,SOL_SOCKET,SO_REUSEADDR,(char 
*)&opt,sizeof(int));





reply via email to

[Prev in Thread] Current Thread [Next in Thread]