From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jim Fehlig Subject: Re: [PATCH] fix race condition between libvirtd event handling and libxl fd deregister Date: Mon, 10 Dec 2012 16:56:33 -0700 Message-ID: <50C676B1.4070609@suse.com> References: <0451e6041bdd88c90eee.1353395794@linux-bjrd.bjz> <20661.3989.258191.396175@mariner.uk.xensource.com> <1354101923.25834.16.camel@zakaz.uk.xensource.com> <20674.16214.934271.479230@mariner.uk.xensource.com> <1355134766.31710.119.camel@zakaz.uk.xensource.com> <20677.47995.298291.120095@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20677.47995.298291.120095@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson Cc: Bamvor Jian Zhang , Ian Campbell , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org Ian Jackson wrote: > Ian Campbell writes ("Re: [PATCH] fix race condition between libvirtd event handling and libxl fd deregister"): > >> I took Bamvor's most recent response to mean that a per-event lock was >> already in place in libvirt and inferred that this was the reason why >> the originally proposed one line fix worked for them. Perhaps I >> misunderstood? >> > > Yes, I think that's what Bamvor meant but I don't think it's correct > that such a lock eliminates the race. libvirt has to release that > lock before making the callback (to follow the libxl locking rules > which are necessary to avoid deadlock). > And it does. The event loop lock is released just before invoking the callback, and re-acquired just after the callback returns. Jim