All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: George Dunlap <george.dunlap@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH qemu-traditional] qemu: Fix race condition when binding ports
Date: Mon, 9 Dec 2013 13:25:55 +0000	[thread overview]
Message-ID: <52A5C4E3.9070402@citrix.com> (raw)
In-Reply-To: <52A5C2E6.3080005@eu.citrix.com>

On 09/12/13 13:17, George Dunlap wrote:
> On 12/09/2013 01:10 PM, Andrew Cooper wrote:
>> Two Qemus can race to bind the same VNC port.  It is valid for multiple
>> listen()s on the same socket to succeed, but only the first bind() will
>> succeed.
>>
>> In the case that two Qemus are racing, the second one will fail with an
>> EADDRINUSE, and bail with a fatal error which renders the domain
>> functionally
>> useless.
>>
>> In the case that bind() fails with EADDRINUSE, rebind the socket
>> again and try
>> for the next port.
>
> Sorry if I'm being a bit dense here, but it looks like you have those
> mixed up: if listen() fails with EADDRINUSE, you're going back to call
> bind() again; which would suggest that you can have multible bind()s
> but only a single listen()?  Or am I confused?

Nope - very definitely me who messed up the message.  v2 on its way.

~Andrew

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

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-09 13:10 [PATCH qemu-traditional] qemu: Fix race condition when binding ports Andrew Cooper
2013-12-09 13:17 ` George Dunlap
2013-12-09 13:25   ` Andrew Cooper [this message]
2013-12-09 13:27   ` [PATCH v2 qemu-traditional] qemu: Fix race condition when opening ports Andrew Cooper
2013-12-09 13:36     ` Ian Campbell
2013-12-09 15:23     ` Frediano Ziglio
2013-12-09 15:50       ` Andrew Cooper
2013-12-10 15:28     ` Ian Jackson
2013-12-10 15:38       ` Frediano Ziglio

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=52A5C4E3.9070402@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=stefano.stabellini@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.