Commit 9ba5c935 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

options: Add "--shell-job" option

This option will tells the tool to procceed dumping
even if a root task is not a session leader.

This implies that this option will allow to "migrate"
one external tty connection. Say a person may dump
"top" application in one bash shell and restore it
in another shell session.
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 9c579cfd
...@@ -60,7 +60,7 @@ int main(int argc, char *argv[]) ...@@ -60,7 +60,7 @@ int main(int argc, char *argv[])
int log_inited = 0; int log_inited = 0;
int log_level = 0; int log_level = 0;
static const char short_opts[] = "dsf:t:hcD:o:n:vxVr:"; static const char short_opts[] = "dsf:t:hcD:o:n:vxVr:j";
BUILD_BUG_ON(PAGE_SIZE != PAGE_IMAGE_SIZE); BUILD_BUG_ON(PAGE_SIZE != PAGE_IMAGE_SIZE);
...@@ -99,6 +99,7 @@ int main(int argc, char *argv[]) ...@@ -99,6 +99,7 @@ int main(int argc, char *argv[])
{ "veth-pair", required_argument, 0, 47}, { "veth-pair", required_argument, 0, 47},
{ "action-script", required_argument, 0, 49}, { "action-script", required_argument, 0, 49},
{ LREMAP_PARAM, no_argument, 0, 41}, { LREMAP_PARAM, no_argument, 0, 41},
{ "shell-job", no_argument, 0, 'j'},
{ }, { },
}; };
...@@ -217,6 +218,9 @@ int main(int argc, char *argv[]) ...@@ -217,6 +218,9 @@ int main(int argc, char *argv[])
list_add(&script->node, &opts.scripts); list_add(&script->node, &opts.scripts);
} }
break; break;
case 'j':
opts.shell_job = true;
break;
case 'V': case 'V':
pr_msg("Version: %d.%d\n", CRIU_VERSION_MAJOR, CRIU_VERSION_MINOR); pr_msg("Version: %d.%d\n", CRIU_VERSION_MAJOR, CRIU_VERSION_MINOR);
return 0; return 0;
...@@ -312,6 +316,7 @@ usage: ...@@ -312,6 +316,7 @@ usage:
pr_msg(" The environment variable CRTOOL_SCRIPT_ACTION contains one of the actions:\n"); 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\n"); pr_msg(" * network-lock - lock network in a target network namespace\n");
pr_msg(" * network-unlock - unlock network in a target network namespace\n"); pr_msg(" * network-unlock - unlock network in a target network namespace\n");
pr_msg(" -j|--shell-job allow to dump and restore shell jobs\n");
pr_msg("\n* Logging:\n"); pr_msg("\n* Logging:\n");
pr_msg(" -o|--log-file [NAME] log file name (relative path is relative to --images-dir)\n"); pr_msg(" -o|--log-file [NAME] log file name (relative path is relative to --images-dir)\n");
......
...@@ -93,6 +93,7 @@ struct cr_options { ...@@ -93,6 +93,7 @@ struct cr_options {
bool show_pages_content; bool show_pages_content;
bool restore_detach; bool restore_detach;
bool ext_unix_sk; bool ext_unix_sk;
bool shell_job;
bool tcp_established_ok; bool tcp_established_ok;
bool evasive_devices; bool evasive_devices;
bool link_remap_ok; bool link_remap_ok;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment