Commit 3d1e8c68 authored by Hui Kang's avatar Hui Kang Committed by Pavel Emelyanov

Enable manage cgroup modes in criu service

Signed-off-by: 's avatarHui Kang <hkang.sunysb@gmail.com>
Looks-good-to: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 231b61d6
...@@ -400,6 +400,10 @@ static int setup_opts_from_req(int sk, CriuOpts *req) ...@@ -400,6 +400,10 @@ static int setup_opts_from_req(int sk, CriuOpts *req)
if (req->has_manage_cgroups) if (req->has_manage_cgroups)
opts.manage_cgroups = req->manage_cgroups ? CG_MODE_SOFT : CG_MODE_IGNORE; 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) if (req->has_auto_ext_mnt)
opts.autodetect_ext_mounts = req->auto_ext_mnt; opts.autodetect_ext_mounts = req->auto_ext_mnt;
......
...@@ -375,6 +375,17 @@ void criu_set_manage_cgroups(bool manage) ...@@ -375,6 +375,17 @@ void criu_set_manage_cgroups(bool manage)
criu_local_set_manage_cgroups(global_opts, 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) void criu_local_set_auto_ext_mnt(criu_opts *opts, bool val)
{ {
opts->rpc->has_auto_ext_mnt = true; opts->rpc->has_auto_ext_mnt = true;
......
...@@ -67,6 +67,7 @@ void criu_set_log_file(char *log_file); ...@@ -67,6 +67,7 @@ void criu_set_log_file(char *log_file);
void criu_set_cpu_cap(unsigned int cap); void criu_set_cpu_cap(unsigned int cap);
void criu_set_root(char *root); void criu_set_root(char *root);
void criu_set_manage_cgroups(bool manage); 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_auto_ext_mnt(bool val);
void criu_set_ext_sharing(bool val); void criu_set_ext_sharing(bool val);
void criu_set_ext_masters(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); ...@@ -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_cpu_cap(criu_opts *opts, unsigned int cap);
void criu_local_set_root(criu_opts *opts, char *root); 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(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_auto_ext_mnt(criu_opts *opts, bool val);
void criu_local_set_ext_sharing(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); void criu_local_set_ext_masters(criu_opts *opts, bool val);
......
...@@ -60,7 +60,7 @@ message criu_opts { ...@@ -60,7 +60,7 @@ message criu_opts {
repeated string exec_cmd = 22; repeated string exec_cmd = 22;
repeated ext_mount_map ext_mnt = 23; 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; repeated cgroup_root cg_root = 25;
optional bool rst_sibling = 26; /* swrk only */ optional bool rst_sibling = 26; /* swrk only */
...@@ -74,6 +74,8 @@ message criu_opts { ...@@ -74,6 +74,8 @@ message criu_opts {
repeated string enable_fs = 32; repeated string enable_fs = 32;
repeated unix_sk unix_sk_ino = 33; repeated unix_sk unix_sk_ino = 33;
optional uint32 manage_cgroups_mode = 34;
} }
message criu_dump_resp { message criu_dump_resp {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment