[CRIU] [PATCH 1/5] options: Add --ext-tty option

Cyrill Gorcunov gorcunov at openvz.org
Thu Sep 27 08:17:38 EDT 2012


In case if we reach a situation where the dumpee
has only slave peer of tty connection the special
dump option should be passed telling us that we
need to try to connect slave peer to some external
master peer on restore.

Without this option we simply refuse to dump.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 crtools.c         |    5 +++++
 include/crtools.h |    1 +
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/crtools.c b/crtools.c
index d2a79a0..121e2da 100644
--- a/crtools.c
+++ b/crtools.c
@@ -98,6 +98,7 @@ int main(int argc, char *argv[])
 			{ "pidfile", required_argument, 0, 46},
 			{ "veth-pair", required_argument, 0, 47},
 			{ "action-script", required_argument, 0, 49},
+			{ "ext-tty", no_argument, 0, 50},
 			{ },
 		};
 
@@ -212,6 +213,9 @@ int main(int argc, char *argv[])
 				list_add(&script->node, &opts.scripts);
 			}
 			break;
+		case 50:
+			opts.ext_tty = true;
+			break;
 		case 'V':
 			pr_msg("Version: %d.%d\n", CRIU_VERSION_MAJOR, CRIU_VERSION_MINOR);
 			return 0;
@@ -306,6 +310,7 @@ usage:
 	pr_msg("			The environment variable CRTOOL_SCRIPT_ACTION contains one of the actions:\n");
 	pr_msg("			* network-lock - lock network in a target network namespace");
 	pr_msg("			* network-unlock - unlock network in a target network namespace");
+	pr_msg("  --ext-tty             allow external tty connections\n");
 
 	pr_msg("\n* Logging:\n");
 	pr_msg("  -o|--log-file [NAME]  log file name (relative path is relative to --images-dir)\n");
diff --git a/include/crtools.h b/include/crtools.h
index 2fb5abd..10c407d 100644
--- a/include/crtools.h
+++ b/include/crtools.h
@@ -93,6 +93,7 @@ struct cr_options {
 	bool			show_pages_content;
 	bool			restore_detach;
 	bool			ext_unix_sk;
+	bool			ext_tty;
 	bool			tcp_established_ok;
 	bool			evasive_devices;
 	unsigned int		namespaces_flags;
-- 
1.7.7.6



More information about the CRIU mailing list