[CRIU] [PATCH 2/5 v5] Change tcp-close option to negated style

vkabatov at redhat.com vkabatov at redhat.com
Tue Jun 20 16:14:09 MSK 2017


From: Veronika Kabatova <vkabatov at redhat.com>

Code for tcp-close option was added after boolean-valued options
were modified to accept their negations as well. Since tcp-close
option works only with boolean values and does not accept any
argument, it should be wriiten in the same manner to allow users
to override the value when using configuration files.

Signed-off-by: Veronika Kabatova <vkabatov at redhat.com>
---
 criu/crtools.c            | 5 +----
 criu/include/cr_options.h | 2 +-
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/criu/crtools.c b/criu/crtools.c
index 0aeedbe..72a5ff2 100644
--- a/criu/crtools.c
+++ b/criu/crtools.c
@@ -311,7 +311,7 @@ int main(int argc, char *argv[], char *envp[])
 		BOOL_OPT("display-stats", &opts.display_stats),
 		BOOL_OPT("weak-sysctls", &opts.weak_sysctls),
 		{ "status-fd",			required_argument,	0, 1088 },
-		{ SK_CLOSE_PARAM, 		no_argument,		0, 1089 },
+		BOOL_OPT(SK_CLOSE_PARAM, &opts.tcp_close),
 		BOOL_OPT("remote", &opts.remote),
 		{ "verbosity",			optional_argument,	0, 'v'	},
 		{ },
@@ -613,9 +613,6 @@ int main(int argc, char *argv[], char *envp[])
 				return 1;
 			}
 			break;
-		case 1089:
-			opts.tcp_close = true;
-			break;
 		case 'V':
 			pr_msg("Version: %s\n", CRIU_VERSION);
 			if (strcmp(CRIU_GITID, "0"))
diff --git a/criu/include/cr_options.h b/criu/include/cr_options.h
index 6656fc7..4e4a1d0 100644
--- a/criu/include/cr_options.h
+++ b/criu/include/cr_options.h
@@ -63,7 +63,7 @@ struct cr_options {
 	int			shell_job;
 	int			handle_file_locks;
 	int			tcp_established_ok;
-	bool			tcp_close;
+	int			tcp_close;
 	int			evasive_devices;
 	int			link_remap_ok;
 	int			log_file_per_pid;
-- 
2.7.4



More information about the CRIU mailing list