From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH v2 qemu-traditional] qemu: Fix race condition when opening ports Date: Mon, 9 Dec 2013 15:50:02 +0000 Message-ID: <52A5E6AA.3030606@citrix.com> References: <52A5C2E6.3080005@eu.citrix.com> <1386595643-8639-1-git-send-email-andrew.cooper3@citrix.com> <4BE945389935F64490EB1C02F3502F63135E5C@AMSPEX01CL01.citrite.net> Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <4BE945389935F64490EB1C02F3502F63135E5C@AMSPEX01CL01.citrite.net> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Frediano Ziglio Cc: Ian Jackson , Stefano Stabellini , Ian Campbell , Xen-devel List-Id: xen-devel@lists.xenproject.org On 09/12/13 15:23, Frediano Ziglio wrote: >> -----Original Message----- >> From: xen-devel-bounces@lists.xen.org [mailto:xen-devel- >> bounces@lists.xen.org] On Behalf Of Andrew Cooper >> Sent: 09 December 2013 1:27 PM >> To: Xen-devel >> Cc: Andrew Cooper; Ian Jackson; Ian Campbell; Stefano Stabellini >> Subject: [Xen-devel] [PATCH v2 qemu-traditional] qemu: Fix race condition >> when opening ports >> >> Two Qemus can race to bind the same VNC port. It is valid for multiple >> bind()s on the same socket to succeed, but only the first listen() will >> succeed. >> >> In the case that two Qemus are starting at the same time, and both tryin= g to >> grab the next free VNC port, the second one will fail with an EADDRINUSE, >> and bail with a fatal error which renders the domain functionally useles= s. >> >> In the case that listen() fails with EADDRINUSE, rebind the socket again= and >> try for the next port. >> >> Signed-off-by: Andrew Cooper >> CC: Ian Campbell >> CC: Ian Jackson >> CC: Stefano Stabellini >> Release-acked-by: George Dunlap > Andrew, if you are upstream other people stuff you should at least give c= redit to the original author. > > Frediano > The original author was "xenhg" according to the history. It is not even clear from the original bug ticket who the author could have been. In this case, my Signed-off-by line falls into category b) of the Developer=92s Certificate of Origin. This is an unfortunate problem with attempting to weed through a neglected patch queue where proper authorship was not considered at the time of commit. ~Andrew