[CRIU] [PATCH 1/2] Re-create cgroups if necessary

Serge Hallyn serge.hallyn at ubuntu.com
Wed Jun 25 08:55:02 PDT 2014


Quoting Pavel Emelyanov (xemul at parallels.com):
> On 06/25/2014 07:06 PM, Serge Hallyn wrote:
> 
> > Another complication, btw, will be to do with relative cgroup paths.  I can
> > probably abstract that behind the cgmanager abstraction when I add that,
> > but idea is - if I checkpointed u1 on the host, in /cpuset/lxc/u1, and now
> > restart it inside a nested container, then it should be restarted at
> > /cpuset/lxc/somecontainer/lxc/u1, perhaps even /cpuset/lxc/u1/lxc/u1.
> 
> How about do it two-step.
> 
> First, on dump all cgroup paths are dumped relative to root task groups.

What do you mean by 'root task groups'.

I would suggest:  For each task, dump the cgroup path relative to the
init task being dumped.  For the cgroup hierarchy, dump the path up to
the dumping task's init's cgroups.

Then at restore, simply restore relative to the restoring path's init's
cgroups.

> It's not so yet, but since we in -rc we can change that. Next, on restore
> we tell the --cgroup-root $path option that would prepend $path to all
> cgroup paths from the image.
> 
> With your example the /lxc/u1 would get trimmed from tasks' cgroup paths on
> dump and on restore you'd be able to say --cgroup-root /cpuset/lxc/u1/lxc/u1.


More information about the CRIU mailing list