From: Stefan Weil <sw@weilnetz.de>
To: Paolo Bonzini <pbonzini@redhat.com>,
"Daniel P. Berrange" <berrange@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] QEMU 2.4 for Windows - current status
Date: Thu, 10 Sep 2015 22:38:36 +0200 [thread overview]
Message-ID: <55F1EA4C.7020807@weilnetz.de> (raw)
In-Reply-To: <55C2064B.2050606@redhat.com>
Am 05.08.2015 um 14:49 schrieb Paolo Bonzini:
> On 05/08/2015 13:03, Stefan Weil wrote:
[...]
>> slirp: Fix non blocking connect for w32
>> http://repo.or.cz/w/qemu/ar7.git/commit/b3f21d56ad3f36562d396685de8ff4981af6b805
>
> The second looks good, but you do not need the #ifdef at all in theory.
> If you do, other breakage is looming.
>
> Paolo
The new code was this:
if ((tcp_fconnect(so) == -1) &&
#if defined(_WIN32)
socket_error() != WSAEWOULDBLOCK
#else
(errno != EINPROGRESS) && (errno != EWOULDBLOCK)
#endif
) {
Without the preprocessor conditionals, Linux users would get
an undefined WSAEWOULDBLOCK.
And QEMU defines a macro EWOULDBLOCK which differs from
the MinGW-w64 definition, at least in my Debian Jessie
cross environment (10035 != 140):
include/sysemu/os-win32.h:
# define EWOULDBLOCK WSAEWOULDBLOCK
/usr/share/mingw-w64/include/pthread.h:
#define EWOULDBLOCK 140
/usr/share/mingw-w64/include/psdk_inc/_wsa_errnos.h:
#define WSAEWOULDBLOCK (WSABASEERR + 35 )
That's only a problem if we get pthread.h when compiling
for Windows. Can we be sure that this won't happen?
It looks like Windows + MinGW(-w64) is a moving target
which is not so easy to handle.
Maybe it would be better to change tcp_fconnect() to
return an ANSI error code (with a conversion from
Windows error codes in that function).
Or we introduce a wrapper for connect(), qemu_connect().
Stefan
next prev parent reply other threads:[~2015-09-10 20:38 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-31 10:17 [Qemu-devel] [PATCH for-2.4] oslib-win32: only provide localtime_r/gmtime_r if missing Daniel P. Berrange
2015-07-31 12:49 ` Paolo Bonzini
2015-07-31 13:33 ` Daniel P. Berrange
2015-07-31 17:58 ` Stefan Weil
2015-08-05 9:52 ` Daniel P. Berrange
2015-08-05 11:03 ` [Qemu-devel] QEMU 2.4 for Windows - current status Stefan Weil
2015-08-05 12:49 ` Paolo Bonzini
2015-08-05 15:38 ` Stefan Weil
2015-09-10 20:38 ` Stefan Weil [this message]
2015-08-05 16:51 ` Liviu Ionescu
2015-08-05 16:56 ` Paolo Bonzini
2015-08-05 18:39 ` Liviu Ionescu
2015-08-05 20:30 ` Stefan Weil
2015-08-05 21:42 ` Liviu Ionescu
2015-08-06 8:44 ` Kevin Wolf
2015-08-06 10:12 ` Stefan Weil
2015-08-06 17:12 ` Richard Henderson
2015-08-10 10:25 ` Peter Maydell
2015-08-10 11:39 ` Stefan Weil
2015-08-10 14:00 ` Paolo Bonzini
2015-08-10 20:22 ` Stefan Weil
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=55F1EA4C.7020807@weilnetz.de \
--to=sw@weilnetz.de \
--cc=berrange@redhat.com \
--cc=pbonzini@redhat.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.