mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-17 16:47:50 +00:00
crtools: Make new_cg_root_add setup global root too
This is to make it convenient for service to setup the same thing. Signed-off-by: Pavel Emelyanov <xemul@parallels.com> Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
This commit is contained in:
parent
ad4d91241a
commit
7947ea7111
2 changed files with 15 additions and 7 deletions
5
cgroup.c
5
cgroup.c
|
|
@ -1338,6 +1338,11 @@ int new_cg_root_add(char *controller, char *newroot)
|
|||
{
|
||||
struct cg_root_opt *o;
|
||||
|
||||
if (!controller) {
|
||||
opts.new_global_cg_root = newroot;
|
||||
return 0;
|
||||
}
|
||||
|
||||
o = xmalloc(sizeof(*o));
|
||||
if (!o)
|
||||
return -1;
|
||||
|
|
|
|||
17
crtools.c
17
crtools.c
|
|
@ -364,17 +364,20 @@ int main(int argc, char *argv[])
|
|||
break;
|
||||
case 61:
|
||||
{
|
||||
char *aux;
|
||||
char *path, *ctl;
|
||||
|
||||
aux = strchr(optarg, ':');
|
||||
if (!aux) {
|
||||
opts.new_global_cg_root = optarg;
|
||||
path = strchr(optarg, ':');
|
||||
if (path) {
|
||||
*path = '\0';
|
||||
path++;
|
||||
ctl = optarg;
|
||||
} else {
|
||||
*aux = '\0';
|
||||
if (new_cg_root_add(optarg, aux + 1))
|
||||
return -1;
|
||||
path = optarg;
|
||||
ctl = NULL;
|
||||
}
|
||||
|
||||
if (new_cg_root_add(ctl, path))
|
||||
return -1;
|
||||
}
|
||||
break;
|
||||
case 'M':
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue