[CRIU] [PATCH 2/2] Add --weak_sysctl CLI option to RPC and lib

Pavel Tikhomirov ptikhomirov at virtuozzo.com
Tue Nov 29 08:45:46 PST 2016


Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
---
 criu/cr-service.c |  3 +++
 images/rpc.proto  |  1 +
 lib/c/criu.c      | 11 +++++++++++
 lib/c/criu.h      |  2 ++
 4 files changed, 17 insertions(+)

diff --git a/criu/cr-service.c b/criu/cr-service.c
index 76f315f..00a2d07 100644
--- a/criu/cr-service.c
+++ b/criu/cr-service.c
@@ -327,6 +327,9 @@ static int setup_opts_from_req(int sk, CriuOpts *req)
 	if (req->has_tcp_skip_in_flight)
 		opts.tcp_skip_in_flight = req->tcp_skip_in_flight;
 
+	if (req->has_weak_sysctls)
+		opts.weak_sysctls = req->weak_sysctls;
+
 	if (req->has_evasive_devices)
 		opts.evasive_devices = req->evasive_devices;
 
diff --git a/images/rpc.proto b/images/rpc.proto
index 93a3f63..7cf958c 100644
--- a/images/rpc.proto
+++ b/images/rpc.proto
@@ -107,6 +107,7 @@ message criu_opts {
 	optional string			freeze_cgroup		= 44;
 	optional uint32			timeout			= 45;
 	optional bool			tcp_skip_in_flight	= 46;
+	optional bool			weak_sysctls		= 47;
 }
 
 message criu_dump_resp {
diff --git a/lib/c/criu.c b/lib/c/criu.c
index 76385e0..08806c6 100644
--- a/lib/c/criu.c
+++ b/lib/c/criu.c
@@ -321,6 +321,17 @@ void criu_set_tcp_skip_in_flight(bool tcp_skip_in_flight)
 	criu_local_set_tcp_skip_in_flight(global_opts, tcp_skip_in_flight);
 }
 
+void criu_local_set_weak_sysctls(criu_opts *opts, bool val)
+{
+	opts->rpc->has_weak_sysctls = true;
+	opts->rpc->weak_sysctls	= val;
+}
+
+void criu_set_weak_sysctls(bool val)
+{
+	criu_local_set_weak_sysctls(global_opts, val);
+}
+
 void criu_local_set_evasive_devices(criu_opts *opts, bool evasive_devices)
 {
 	opts->rpc->has_evasive_devices	= true;
diff --git a/lib/c/criu.h b/lib/c/criu.h
index f887b71..5d0b5b6 100644
--- a/lib/c/criu.h
+++ b/lib/c/criu.h
@@ -66,6 +66,7 @@ void criu_set_ext_unix_sk(bool ext_unix_sk);
 int criu_add_unix_sk(unsigned int inode);
 void criu_set_tcp_established(bool tcp_established);
 void criu_set_tcp_skip_in_flight(bool tcp_skip_in_flight);
+void criu_set_weak_sysctls(bool val);
 void criu_set_evasive_devices(bool evasive_devices);
 void criu_set_shell_job(bool shell_job);
 void criu_set_file_locks(bool file_locks);
@@ -173,6 +174,7 @@ void criu_local_set_ext_unix_sk(criu_opts *opts, bool ext_unix_sk);
 int criu_local_add_unix_sk(criu_opts *opts, unsigned int inode);
 void criu_local_set_tcp_established(criu_opts *opts, bool tcp_established);
 void criu_local_set_tcp_skip_in_flight(criu_opts *opts, bool tcp_skip_in_flight);
+void criu_local_set_weak_sysctls(criu_opts *opts, bool val);
 void criu_local_set_evasive_devices(criu_opts *opts, bool evasive_devices);
 void criu_local_set_shell_job(criu_opts *opts, bool shell_job);
 void criu_local_set_file_locks(criu_opts *opts, bool file_locks);
-- 
2.7.4



More information about the CRIU mailing list