diff options
author | Tycho Andersen <tycho.andersen@canonical.com> | 2015-03-19 17:50:55 +0300 |
---|---|---|
committer | Pavel Emelyanov <xemul@parallels.com> | 2015-03-31 10:42:55 +0300 |
commit | d266c9bd6e058c10ed3c51180998303fe859a65a (patch) | |
tree | 23afbe04f3dfd17e6a9996df59ba2d12c57bf708 | |
parent | 0458ba6b99824dc391557478cc7e9ba0077a8ae6 (diff) |
finalize cgroups correctly
We need to finalize the cg yard both on successful cgroup restore and on a
failed restore. Further, we should restore the cgroup properties before
allowing the task to continue in all modes (previously properties were only
restored correctly in --restore-detached mode).
CC: Saied Kazemi <saied@google.com>
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
-rw-r--r-- | cr-restore.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/cr-restore.c b/cr-restore.c index e8ef290c3..d5cd09e48 100644 --- a/cr-restore.c +++ b/cr-restore.c @@ -1786,6 +1786,11 @@ static int restore_root_task(struct pstree_item *init) if (ret < 0) goto out_kill; + ret = prepare_cgroup_properties(); + fini_cgroup(); + if (ret < 0) + goto out_kill; + ret = run_scripts(ACT_POST_RESTORE); if (ret != 0) { pr_err("Aborting restore due to script ret code %d\n", ret); @@ -1924,13 +1929,8 @@ int cr_restore_tasks(void) if (criu_signals_setup() < 0) goto err; - if (restore_root_task(root_item) < 0) - goto err; - - ret = prepare_cgroup_properties(); - + ret = restore_root_task(root_item); err: - fini_cgroup(); cr_plugin_fini(CR_PLUGIN_STAGE__RESTORE, ret); return ret; } |