The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxc/pull/1072

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
Shortly after CRIU 2.3 has been released a patch has been added to skip
in-flight TCP connections. In-flight connections are not completely
established connections (SYN, SYN-ACK). Skipping in-flight TCP
connections means that the client has to re-initiate the connection
establishment.

This patch stores the CRIU version detected during version check, so
that during dump/checkpoint options can be dynamically enabled depending
on the available CRIU version.

Signed-off-by: Adrian Reber <are...@redhat.com>
From ff5fee14f4cae14e1ef49b69a889a3ed81e89bab Mon Sep 17 00:00:00 2001
From: Adrian Reber <are...@redhat.com>
Date: Mon, 4 Jul 2016 16:58:09 +0200
Subject: [PATCH] c/r: drop in-flight connections during CRIU dump

Shortly after CRIU 2.3 has been released a patch has been added to skip
in-flight TCP connections. In-flight connections are not completely
established connections (SYN, SYN-ACK). Skipping in-flight TCP
connections means that the client has to re-initiate the connection
establishment.

This patch stores the CRIU version detected during version check, so
that during dump/checkpoint options can be dynamically enabled depending
on the available CRIU version.

Signed-off-by: Adrian Reber <are...@redhat.com>
---
 src/lxc/criu.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/lxc/criu.c b/src/lxc/criu.c
index a1b7d40..8677655 100644
--- a/src/lxc/criu.c
+++ b/src/lxc/criu.c
@@ -50,6 +50,10 @@
 #define CRIU_GITID_VERSION     "2.0"
 #define CRIU_GITID_PATCHLEVEL  0
 
+#define CRIU_IN_FLIGHT_SUPPORT 240
+
+static int criu_version;
+
 lxc_log_define(lxc_criu, lxc);
 
 struct criu_opts {
@@ -256,6 +260,10 @@ static void exec_criu(struct criu_opts *opts)
                if (ret < 0 || ret >= sizeof(log))
                        goto err;
 
+               if (criu_version >= CRIU_IN_FLIGHT_SUPPORT) {
+                       DECLARE_ARG("--skip-in-flight");
+               }
+
                DECLARE_ARG("--freeze-cgroup");
                DECLARE_ARG(log);
 
@@ -458,8 +466,12 @@ static bool criu_version_ok()
                if (fgetc(f) != '\n')
                        goto version_error;
 
-               if (strcmp(version, CRIU_VERSION) >= 0)
+               if (strcmp(version, CRIU_VERSION) >= 0) {
+                       float tmp = 0;
+                       sscanf(version, "%f", &tmp);
+                       criu_version = (int)(tmp*100);
                        goto version_match;
+               }
 
                if (fscanf(f, "GitID: v%1023[^-]s", version) != 1)
                        goto version_error;
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to