[CRIU] [PATCH 2/6] crtools: add "--pretty" option

Kinsbursky Stanislav skinsbursky at openvz.org
Fri Jul 27 10:06:33 EDT 2012


This option is valid only for show command. The short analog is "-p".

Signed-off-by: Stanislav Kinsbursky <skinsbursky at openvz.org>

---
 crtools.c         |    7 ++++++-
 include/crtools.h |    1 +
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/crtools.c b/crtools.c
index 640ae35..94e8cd7 100644
--- a/crtools.c
+++ b/crtools.c
@@ -57,7 +57,7 @@ int main(int argc, char *argv[])
 	int log_inited = 0;
 	int log_level = 0;
 
-	static const char short_opts[] = "dsf:t:hcD:o:n:vxV";
+	static const char short_opts[] = "dsf:t:hcD:o:n:vxVp";
 
 	BUILD_BUG_ON(PAGE_SIZE != PAGE_IMAGE_SIZE);
 
@@ -83,6 +83,7 @@ int main(int argc, char *argv[])
 			{ "close", required_argument, 0, '+' },
 			{ "log-pid", no_argument, 0, ','},
 			{ "version", no_argument, 0, 'V'},
+			{ "pretty", no_argument, 0, 'p'},
 			{ },
 		};
 
@@ -103,6 +104,9 @@ int main(int argc, char *argv[])
 		case 'c':
 			opts.show_pages_content	= true;
 			break;
+		case 'p':
+			opts.show_pretty = true;
+			break;
 		case 'f':
 			opts.show_dump_file = optarg;
 			break;
@@ -259,6 +263,7 @@ usage:
 	pr_msg("  -f|--file             show contents of a checkpoint file\n");
 	pr_msg("  -D|--images-dir       directory where to get images from\n");
 	pr_msg("  -c|--contents         show contents of pages dumped in hexdump format\n");
+	pr_msg("  -p|--pretty           show contents of some images in human enjoyable format\n");
 
 	pr_msg("\nOther options:\n");
 	pr_msg("  -h|--help             show this text\n");
diff --git a/include/crtools.h b/include/crtools.h
index d2a1dce..24dafde 100644
--- a/include/crtools.h
+++ b/include/crtools.h
@@ -77,6 +77,7 @@ struct cr_options {
 	int			final_state;
 	char			*show_dump_file;
 	bool			show_pages_content;
+	bool			show_pretty;
 	bool			restore_detach;
 	bool			ext_unix_sk;
 	bool			tcp_established_ok;



More information about the CRIU mailing list