From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH] xenconsole: Allow non-interactive use Date: Thu, 23 Jul 2015 16:23:11 +0100 Message-ID: <1437664991.24746.10.camel@citrix.com> References: <1437584888-9074-1-git-send-email-martin@lucina.net> <1437641330.19412.37.camel@citrix.com> <20150723150915.GA23015@nodbug.lucina.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZIILU-0005jv-6R for xen-devel@lists.xenproject.org; Thu, 23 Jul 2015 15:23:40 +0000 In-Reply-To: <20150723150915.GA23015@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, Wei Liu , Ian Jackson , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Thu, 2015-07-23 at 17:09 +0200, Martin Lucina wrote: > > But maybe it would be better to set max_fd = -1 on declaration and > > do > > the max dance here as with the following cases? > > Declaring max_fd = -1 is indeed clearer, I can do a v2 with that > change if you like. If you are happy to then yes, please. > One other bug that my change makes potentially easier to trigger is that > you can run "xl console DOMID" multiple times with the same DOMID and the > result is broken; each instance gets part of the data written to the > console. > > Any ideas on how to address this in a simple fashion? Perhaps the client should take some exclusive lock (fcntl based?) on an fd of an open file with domid in the name. Failure to get the lock should result in the client exiting with some message indicating the console is in use. Ian.