From 0dfdd052e7e0a1724d03f2662d36ce1f462127fc Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Tue, 21 Apr 2015 16:09:44 +0300 Subject: [PATCH] show: Deprecate this action in criu tool Now we have the crit utility to print images' contents in the human-readable format, so show can be thrown out some time soon. For now let's just deprecate it and leave functional only when the output is asked into non-terminal. I.e. the plan shell "criu show -f" will not work. Signed-off-by: Pavel Emelyanov Acked-by: Cyrill Gorcunov --- cr-show.c | 6 ++++++ crtools.c | 9 --------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/cr-show.c b/cr-show.c index 9703a5a65..cafc2a666 100644 --- a/cr-show.c +++ b/cr-show.c @@ -553,6 +553,12 @@ out: int cr_show(int pid) { + if (isatty(STDOUT_FILENO)) { + pr_msg("The \"show\" action is deprecated by the CRIT utility.\n"); + pr_msg("To view an image use the \"crit decode -i $name --pretty\" command.\n"); + return -1; + } + if (opts.show_dump_file) return cr_parse_file(); diff --git a/crtools.c b/crtools.c index 3c64ad239..6da7afeed 100644 --- a/crtools.c +++ b/crtools.c @@ -604,7 +604,6 @@ usage: "Usage:\n" " criu dump|pre-dump -t PID []\n" " criu restore []\n" -" criu show (-D DIR)|(-f FILE) []\n" " criu check [--ms]\n" " criu exec -p PID \n" " criu page-server\n" @@ -615,7 +614,6 @@ usage: " dump checkpoint a process/tree identified by pid\n" " pre-dump pre-dump task(s) minimizing their frozen time\n" " restore restore a process/tree\n" -" show show dump file(s) contents\n" " check checks whether the kernel support is up-to-date\n" " exec execute a system call by other task\n" " page-server launch page server\n" @@ -704,13 +702,6 @@ usage: " --port PORT port of page server\n" " -d|--daemon run in the background after creating socket\n" "\n" -"Show options:\n" -" -f|--file FILE show contents of a checkpoint file\n" -" -F|--fields FIELDS show specified fields (comma separated)\n" -" -D|--images-dir DIR directory where to get images from\n" -" -c|--contents show contents of pages dumped in hexdump format\n" -" -p|--pid PID show files relevant to PID (filter -D flood)\n" -"\n" "Other options:\n" " -h|--help show this text\n" " -V|--version show version\n"