[CRIU] [Q] cgroup roots rewritting

Cyrill Gorcunov gorcunov at gmail.com
Mon May 16 12:27:36 PDT 2016


Hi Tycho! In commit

commit 16d3fdef31d70958cdd8adfa67847c308416fccd
Author: Tycho Andersen <tycho.andersen at canonical.com>
Date:   Wed Mar 2 16:17:04 2016 -0700

    cgroup: fix --cgroup-root and cgns interaction

you made the following trick:

				...
				/* otherwise, use the old rewriting strategy */
				cg->path = xsprintf("%s%s", to, cg->path +
							strlen(*from) + 1);
				if (!set_from) {
					set_from = true;
					tmp2 = *from;
					*from = xstrdup(to);
				}

And I dont understand why we change @from here. Imagine you have
a several sets of controller all laying in cgroup 300. Then
we need to change it to say 400, and once first match hit
we change source 300 to 400 here and continue trying to
compare with it. Which is wrong I this -- the strstartswith
no longer match old '300' ones for the rest of the set.
What I'm missing here?

We hit a problem when been renaming suspended container --
on restore we give it a new name (400) and criu can't
move taks in nonexisting cgroup 300, which container
had befor the renaming (of course in image all controllers
and sets have old 300 in dirs and paths).

Could you please elaborate which scenario this commit
addresses? Actually the comment in code didn't help much :)

	Cyrill


More information about the CRIU mailing list