mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-17 16:47:50 +00:00
Enable manage cgroup modes in criu service
Signed-off-by: Hui Kang <hkang.sunysb@gmail.com> Looks-good-to: Ruslan Kuprieiev <kupruser@gmail.com> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
parent
231b61d692
commit
3d1e8c6883
4 changed files with 20 additions and 1 deletions
|
|
@ -400,6 +400,10 @@ static int setup_opts_from_req(int sk, CriuOpts *req)
|
|||
if (req->has_manage_cgroups)
|
||||
opts.manage_cgroups = req->manage_cgroups ? CG_MODE_SOFT : CG_MODE_IGNORE;
|
||||
|
||||
/* Override the manage_cgroup if mode is set explicitly */
|
||||
if (req->has_manage_cgroups_mode) {
|
||||
opts.manage_cgroups = req->manage_cgroups_mode;
|
||||
|
||||
if (req->has_auto_ext_mnt)
|
||||
opts.autodetect_ext_mounts = req->auto_ext_mnt;
|
||||
|
||||
|
|
|
|||
11
lib/criu.c
11
lib/criu.c
|
|
@ -375,6 +375,17 @@ void criu_set_manage_cgroups(bool manage)
|
|||
criu_local_set_manage_cgroups(global_opts, manage);
|
||||
}
|
||||
|
||||
void criu_local_set_manage_cgroups_mode(criu_opts *opts, unsigned int mode)
|
||||
{
|
||||
opts->rpc->has_manage_cgroups_mode = true;
|
||||
opts->rpc->manage_cgroups_mode = mode;
|
||||
}
|
||||
|
||||
void criu_set_manage_cgroups_mode(unsigned int mode)
|
||||
{
|
||||
criu_local_set_manage_cgroups_mode(global_opts, mode);
|
||||
}
|
||||
|
||||
void criu_local_set_auto_ext_mnt(criu_opts *opts, bool val)
|
||||
{
|
||||
opts->rpc->has_auto_ext_mnt = true;
|
||||
|
|
|
|||
|
|
@ -67,6 +67,7 @@ void criu_set_log_file(char *log_file);
|
|||
void criu_set_cpu_cap(unsigned int cap);
|
||||
void criu_set_root(char *root);
|
||||
void criu_set_manage_cgroups(bool manage);
|
||||
void criu_set_manage_cgroups_mode(unsigned int mode);
|
||||
void criu_set_auto_ext_mnt(bool val);
|
||||
void criu_set_ext_sharing(bool val);
|
||||
void criu_set_ext_masters(bool val);
|
||||
|
|
@ -166,6 +167,7 @@ void criu_local_set_log_file(criu_opts *opts, char *log_file);
|
|||
void criu_local_set_cpu_cap(criu_opts *opts, unsigned int cap);
|
||||
void criu_local_set_root(criu_opts *opts, char *root);
|
||||
void criu_local_set_manage_cgroups(criu_opts *opts, bool manage);
|
||||
void criu_local_set_manage_cgroups_mode(criu_opts *opts, unsigned int mode);
|
||||
void criu_local_set_auto_ext_mnt(criu_opts *opts, bool val);
|
||||
void criu_local_set_ext_sharing(criu_opts *opts, bool val);
|
||||
void criu_local_set_ext_masters(criu_opts *opts, bool val);
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ message criu_opts {
|
|||
repeated string exec_cmd = 22;
|
||||
|
||||
repeated ext_mount_map ext_mnt = 23;
|
||||
optional bool manage_cgroups = 24;
|
||||
optional bool manage_cgroups = 24; /* backward compatibility */
|
||||
repeated cgroup_root cg_root = 25;
|
||||
|
||||
optional bool rst_sibling = 26; /* swrk only */
|
||||
|
|
@ -74,6 +74,8 @@ message criu_opts {
|
|||
repeated string enable_fs = 32;
|
||||
|
||||
repeated unix_sk unix_sk_ino = 33;
|
||||
|
||||
optional uint32 manage_cgroups_mode = 34;
|
||||
}
|
||||
|
||||
message criu_dump_resp {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue