From: Juergen Keil <jk@tools.de>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] access to -smb directory does not work reliable
Date: Fri, 10 Dec 2004 19:20:32 +0100 (CET) [thread overview]
Message-ID: <200412101820.iBAIKWUS026631@imap.tools.intra> (raw)
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 other threads:[~2004-12-10 18:32 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=200412101820.iBAIKWUS026631@imap.tools.intra \
--to=jk@tools.de \
--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).