From: Ian Jackson Subject: Re: [PATCH 08/19] libxc: suspend: Fix suspend event channel locking Date: Thu, 13 Mar 2014 18:46:17 +0000 Message-ID: <21281.64761.318934.920601@mariner.uk.xensource.com> References: <1393945016-1417-1-git-send-email-ian.jackson@eu.citrix.com> <1393945016-1417-9-git-send-email-ian.jackson@eu.citrix.com> <1394729275.16364.13.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1394729275.16364.13.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: Shriram Rajagopalan , xen-devel@lists.xensource.com, Lai Jiangshan , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org Ian Campbell writes ("Re: [PATCH 08/19] libxc: suspend: Fix suspend event channel locking"): > On Tue, 2014-03-04 at 14:56 +0000, Ian Jackson wrote: > > Use fcntl F_SETLK, rather than writing our pid into a "lock" file. > > That way if we crash we don't leave the lockfile lying about. Callers > > now need to keep the fd for our lockfile. (We don't use flock because > > we don't want anyone who inherits this fd across fork to end up with a > > handle onto the lock.) > > > > While we are here: > > * Move the lockfile to /var/run/xen > > There isn't some autoconf'y path we should use is there? SUBSYS_DIR, > localstatedir etc? There does seem to be, but I'm not really convinced that it's the right thing. > Probably we don't really use those elsewhere so it is consistent to > use /var directly here too. I did a grep for uses of /var/run in the whole tree, and of /var in libxl. libxl has /var/lib and /var/log hardcoded but not /var/run yet. But xenstored, xenmon, and many of our scripts, have it hardcoded in one way or another. So I think this is OK. Systems which are using /run will have a symlink for /var/run. Thanks, Ian.