mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 14:25:49 +00:00
cg: Dump cgroups tasks live in
Each task points to a single ID of cgroup-set it lives in. This is done so to save some space in the image, as tasks likely live in the same set of cgroups. Other than this we keep track of what cgroup set we dump the subtree from. If it happens, that root task lives in the same cgroup set as criu does, we don't allow for any other sub-cgroups and make restore (next patch) much simpler and faster. Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
@@ -700,6 +700,11 @@ static int dump_task_core_all(struct pstree_item *item,
|
||||
if (ret)
|
||||
goto err;
|
||||
|
||||
core->tc->has_cg_set = true;
|
||||
ret = dump_task_cgroup(item, &core->tc->cg_set);
|
||||
if (ret)
|
||||
goto err;
|
||||
|
||||
ret = pb_write_one(fd_core, core, PB_CORE);
|
||||
if (ret < 0)
|
||||
goto err;
|
||||
@@ -1794,6 +1799,10 @@ int cr_dump_tasks(pid_t pid)
|
||||
if (dump_namespaces(root_item, root_ns_mask) < 0)
|
||||
goto err;
|
||||
|
||||
ret = dump_cgroups();
|
||||
if (ret)
|
||||
goto err;
|
||||
|
||||
ret = cr_dump_shmem();
|
||||
if (ret)
|
||||
goto err;
|
||||
|
Reference in New Issue
Block a user