From: "Daniel P. Berrange" <berrange@redhat.com>
To: Andrew Baumann <Andrew.Baumann@microsoft.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
Stefan Weil <sw@weilnetz.de>
Subject: Re: [Qemu-devel] [PATCH v2 00/18] Multiple fixes & improvements to QIOChannel & Win32
Date: Mon, 14 Mar 2016 14:10:29 +0000 [thread overview]
Message-ID: <20160314141029.GB21198@redhat.com> (raw)
In-Reply-To: <BLUPR0301MB2034FD833FD5B3E2D7F6E4D59EB50@BLUPR0301MB2034.namprd03.prod.outlook.com>
On Fri, Mar 11, 2016 at 11:51:29PM +0000, Andrew Baumann wrote:
> Hi folks,
>
> > From: Paolo Bonzini [mailto:pbonzini@redhat.com]
> > Sent: Thursday, 10 March 2016 9:37 AM
> >
> > On 10/03/2016 18:26, Daniel P. Berrange wrote:
> > > This series started out as an attempt to fix the Win32 problems
> > > identified by Andrew Baumann
> > >
> > > https://lists.gnu.org/archive/html/qemu-devel/2016-03/msg01343.html
> > >
> > > It turned into a significantly larger cleanup of some chardev
> > > and osdep win32 portability code.
> [...]
>
> Sorry for chiming in a bit late here. I've tested these patches
> (the complete set, not individually), and they do appear to fix my
> immediate problem: socket char devices now work again. So thank you!
Thanks for confirming this, these patches have now merged into
git msater.
> However, I'm now seeing a problem I don't believe we had before:
> very slow responses to GDB commands. From looking at a packet
> capture (using a localhost tcp socket between qemu and my gdb
> client), it seems that a couple of operations will go through
> just fine, and then there is a 1 second delay between my client's
> request and qemu's response. After fiddling with poll timeouts,
> it became clear that we were noticing the socket events when
> waking up from the poll, but the events themselves were still
> not waking us. It turns out that we were not calling WSAEventSelect
> on the accept path. At least, the following patch fixed the
> problem for me:
>
> diff --git a/qemu-char.c b/qemu-char.c
> index 3bf30b5..c1be622 100644
> --- a/qemu-char.c
> +++ b/qemu-char.c
> @@ -3047,6 +3047,7 @@ static gboolean tcp_chr_accept(QIOChannel *channel,
> return TRUE;
> }
>
> + qio_channel_set_blocking(QIO_CHANNEL(sioc), false, NULL);
> tcp_chr_new_client(chr, sioc);
>
> object_unref(OBJECT(sioc));
>
> However, I'd note that both callers of tcp_chr_new_client()
> make the same call to set blocking to false immediately before
> calling tcp_chr_new_client(). Furthermore, the doc comment for
> qio_channel_set_blocking() appears to suggest that non-blocking
> mode is the default. If that's true, maybe you don't even want
> to rely on the caller explicitly setting blocking to false?
No, the docs don't intend to suggest that - the default is in
fact blocking mode, so its correct to place it into nonblocking
mode explicitly.
I think I didn't notice the problem you describe because my original
patch series had us call WSAEventSelect when creating the watch. This
indirectly puts Win32 sockets into non-blocking mode. The patches which
just merged however no longer call WSAEventSelect when creating the
watch, instead requiring the caller to explicitly set the socket into
non-blocking mode. So I think your suggested addition here is probably
the right way to address this. I'll investigate and respond with a
followup patch as needed.
Regards,
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
prev parent reply other threads:[~2016-03-14 14:10 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-10 17:26 [Qemu-devel] [PATCH v2 00/18] Multiple fixes & improvements to QIOChannel & Win32 Daniel P. Berrange
2016-03-10 17:26 ` [Qemu-devel] [PATCH v2 01/18] osdep: fix socket_error() to work with Mingw64 Daniel P. Berrange
2016-03-10 17:26 ` [Qemu-devel] [PATCH v2 02/18] io: use bind() to check for IPv4/6 availability Daniel P. Berrange
2016-03-10 17:26 ` [Qemu-devel] [PATCH v2 03/18] io: initialize sockets in test program Daniel P. Berrange
2016-03-10 17:26 ` [Qemu-devel] [PATCH v2 04/18] io: bind to socket before creating QIOChannelSocket Daniel P. Berrange
2016-03-10 17:26 ` [Qemu-devel] [PATCH v2 05/18] io: wait for incoming client in socket test Daniel P. Berrange
2016-03-10 17:26 ` [Qemu-devel] [PATCH v2 06/18] io: set correct error object in background reader test thread Daniel P. Berrange
2016-03-10 17:26 ` [Qemu-devel] [PATCH v2 07/18] io: assert errors before asserting content in I/O test Daniel P. Berrange
2016-03-10 17:26 ` [Qemu-devel] [PATCH v2 08/18] io: fix copy+paste mistake in socket error message Daniel P. Berrange
2016-03-10 17:26 ` [Qemu-devel] [PATCH v2 09/18] io: pass HANDLE to g_source_add_poll on Win32 Daniel P. Berrange
2016-03-10 17:26 ` [Qemu-devel] [PATCH v2 10/18] io: introduce qio_channel_create_socket_watch Daniel P. Berrange
2016-03-10 17:26 ` [Qemu-devel] [PATCH v2 11/18] io: use qemu_accept to ensure SOCK_CLOEXEC is set Daniel P. Berrange
2016-03-10 17:26 ` [Qemu-devel] [PATCH v2 12/18] io: remove checking of EWOULDBLOCK Daniel P. Berrange
2016-03-10 17:27 ` [Qemu-devel] [PATCH v2 13/18] io: implement socket watch for win32 using WSAEventSelect+select Daniel P. Berrange
2016-03-10 17:27 ` [Qemu-devel] [PATCH v2 14/18] char: remove qemu_chr_finish_socket_connection method Daniel P. Berrange
2016-03-10 17:27 ` [Qemu-devel] [PATCH v2 15/18] char: remove socket_try_connect method Daniel P. Berrange
2016-03-10 17:27 ` [Qemu-devel] [PATCH v2 16/18] char: remove qemu_chr_open_socket_fd method Daniel P. Berrange
2016-03-10 17:27 ` [Qemu-devel] [PATCH v2 17/18] osdep: add wrappers for socket functions Daniel P. Berrange
2016-03-10 17:27 ` [Qemu-devel] [PATCH v2 18/18] osdep: remove use of socket_error() from all code Daniel P. Berrange
2016-03-10 17:36 ` [Qemu-devel] [PATCH v2 00/18] Multiple fixes & improvements to QIOChannel & Win32 Paolo Bonzini
2016-03-11 23:51 ` Andrew Baumann
2016-03-14 14:10 ` Daniel P. Berrange [this message]
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=20160314141029.GB21198@redhat.com \
--to=berrange@redhat.com \
--cc=Andrew.Baumann@microsoft.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=sw@weilnetz.de \
/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).