diff options
author | Adrian Reber <areber@redhat.com> | 2021-12-01 14:08:53 +0300 |
---|---|---|
committer | Andrei Vagin <avagin@gmail.com> | 2022-04-29 03:53:52 +0300 |
commit | 0e04a3c6a6f0aec894b62984308693270ddf356c (patch) | |
tree | b030533c88c56df2f4a7a5790c5baaf0e60c3847 /lib | |
parent | af298353dc200f596051c29cf7c3477f87d6cf04 (diff) |
libcriu: add setting lsm-mount-context to libcriu
Signed-off-by: Adrian Reber <areber@redhat.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/c/criu.c | 15 | ||||
-rw-r--r-- | lib/c/criu.h | 2 |
2 files changed, 17 insertions, 0 deletions
diff --git a/lib/c/criu.c b/lib/c/criu.c index ddc6e0731..4ee189aca 100644 --- a/lib/c/criu.c +++ b/lib/c/criu.c @@ -238,6 +238,7 @@ void criu_local_free_opts(criu_opts *opts) free(opts->rpc->freeze_cgroup); free(opts->rpc->log_file); free(opts->rpc->lsm_profile); + free(opts->rpc->lsm_mount_context); free(opts->rpc); criu_free_service(opts); free(opts); @@ -651,6 +652,20 @@ int criu_set_lsm_profile(const char *name) return criu_local_set_lsm_profile(global_opts, name); } +int criu_local_set_lsm_mount_context(criu_opts *opts, const char *name) +{ + opts->rpc->lsm_mount_context = strdup(name); + if (opts->rpc->lsm_mount_context == NULL) { + return -ENOMEM; + } + return 0; +} + +int criu_set_lsm_mount_context(const char *name) +{ + return criu_local_set_lsm_mount_context(global_opts, name); +} + void criu_local_set_timeout(criu_opts *opts, unsigned int timeout) { opts->rpc->timeout = timeout; diff --git a/lib/c/criu.h b/lib/c/criu.h index 949902f55..a374b37f8 100644 --- a/lib/c/criu.h +++ b/lib/c/criu.h @@ -92,6 +92,7 @@ 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); +int criu_set_lsm_mount_context(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); @@ -249,6 +250,7 @@ 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); +int criu_local_set_lsm_mount_context(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); |