[CRIU] [PATCH] criu: add RPC interface for skip in-flight connections

Adrian Reber adrian at lisas.de
Mon Jun 20 13:15:29 PDT 2016


From: Adrian Reber <areber at redhat.com>

For the previously added option to skip in-flight connections this adds
that option to the RPC interface. The skip in-flight connections is also
described in criu.txt.

Signed-off-by: Adrian Reber <areber at redhat.com>
---
 Documentation/criu.txt |  7 +++++++
 criu/cr-service.c      |  3 +++
 images/rpc.proto       |  2 ++
 lib/c/criu.c           | 11 +++++++++++
 lib/c/criu.h           |  2 ++
 5 files changed, 25 insertions(+)

diff --git a/Documentation/criu.txt b/Documentation/criu.txt
index 55f05c0..39a6685 100644
--- a/Documentation/criu.txt
+++ b/Documentation/criu.txt
@@ -199,6 +199,13 @@ Thus for command line argument the example above will look like:
 *--tcp-established*::
     Checkpoint established TCP connections.
 
+*--skip-in-flight*::
+    This option skips in-flight TCP connections. If TCP connections
+    are found which are not yet completely established, criu will
+    ignore these connections in favor of erroring out.
+    The TCP stack on the client side is expected to handle the
+    re-connect gracefully.
+
 *--veth-pair* '<IN>'*=*'<OUT>'::
     Correspondence between outside and inside names of veth devices.
 
diff --git a/criu/cr-service.c b/criu/cr-service.c
index 1a32e3b..d03c832 100644
--- a/criu/cr-service.c
+++ b/criu/cr-service.c
@@ -322,6 +322,9 @@ static int setup_opts_from_req(int sk, CriuOpts *req)
 	if (req->has_tcp_established)
 		opts.tcp_established_ok = req->tcp_established;
 
+	if (req->has_tcp_skip_in_flight)
+		opts.tcp_skip_in_flight = req->tcp_skip_in_flight;
+
 	if (req->has_evasive_devices)
 		opts.evasive_devices = req->evasive_devices;
 
diff --git a/images/rpc.proto b/images/rpc.proto
index c14e68a..b0742f8 100644
--- a/images/rpc.proto
+++ b/images/rpc.proto
@@ -104,6 +104,8 @@ message criu_opts {
 	repeated string			cgroup_dump_controller	= 43;
 
 	optional string			freeze_cgroup		= 44;
+
+	optional bool			tcp_skip_in_flight	= 45;
 }
 
 message criu_dump_resp {
diff --git a/lib/c/criu.c b/lib/c/criu.c
index c5802af..a09c2ea 100644
--- a/lib/c/criu.c
+++ b/lib/c/criu.c
@@ -309,6 +309,17 @@ void criu_set_tcp_established(bool tcp_established)
 	criu_local_set_tcp_established(global_opts, tcp_established);
 }
 
+void criu_local_set_tcp_skip_in_flight(criu_opts *opts, bool tcp_skip_in_flight)
+{
+	opts->rpc->has_tcp_skip_in_flight	= true;
+	opts->rpc->tcp_skip_in_flight		= tcp_skip_in_flight;
+}
+
+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_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 bd31666..e66b061 100644
--- a/lib/c/criu.h
+++ b/lib/c/criu.h
@@ -65,6 +65,7 @@ void criu_set_leave_running(bool leave_running);
 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_evasive_devices(bool evasive_devices);
 void criu_set_shell_job(bool shell_job);
 void criu_set_file_locks(bool file_locks);
@@ -168,6 +169,7 @@ void criu_local_set_leave_running(criu_opts *opts, bool leave_running);
 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_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);
-- 
1.8.3.1



More information about the CRIU mailing list