From: Wei Liu Subject: Re: [PATCH v1 03/10] libxl: store a copy of vanilla domain configuration when creating domain Date: Fri, 25 Jul 2014 16:43:50 +0100 Message-ID: <20140725154350.GM28444@zion.uk.xensource.com> References: <1405002745-5034-1-git-send-email-wei.liu2@citrix.com> <1405002745-5034-4-git-send-email-wei.liu2@citrix.com> <21457.22014.75779.162154@mariner.uk.xensource.com> <20140725105300.GJ28444@zion.uk.xensource.com> <21458.28978.730284.366384@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <21458.28978.730284.366384@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: Wei Liu , ian.campbell@citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Fri, Jul 25, 2014 at 04:01:06PM +0100, Ian Jackson wrote: [...] > > > > + /* update network interface information */ > ... > > > Does creating the config early, and then updating it, not mean that > > > there will be a window during domain creation when configuration > > > exists but lacks these updates ? > > > > > > I think that might be a (theoretically application-visible) bug. > > > > Yes, there's such windows. > > > > Ian C suggested I add lock during creation, which I think should fix > > this problem. > > I don't think that's a particularly good idea. Such a lock would > presumably cover most of the domain creation work (hotplug scripts > etc) which might take a long time. > > During that time various operations would block unreasonably. > That's a bit unfortunate. But what can we do to close that window? I think no good will come out if I try to fiddle with domain state during creation anyway, so locking like this may be acceptable? > Also, I think you mustn't use an fcntl lock across ao operation > callback chains. fcntl locks do not exclude other threads in the same > process. > Then we need both mutex and file lock? Mutex to protect against threads in the same process while file lock protect against other processes. Wei.