[lxc-devel] [PATCH 1/1] add c->may_control

Serge Hallyn serge.hallyn at ubuntu.com
Mon Sep 30 17:58:47 UTC 2013


Quoting Stéphane Graber (stgraber at ubuntu.com):
> On Mon, Sep 30, 2013 at 09:53:56AM -0400, Dwight Engen wrote:
> > On Fri, 27 Sep 2013 21:01:07 -0500
> > Serge Hallyn <serge.hallyn at ubuntu.com> wrote:
> > 
> > > This is an api function which will return false if the container
> > > is running, and the caller may not talk to its monitor over its
> > > command socket.  Otherwise - if the container is not running, or
> > > the caller may access it - it returns true.
> > > 
> > > We can use this in several tools early on to prevent the segvs
> > > etc which we currently get.
> > > 
> > > Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>
> > 
> > Acked-by: Dwight Engen <dwight.engen at oracle.com>
> 
> Hi Serge,
> 
> So I'm not terribly familiar with the control code since the monitord
> changes, will that code work properly if the container socket is already
> in use (say by someone running lxc-wait on the container)?
> 
> I just want to make sure we won't have a possible hang when calling that
> function.

Yup, good thinking - but it does appear to work correctly.  I got the
same results doing lxc-test-may-control as root and non-root when I
had an lxc-wait -n u1 -s STOPPED going as when I didn't.

-serge




More information about the lxc-devel mailing list