Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/checkpoint-restore/criu.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@parallels.com>2014-08-22 16:10:27 +0400
committerPavel Emelyanov <xemul@parallels.com>2014-08-22 19:20:03 +0400
commit7947ea7111276b6789f639784f093bbb8a9f8a56 (patch)
tree0c229eda4e743b4d0d22389037cd8aa3dcfe83a3
parentad4d91241afd1e5824fbcecb0e9f9b74e9c94346 (diff)
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>
-rw-r--r--cgroup.c5
-rw-r--r--crtools.c17
2 files changed, 15 insertions, 7 deletions
diff --git a/cgroup.c b/cgroup.c
index 24d27fef9..afa31b978 100644
--- a/cgroup.c
+++ b/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;
diff --git a/crtools.c b/crtools.c
index 27164c4f5..afdc59bf4 100644
--- a/crtools.c
+++ b/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':