qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Marc-André Lureau" <marcandre.lureau@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Claudio Fontana <cfontana@suse.de>, qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [PATCH] build-sys: fix win32 compilation with --target-list=''
Date: Fri, 18 Dec 2020 17:01:54 +0400	[thread overview]
Message-ID: <CAMxuvawOQc7sHoVV+eaAChwDb5RVRBHWPqzZ85xoovp+_nqtdg@mail.gmail.com> (raw)
In-Reply-To: <7fc16ac5-d0c2-9475-abc8-bd415c6b2a73@redhat.com>

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

Hi

On Thu, Dec 17, 2020 at 3:47 PM Paolo Bonzini <pbonzini@redhat.com> wrote:

> On 17/12/20 12:32, Claudio Fontana wrote:
> > Is the root cause elsewhere though?
> >
> > I don't like stubs very much, because often they are introduced as the
> easy way out of a problem instead of doing the necessary refactoring,
> > and they end up confusing the hell out of someone trying to understand
> what is actually used where, never mind trying to debug the linker errors.
> >
> > There is already an bunch of #ifndef _WIN32, #else , ... in
> util/main-loop.c (quite a bunch of them really),
> > is that what actually needs reworking, and putting the pieces together
> in the build system in a way that makes sense?
>
> qemu_fd_register is almost not needed at all, since we have
>
>          WSAEventSelect(node->pfd.fd, event, bitmask);
>
> in aio_set_fd_handler.  I think we can remove the call to
> qemu_fd_register from qemu_try_set_nonblock, and that should fix the
> issue as well.
>

That's tricky to say whether this won't introduce regression. For most fds
from qemu, if they use aio_set_fd_handler, that should be ok.

But what about other fds? For examples, the ones from slirp? In fact, I
don't understand how it could work today. We are passing socket() fd
directly to g_poll(). But according to the documentation:

 * On Win32, the fd in a GPollFD should be Win32 HANDLE (*not* a file
 * descriptor as provided by the C runtime) that can be used by
 * MsgWaitForMultipleObjects. This does *not* include file handles
 * from CreateFile, SOCKETs, nor pipe handles. (But you can use
 * WSAEventSelect to signal events when a SOCKET is readable).

And MsgWaitForMultipleObjects doesn't mention SOCKET as being valid handles
to wait for.

But when I run qemu with slirp, with or without qemu_fd_register, I don't
see any error or regression.

Am I missing something?

[-- Attachment #2: Type: text/html, Size: 2441 bytes --]

  reply	other threads:[~2020-12-18 13:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-17 10:44 [PATCH] build-sys: fix win32 compilation with --target-list='' marcandre.lureau
2020-12-17 11:32 ` Claudio Fontana
2020-12-17 11:41   ` Marc-André Lureau
2020-12-17 11:46   ` Paolo Bonzini
2020-12-18 13:01     ` Marc-André Lureau [this message]
2020-12-18 13:21       ` Paolo Bonzini
2020-12-18 13:33         ` Marc-André Lureau
2020-12-18 13:23       ` Marc-André Lureau

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=CAMxuvawOQc7sHoVV+eaAChwDb5RVRBHWPqzZ85xoovp+_nqtdg@mail.gmail.com \
    --to=marcandre.lureau@redhat.com \
    --cc=cfontana@suse.de \
    --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 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).