[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] xenconsole: Allow non-interactive use



On Fri, 2015-07-24 at 13:36 +0200, Martin Lucina wrote:
> On Thursday, 23.07.2015 at 16:23, Ian Campbell wrote:
> > 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.
> 
> That begs the question of where to put the lock file. eg. NetBSD does 
> not
> seem to have /var/lock.

Configure ends up defining XEN_LOCK_DIR, so it should go in there
alongside the other locks.

> I tried using flock(pty_fd, LOCK_EX | LOCK_NB) locks directly on the pty
> device and contrary to the documentation claiming support for regular files
> only it worked fine. I tested using the xenconsole code on my Debian dom0,
> and flock(1) on NetBSD. Would you consider this approach?

Only if that functionality was required by POSIX IMHO.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.