Re: [lxc-devel] [PATCH] cgroup: re-introduce ns cgroup support

2013-09-12 Thread Serge Hallyn
Quoting Christian Seiler (christ...@iwakd.de): > Hi again, > > I was just looking at how to best implement the cgroup mount hook. > Problem now is that the easiest way would be just to create the cgroup > before the clone() (enter is done afterwards anyway) so that the client > has access to handl

Re: [lxc-devel] [PATCH] cgroup: re-introduce ns cgroup support

2013-09-12 Thread Christian Seiler
Hi Serge, >> cgroups and have a separate function for the ns cgroup entries? Then > > Makes perfect sense to me to do so, yes. Since you didn't respond and I was in the mood to finish it, I assumed that you'd be OK with that, see my other set of patches for automatic cgroup mounting. -- Christia

Re: [lxc-devel] [PATCH] cgroup: re-introduce ns cgroup support

2013-09-11 Thread Christian Seiler
Hi again, I was just looking at how to best implement the cgroup mount hook. Problem now is that the easiest way would be just to create the cgroup before the clone() (enter is done afterwards anyway) so that the client has access to handler->pid. Unfortunately, handler->pid is needed for the ns c

Re: [lxc-devel] [PATCH] cgroup: re-introduce ns cgroup support

2013-09-11 Thread Stéphane Graber
On Wed, Sep 11, 2013 at 11:50:54AM -0500, Serge Hallyn wrote: > If a cgroup hierarchy has ns cgroup composed, then we need to treat > that differently: > > 1. The container init will have already been switched to a new cgroup > called after its pid. > 2. We can't move the container init to new dee

Re: [lxc-devel] [PATCH] cgroup: re-introduce ns cgroup support

2013-09-11 Thread Serge Hallyn
Quoting Christian Seiler (christ...@iwakd.de): > Hi Serge, > > Sorry about 'ns' support in my rewrite, I completely forgot that it's > removal was not so long ago. > > I have a two very minor nit-picky comments: > > > +static char *cgroup_rename_nsgroup(char *mountpath, const char *oldname, > >

Re: [lxc-devel] [PATCH] cgroup: re-introduce ns cgroup support

2013-09-11 Thread Christian Seiler
Hi Serge, Sorry about 'ns' support in my rewrite, I completely forgot that it's removal was not so long ago. I have a two very minor nit-picky comments: > +static char *cgroup_rename_nsgroup(char *mountpath, const char *oldname, int > pid, const char *name) > +lxc_cgroup_create(..., int pid) p

[lxc-devel] [PATCH] cgroup: re-introduce ns cgroup support

2013-09-11 Thread Serge Hallyn
If a cgroup hierarchy has ns cgroup composed, then we need to treat that differently: 1. The container init will have already been switched to a new cgroup called after its pid. 2. We can't move the container init to new deeper cgroup directories. So, if we detect an ns cgroup, don't bother tryin