[CRIU] [PATCH 2/2] add RPC options for automatic external mount handling

Tycho Andersen tycho.andersen at canonical.com
Tue Apr 21 09:33:55 PDT 2015


Signed-off-by: Tycho Andersen <tycho.andersen at canonical.com>
---
 cr-service.c       |  9 +++++++++
 lib/criu.c         | 18 ++++++++++++++++++
 lib/criu.h         |  3 +++
 protobuf/rpc.proto |  4 ++++
 4 files changed, 34 insertions(+)

diff --git a/cr-service.c b/cr-service.c
index 2173376..ba1d4b2 100644
--- a/cr-service.c
+++ b/cr-service.c
@@ -378,6 +378,15 @@ static int setup_opts_from_req(int sk, CriuOpts *req)
 	if (req->has_manage_cgroups)
 		opts.manage_cgroups = req->manage_cgroups;
 
+	if (req->has_auto_ext_mnt)
+		opts.autodetect_ext_mounts = req->auto_ext_mnt;
+
+	if (req->has_ext_sharing)
+		opts.enable_external_sharing = req->ext_sharing;
+
+	if (req->has_ext_masters)
+		opts.enable_external_masters = req->ext_masters;
+
 	return 0;
 
 err:
diff --git a/lib/criu.c b/lib/criu.c
index ff7e400..1642fb1 100644
--- a/lib/criu.c
+++ b/lib/criu.c
@@ -159,6 +159,24 @@ void criu_set_manage_cgroups(bool manage)
 	opts->manage_cgroups = manage;
 }
 
+void criu_set_auto_ext_mnt(bool val)
+{
+	opts->has_auto_ext_mnt = true;
+	opts->auto_ext_mnt = val;
+}
+
+void criu_set_ext_sharing(bool val)
+{
+	opts->has_ext_sharing = true;
+	opts->ext_sharing = val;
+}
+
+void criu_set_ext_masters(bool val)
+{
+	opts->has_ext_masters = true;
+	opts->ext_masters = val;
+}
+
 void criu_set_log_file(char *log_file)
 {
 	opts->log_file = strdup(log_file);
diff --git a/lib/criu.h b/lib/criu.h
index 18f911e..e1a602f 100644
--- a/lib/criu.h
+++ b/lib/criu.h
@@ -48,6 +48,9 @@ void criu_set_log_file(char *log_file);
 void criu_set_cpu_cap(unsigned int cap);
 void criu_set_root(char *root);
 void criu_set_manage_cgroups(bool manage);
+void criu_set_auto_ext_mnt(bool val);
+void criu_set_ext_sharing(bool val);
+void criu_set_ext_masters(bool val);
 int criu_set_exec_cmd(int argc, char *argv[]);
 int criu_add_ext_mount(char *key, char *val);
 int criu_add_veth_pair(char *in, char *out);
diff --git a/protobuf/rpc.proto b/protobuf/rpc.proto
index 5229a5f..1241b37 100644
--- a/protobuf/rpc.proto
+++ b/protobuf/rpc.proto
@@ -61,6 +61,10 @@ message criu_opts {
 
 	optional bool			rst_sibling	= 26; /* swrk only */
 	repeated inherit_fd		inherit_fd	= 27; /* swrk only */
+
+	optional bool			auto_ext_mnt	= 28;
+	optional bool			ext_sharing 	= 29;
+	optional bool			ext_masters	= 30;
 }
 
 message criu_dump_resp {
-- 
2.1.4



More information about the CRIU mailing list