mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 02:14:37 +00:00
rpc/libcriu: Add lsm-profile option
The --lsm-profile option allows a container engine to specify LSM profile name. Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
This commit is contained in:
parent
44a3af2ddb
commit
38769e94d6
4 changed files with 23 additions and 0 deletions
|
|
@ -589,6 +589,11 @@ static int setup_opts_from_req(int sk, CriuOpts *req)
|
|||
if (req->freeze_cgroup)
|
||||
SET_CHAR_OPTS(freeze_cgroup, req->freeze_cgroup);
|
||||
|
||||
if (req->lsm_profile) {
|
||||
opts.lsm_supplied = true;
|
||||
SET_CHAR_OPTS(lsm_profile, req->lsm_profile);
|
||||
}
|
||||
|
||||
if (req->has_timeout)
|
||||
opts.timeout = req->timeout;
|
||||
|
||||
|
|
|
|||
|
|
@ -113,6 +113,7 @@ message criu_opts {
|
|||
optional bool orphan_pts_master = 50;
|
||||
optional string config_file = 51;
|
||||
optional bool tcp_close = 52;
|
||||
optional string lsm_profile = 53;
|
||||
}
|
||||
|
||||
message criu_dump_resp {
|
||||
|
|
|
|||
15
lib/c/criu.c
15
lib/c/criu.c
|
|
@ -224,6 +224,7 @@ void criu_local_free_opts(criu_opts *opts)
|
|||
free(opts->rpc->root);
|
||||
free(opts->rpc->freeze_cgroup);
|
||||
free(opts->rpc->log_file);
|
||||
free(opts->rpc->lsm_profile);
|
||||
free(opts->rpc);
|
||||
criu_free_service(opts);
|
||||
free(opts);
|
||||
|
|
@ -596,6 +597,20 @@ int criu_set_freeze_cgroup(const char *name)
|
|||
return criu_local_set_freeze_cgroup(global_opts, name);
|
||||
}
|
||||
|
||||
int criu_local_set_lsm_profile(criu_opts *opts, const char *name)
|
||||
{
|
||||
opts->rpc->lsm_profile = strdup(name);
|
||||
if(opts->rpc->lsm_profile == NULL) {
|
||||
return -ENOMEM;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int criu_set_lsm_profile(const char *name)
|
||||
{
|
||||
return criu_local_set_lsm_profile(global_opts, name);
|
||||
}
|
||||
|
||||
void criu_local_set_timeout(criu_opts *opts, unsigned int timeout)
|
||||
{
|
||||
opts->rpc->timeout = timeout;
|
||||
|
|
|
|||
|
|
@ -77,6 +77,7 @@ int criu_set_root(const char *root);
|
|||
void criu_set_manage_cgroups(bool manage);
|
||||
void criu_set_manage_cgroups_mode(enum criu_cg_mode mode);
|
||||
int criu_set_freeze_cgroup(const char *name);
|
||||
int criu_set_lsm_profile(const char *name);
|
||||
void criu_set_timeout(unsigned int timeout);
|
||||
void criu_set_auto_ext_mnt(bool val);
|
||||
void criu_set_ext_sharing(bool val);
|
||||
|
|
@ -188,6 +189,7 @@ int criu_local_set_root(criu_opts *opts, const char *root);
|
|||
void criu_local_set_manage_cgroups(criu_opts *opts, bool manage);
|
||||
void criu_local_set_manage_cgroups_mode(criu_opts *opts, enum criu_cg_mode mode);
|
||||
int criu_local_set_freeze_cgroup(criu_opts *opts, const char *name);
|
||||
int criu_local_set_lsm_profile(criu_opts *opts, const char *name);
|
||||
void criu_local_set_timeout(criu_opts *opts, unsigned int timeout);
|
||||
void criu_local_set_auto_ext_mnt(criu_opts *opts, bool val);
|
||||
void criu_local_set_ext_sharing(criu_opts *opts, bool val);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue