From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH] xenconsole: Ensure exclusive access to console using locks Date: Fri, 24 Jul 2015 14:54:14 +0100 Message-ID: <1437746054.24746.109.camel@citrix.com> References: <1437738262.24746.79.camel@citrix.com> <1437742310-14193-1-git-send-email-martin@lucina.net> <1437743460.24746.88.camel@citrix.com> <20150724134027.GE25338@nodbug.lucina.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZIdQZ-0003O9-93 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2015 13:54:19 +0000 In-Reply-To: <20150724134027.GE25338@nodbug.lucina.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: Martin Lucina Cc: xen-devel@lists.xenproject.org, Ian Jackson , Wei Liu , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Fri, 2015-07-24 at 15:40 +0200, Martin Lucina wrote: > On Friday, 24.07.2015 at 14:11, Ian Campbell wrote: > > I'm afraid this (delving into another components private headers) isn't > > allowed. Instead you should add the two lines to tools/console/Makefile > > to generate a local _paths.h: > > > > genpath-target = $(call buildmakevars2header,_paths.h) > > $(eval $(genpath-target)) > > > > Plus a dependency on it in the xenconsole rule and a .gitignore entry. > > > > You might want to generate client/_paths.h instead to avoid needing to > > muck around with CFLAGS. > > The above works, but causes genpath-target to be re-run each time "make" > is > called in tools/console, i.e. no longer says "Nothing to be done for > all". > I presume that's ok? I think so, yes. > > I think you can use string concatenation here, e.g. > > XEN_LOCK_DIR "/xenconsole.%d" > > > > > > Given the known limits on the size of domid it would probably be > > possible to figure out a tighter limit than PATH_MAX. > > Ok, I can just make it the usual 255 ... Or sizeof(XEN_LOCK_DIR"/xenconsole.") + 8 ? (8 being more digits that any valid domid can have), which avoids problems with people putting the lock dir somewhere ludicrous. Ian.