[CRIU] [PATCH] show: Deprecate this action in criu tool

Pavel Emelyanov xemul at parallels.com
Thu Apr 16 02:51:09 PDT 2015


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 <xemul at parallels.com>
---
 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 9703a5a..cafc2a6 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 3c64ad2..6da7afe 100644
--- a/crtools.c
+++ b/crtools.c
@@ -604,7 +604,6 @@ usage:
 "Usage:\n"
 "  criu dump|pre-dump -t PID [<options>]\n"
 "  criu restore [<options>]\n"
-"  criu show (-D DIR)|(-f FILE) [<options>]\n"
 "  criu check [--ms]\n"
 "  criu exec -p PID <syscall-string>\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"
-- 
1.9.3



More information about the CRIU mailing list