From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wei Liu Subject: Re: [PATCH v1 03/10] libxl: store a copy of vanilla domain configuration when creating domain Date: Wed, 16 Jul 2014 17:47:30 +0100 Message-ID: <20140716164730.GC4913@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> <1405527488.1087.60.camel@kazak.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: <1405527488.1087.60.camel@kazak.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 Campbell Cc: ian.jackson@eu.citrix.com, Wei Liu , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Wed, Jul 16, 2014 at 05:18:08PM +0100, Ian Campbell wrote: > On Thu, 2014-07-10 at 15:32 +0100, Wei Liu wrote: > > > +/* update the saved domain configuration with a callback function, > > + * which is responsible to pull in useful fields from src. > > + */ > > +typedef void (update_callback)(libxl__gc *, libxl_domain_config *, > > + const libxl_domain_config *); > > +static int libxl__update_domain_configuration(libxl__gc *gc, > > + uint32_t domid, > > + update_callback callback, > > + const libxl_domain_config *src) > > You aren't using your shiny new locking functions here? > We don't need locking here. The lock should already be held (if it needs to be held). Note, this is not async callback, this is just to make it possible to replace the update function at will. Probably renaming "update_callback" to "update" is better? And for larger scope, when creating a domain, there shouldn't be any other thread trying to access the configuration file (is there?), so locking is not necessary. Wei.