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

Cyrill Gorcunov gorcunov at openvz.org
Thu Jun 9 11:06:25 PDT 2016


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

diff --git a/images/rpc.proto b/images/rpc.proto
index 9c9ae4891619..0b06c70b43c3 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 bool			freeze_cgroup		= 44;
 }
 
 message criu_dump_resp {
diff --git a/lib/c/criu.c b/lib/c/criu.c
index a2aa4235264a..7065f4547402 100644
--- a/lib/c/criu.c
+++ b/lib/c/criu.c
@@ -385,6 +385,17 @@ 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, bool val)
+{
+	opts->rpc->has_freeze_cgroup = true;
+	opts->rpc->freeze_cgroup = val;
+}
+
+void criu_set_freeze_cgroup(bool val)
+{
+	criu_local_set_freeze_cgroup(global_opts, val);
+}
+
 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..4e0e2ac3031a 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(bool val);
 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, 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_masters(criu_opts *opts, bool val);
-- 
2.5.5



More information about the CRIU mailing list