qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.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 v2 1/5] util: add socket_set_fast_reuse function which will replace setting SO_REUSEADDR
Date: Mon, 9 Sep 2013 14:02:06 +0200	[thread overview]
Message-ID: <20130909120206.GC20215@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <1378314535-27587-2-git-send-email-ottlik@fzi.de>

On Wed, Sep 04, 2013 at 07:08:51PM +0200, Sebastian Ottlik wrote:
> diff --git a/util/oslib-posix.c b/util/oslib-posix.c
> index 3dc8b1b..f071793 100644
> --- a/util/oslib-posix.c
> +++ b/util/oslib-posix.c
> @@ -159,6 +159,20 @@ void qemu_set_nonblock(int fd)
>      fcntl(fd, F_SETFL, f | O_NONBLOCK);
>  }
>  
> +int socket_set_fast_reuse(int fd)
> +{
> +    int val=1, ret;
> +
> +    ret = setsockopt(fd, SOL_SOCKET, SO_REUSEADDR,
> +                     (const char *)&val, sizeof(val));
> +
> +    if (ret < 0) {
> +      perror("setsockopt(SOL_SOCKET, SO_REUSEADDR)");
> +    }
> +
> +    return ret;
> +}

Please run scripts/checkpatch.pl before submitting patches to check
coding style (whitespace, indentation, etc).

  reply	other threads:[~2013-09-09 12:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-04 17:08 [Qemu-devel] [PATCH v2 0/5] Do not set SO_REUSEADDR on Windows Sebastian Ottlik
2013-09-04 17:08 ` [Qemu-devel] [PATCH v2 1/5] util: add socket_set_fast_reuse function which will replace setting SO_REUSEADDR Sebastian Ottlik
2013-09-09 12:02   ` Stefan Hajnoczi [this message]
2013-09-04 17:08 ` [Qemu-devel] [PATCH v2 2/5] gdbstub: call socket_set_fast_reuse instead of " Sebastian Ottlik
2013-09-04 17:08 ` [Qemu-devel] [PATCH v2 3/5] net: " Sebastian Ottlik
2013-09-04 17:08 ` [Qemu-devel] [PATCH v2 4/5] slirp: " Sebastian Ottlik
2013-09-04 17:08 ` [Qemu-devel] [PATCH v2 5/5] util: " Sebastian Ottlik
2013-09-05 13:48 ` [Qemu-devel] [PATCH v2 0/5] Do not set SO_REUSEADDR on Windows Sebastian Ottlik
2013-09-09 12:05   ` Stefan Hajnoczi
2013-09-09 12:15     ` Sebastian Ottlik
2013-09-10  7:53       ` Stefan Hajnoczi

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=20130909120206.GC20215@stefanha-thinkpad.redhat.com \
    --to=stefanha@gmail.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).