qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Sebastian Ottlik <ottlik@fzi.de>
Cc: Jan Kiszka <jan.kiszka@siemens.com>,
	Anthony Liguori <aliguori@us.ibm.com>,
	qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v4 3/5] net: call socket_set_fast_reuse instead of setting SO_REUSEADDR
Date: Mon, 16 Sep 2013 08:04:22 -0600	[thread overview]
Message-ID: <52370FE6.209@redhat.com> (raw)
In-Reply-To: <1379319907-14950-4-git-send-email-ottlik@fzi.de>

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

On 09/16/2013 02:25 AM, Sebastian Ottlik wrote:
> SO_REUSEADDR should be avoided on Windows but is desired on other operating
> systems. So instead of setting it we call socket_set_fast_reuse that will result
> in the appropriate behaviour on all operating systems.
> 
> An exception to this rule are multicast sockets where it is sensible to have
> multiple sockets listen on the same ip and port and we should set SO_REUSEADDR
> on windows.
> 

>      /* allow fast reuse */
> -    val = 1;
> -    qemu_setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val));
> +    socket_set_fast_reuse(fd, false);

Changed from silent to noisy.  Intentional?

> @@ -661,11 +665,9 @@ static int net_socket_udp_init(NetClientState *peer,
>          perror("socket(PF_INET, SOCK_DGRAM)");
>          return -1;
>      }
> -    val = 1;
> -    ret = qemu_setsockopt(fd, SOL_SOCKET, SO_REUSEADDR,
> -                          &val, sizeof(val));
> +
> +    ret = socket_set_fast_reuse(fd, true);
>      if (ret < 0) {
> -        perror("setsockopt(SOL_SOCKET, SO_REUSEADDR)");
>          closesocket(fd);
>          return -1;

Changed from noisy to silent.  Intentional?

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 621 bytes --]

  reply	other threads:[~2013-09-16 14:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-16  8:25 [Qemu-devel] [PATCH v4 0/5] Do not set SO_REUSEADDR on Windows Sebastian Ottlik
2013-09-16  8:25 ` [Qemu-devel] [PATCH v4 1/5] util: add socket_set_fast_reuse function which will replace setting SO_REUSEADDR Sebastian Ottlik
2013-09-16  8:25 ` [Qemu-devel] [PATCH v4 2/5] gdbstub: call socket_set_fast_reuse instead of " Sebastian Ottlik
2013-09-16 14:03   ` Eric Blake
2013-09-16 14:07     ` Sebastian Ottlik
2013-09-16  8:25 ` [Qemu-devel] [PATCH v4 3/5] net: " Sebastian Ottlik
2013-09-16 14:04   ` Eric Blake [this message]
2013-09-16  8:25 ` [Qemu-devel] [PATCH v4 4/5] slirp: " Sebastian Ottlik
2013-09-16  8:25 ` [Qemu-devel] [PATCH v4 5/5] util: " Sebastian Ottlik

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=52370FE6.209@redhat.com \
    --to=eblake@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=jan.kiszka@siemens.com \
    --cc=ottlik@fzi.de \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /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).