qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v3 0/5] Do not set SO_REUSEADDR on Windows
@ 2013-09-10 13:26 Sebastian Ottlik
  2013-09-10 13:26 ` [Qemu-devel] [PATCH v3 1/5] util: add socket_set_fast_reuse function which will replace setting SO_REUSEADDR Sebastian Ottlik
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Sebastian Ottlik @ 2013-09-10 13:26 UTC (permalink / raw)
  To: qemu-devel; +Cc: Jan Kiszka, Anthony Liguori, Stefan Hajnoczi

This patchset disabels all use of SO_REUSEADDR on Windows. On Windows systems
the default behaviour is equivalent to SO_REUSEADDR on other operating
systems. SO_REUSEADDR can still be set but results in undesired behaviour
instead. It may even lead to situations were system behaviour is
unspecified. More information on this can be found at:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms740621.aspx

I originally encountered this issue when accidentally launching two QEMU
instances with identical GDB ports at the same time. In which case QEMU won't
fail as one might expect.

v3 Changes:
- Fixed coding style issues.
  According to checkpatch.pl patch #4 still introduces style errors as tabs are
  used instead of space for some indentation. I keept the tabs to stay
  consistent with the sourrounding code, as tabs seem to be used consitently in
  parts (all?) of the slirp code.

- Changed patch #3 to keep SO_REUSEADDR for multicast sockets on windows and
  added an explainatory comment.

- Rebased to current master (94c2b6aff43cdfcfdfb552773a6b6b973a72ef0b).

v2 Changes:

- Introduce a function with os specific implementation instead of using #ifdef
  I named it socket_set_fast_reuse instead of the suggested qemu_set_reuseaddr
  so the name better reflects what the function actually does.

 gdbstub.c              |    6 ++----
 include/qemu/sockets.h |    1 +
 net/socket.c           |   18 ++++++++++--------
 slirp/misc.c           |    3 +--
 slirp/socket.c         |    4 +---
 slirp/tcp_subr.c       |    6 ++----
 slirp/udp.c            |    4 ++--
 util/oslib-posix.c     |   14 ++++++++++++++
 util/oslib-win32.c     |   10 ++++++++++
 util/qemu-sockets.c    |    6 +++---
 10 files changed, 46 insertions(+), 26 deletions(-)

util: add socket_set_fast_reuse function which will
gdbstub: call socket_set_fast_reuse instead of
net: call socket_set_fast_reuse instead of setting
slirp: call socket_set_fast_reuse instead of setting
util: call socket_set_fast_reuse instead of setting

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2013-09-10 16:39 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-10 13:26 [Qemu-devel] [PATCH v3 0/5] Do not set SO_REUSEADDR on Windows Sebastian Ottlik
2013-09-10 13:26 ` [Qemu-devel] [PATCH v3 1/5] util: add socket_set_fast_reuse function which will replace setting SO_REUSEADDR Sebastian Ottlik
2013-09-10 15:56   ` Eric Blake
2013-09-10 16:23     ` Sebastian Ottlik
2013-09-10 16:34       ` Eric Blake
2013-09-10 16:39         ` Sebastian Ottlik
2013-09-10 13:26 ` [Qemu-devel] [PATCH v3 2/5] gdbstub: call socket_set_fast_reuse instead of " Sebastian Ottlik
2013-09-10 13:26 ` [Qemu-devel] [PATCH v3 3/5] net: " Sebastian Ottlik
2013-09-10 15:53   ` Eric Blake
2013-09-10 13:26 ` [Qemu-devel] [PATCH v3 4/5] slirp: " Sebastian Ottlik
2013-09-10 15:58   ` Eric Blake
2013-09-10 13:26 ` [Qemu-devel] [PATCH v3 5/5] util: " Sebastian Ottlik

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).