qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Stefan Weil <sw@weilnetz.de>,
	QEMU Developer <qemu-devel@nongnu.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Jan Kiszka <jan.kiszka@siemens.com>,
	Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Michael Fritscher <michael@fritscher.net>
Subject: Re: [Qemu-devel] [PATCH for 2.6] wxx: Fix broken TCP networking (regression)
Date: Fri, 15 Apr 2016 10:15:16 +0100	[thread overview]
Message-ID: <20160415091516.GD32260@redhat.com> (raw)
In-Reply-To: <CAFEAcA84ZmCOnZu7eHmGci4LU-ONAaXCBgOyfNJu9PvE-hfmqQ@mail.gmail.com>

On Thu, Apr 14, 2016 at 08:12:00PM +0100, Peter Maydell wrote:
> On 14 April 2016 at 18:46, Stefan Weil <sw@weilnetz.de> wrote:
> > It is broken since commit c619644067f98098dcdbc951e2dda79e97560afa.
> >
> > Reported-by: Michael Fritscher <michael@fritscher.net>
> > Signed-off-by: Stefan Weil <sw@weilnetz.de>
> > ---
> >
> > Networking with QEMU for Windows is currently not usable,
> > see bug report https://bugs.launchpad.net/qemu/+bug/1569988.
> >
> > With this patch, it seems to work again at least partially.
> > Michael Fritscher reported that it is still slow, so
> > more fixes might be needed.
> >
> > Would it be better to add conditional compilation to
> > slirp/tcp_input.c again (then the changes would only
> > be for Windows, so no new risk for QEMU 2.6)?
> >
> > Peter, I'd appreciate to get Windows networking fixed
> > for 2.6, so feel free to modify and apply this patch as
> > needed if time is too short for reviews and my pull request.
> 
> We've just missed rc2, but we have until next week for rc3,
> so I think we have enough time for code review before then.
> I've listed this bug on the Planning wiki page as a reminder
> to make sure it's fixed before I tag rc3.
> 
> > Regards,
> > Stefan
> >
> >  slirp/slirp.h     | 5 -----
> >  slirp/tcp_input.c | 1 +
> >  2 files changed, 1 insertion(+), 5 deletions(-)
> >
> > diff --git a/slirp/slirp.h b/slirp/slirp.h
> > index c99ebb9..203deec 100644
> > --- a/slirp/slirp.h
> > +++ b/slirp/slirp.h
> > @@ -347,9 +347,4 @@ struct tcpcb *tcp_drop(struct tcpcb *tp, int err);
> >  #define max(x,y) ((x) > (y) ? (x) : (y))
> >  #endif
> >
> > -#ifdef _WIN32
> > -#undef errno
> > -#define errno (WSAGetLastError())
> > -#endif
> > -
> 
> This is the sort of ugliness it's good to see the back of :-)
> 
> >  #endif
> > diff --git a/slirp/tcp_input.c b/slirp/tcp_input.c
> > index 5433e7f..e2b5d4e 100644
> > --- a/slirp/tcp_input.c
> > +++ b/slirp/tcp_input.c
> > @@ -659,6 +659,7 @@ findso:
> >           }
> >
> >           if ((tcp_fconnect(so, so->so_ffamily) == -1) &&
> > +              (errno != EAGAIN) &&
> >                (errno != EINPROGRESS) && (errno != EWOULDBLOCK)
> >            ) {
> >             uint8_t code;
> 
> This change is safe (at least behaviour-wise) for Linux, because
> on Linux EWOULDBLOCK and EAGAIN are the same thing. And we
> already have code in slirp.c that's doing something like
> "if (errno == EAGAIN || errno == EWOULBLOCK || ...)" so I
> don't expect gcc/clang to complain about duplicate if clauses.
> 
> So I guess you can have my
> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
> 
> though Dan's opinion would also be good as the author of the
> original commit.
> 
> (Incidentally the original intention in commit c61964406
> was clearly that callers should need to check only EAGAIN and
> not EWOULDBLOCK, and for 2.7 we should look at whether we can
> do that (ie whether all our host OSes really make them the
> same value, as Linux does and the oslib-win32.c socket_error()
> function does).)

Fortunately someone has already created a giant table:

  http://www.ioplex.com/~miallen/errcmp.html

Aside from Windows, only OSF/1 has different value for EAGAIN & WOULDBLOCK
and IIUC we don't support QEMU on that platform, so I think we're fine.


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 :|

  reply	other threads:[~2016-04-15  9:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-14 17:46 [Qemu-devel] [PATCH for 2.6] wxx: Fix broken TCP networking (regression) Stefan Weil
2016-04-14 17:53 ` Michael Fritscher
2016-04-14 18:08 ` Samuel Thibault
2016-04-14 18:54   ` Michael Fritscher
2016-04-15  9:35     ` Michael Fritscher
2016-04-14 19:12 ` Peter Maydell
2016-04-15  9:15   ` Daniel P. Berrange [this message]
2016-04-15 16:56     ` Stefan Weil
2016-04-15 16:59       ` Peter Maydell
2016-04-15 17:52         ` Stefan Weil
2016-04-15  9:11 ` Daniel P. Berrange

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=20160415091516.GD32260@redhat.com \
    --to=berrange@redhat.com \
    --cc=jan.kiszka@siemens.com \
    --cc=michael@fritscher.net \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=samuel.thibault@ens-lyon.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).