[CRIU] [PATCH criu-dev v2] rpc: Add interface --freeze-cgroup option

Cyrill Gorcunov gorcunov at openvz.org
Fri Jun 10 08:53:52 PDT 2016


Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 criu/cr-service.c |  3 +++
 images/rpc.proto  |  2 ++
 lib/c/criu.c      | 10 ++++++++++
 lib/c/criu.h      |  2 ++
 4 files changed, 17 insertions(+)

diff --git a/criu/cr-service.c b/criu/cr-service.c
index bc196eda4dc9..1a32e3b0bf1f 100644
--- a/criu/cr-service.c
+++ b/criu/cr-service.c
@@ -454,6 +454,9 @@ static int setup_opts_from_req(int sk, CriuOpts *req)
 		opts.manage_cgroups = mode;
 	}
 
+	if (req->freeze_cgroup)
+		opts.freeze_cgroup = req->freeze_cgroup;
+
 	if (req->cgroup_props)
 		opts.cgroup_props = req->cgroup_props;
 
diff --git a/images/rpc.proto b/images/rpc.proto
index 9c9ae4891619..c14e68ae276a 100644
--- a/images/rpc.proto
+++ b/images/rpc.proto
@@ -102,6 +102,8 @@ message criu_opts {
 	optional string			cgroup_props		= 41;
 	optional string			cgroup_props_file	= 42;
 	repeated string			cgroup_dump_controller	= 43;
+
+	optional string			freeze_cgroup		= 44;
 }
 
 message criu_dump_resp {
diff --git a/lib/c/criu.c b/lib/c/criu.c
index a2aa4235264a..c5802af25cb6 100644
--- a/lib/c/criu.c
+++ b/lib/c/criu.c
@@ -385,6 +385,16 @@ void criu_set_manage_cgroups_mode(enum criu_cg_mode mode)
 	criu_local_set_manage_cgroups_mode(global_opts, mode);
 }
 
+void criu_local_set_freeze_cgroup(criu_opts *opts, char *name)
+{
+	opts->rpc->freeze_cgroup = name;
+}
+
+void criu_set_freeze_cgroup(char *name)
+{
+	criu_local_set_freeze_cgroup(global_opts, name);
+}
+
 void criu_local_set_auto_ext_mnt(criu_opts *opts, bool val)
 {
 	opts->rpc->has_auto_ext_mnt = true;
diff --git a/lib/c/criu.h b/lib/c/criu.h
index 1085cd3decd4..bd31666c8444 100644
--- a/lib/c/criu.h
+++ b/lib/c/criu.h
@@ -78,6 +78,7 @@ 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(enum criu_cg_mode mode);
+void criu_set_freeze_cgroup(char *name);
 void criu_set_auto_ext_mnt(bool val);
 void criu_set_ext_sharing(bool val);
 void criu_set_ext_masters(bool val);
@@ -180,6 +181,7 @@ 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, enum criu_cg_mode mode);
+void criu_local_set_freeze_cgroup(criu_opts *opts, char *name);
 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);
-- 
2.5.5



More information about the CRIU mailing list