mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-17 16:47:50 +00:00
cgroup-v2: make new field is_threaded optional
The new field is_threaded is currently marked as required which causes backward compatibility problem when using newer CRIU version to restore dumped image from older version. This commit makes this field optional and reworks the logic the skip fixing up threaded cgroup controllers if there is no information in dumped image. Signed-off-by: Bui Quang Minh <minhquangbui99@gmail.com>
This commit is contained in:
parent
6e681afb69
commit
529f298913
2 changed files with 3 additions and 2 deletions
|
|
@ -930,6 +930,7 @@ static int dump_controllers(CgroupEntry *cg)
|
|||
list_for_each_entry(cur, &cgroups, l) {
|
||||
cg_controller_entry__init(ce);
|
||||
|
||||
ce->has_is_threaded = true;
|
||||
ce->is_threaded = cur->is_threaded;
|
||||
ce->cnames = cur->controllers;
|
||||
ce->n_cnames = cur->n_controllers;
|
||||
|
|
@ -2002,7 +2003,7 @@ static int cgroupd(int sk)
|
|||
* process must be in this controller. Main thread has been
|
||||
* restored, so this thread is in this controller already.
|
||||
*/
|
||||
if (!ctrl->is_threaded)
|
||||
if (!ctrl->has_is_threaded || !ctrl->is_threaded)
|
||||
continue;
|
||||
|
||||
aux_off = ctrl_dir_and_opt(ctrl, aux, sizeof(aux), NULL, 0);
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ message cgroup_dir_entry {
|
|||
message cg_controller_entry {
|
||||
repeated string cnames = 1;
|
||||
repeated cgroup_dir_entry dirs = 2;
|
||||
required bool is_threaded = 3;
|
||||
optional bool is_threaded = 3;
|
||||
}
|
||||
|
||||
message cg_member_entry {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue