[CRIU] [PATCH 1/3] crit: Explore action and stubs

Pavel Emelyanov xemul at parallels.com
Mon Dec 14 02:19:00 PST 2015


Signed-off-by: Pavel Emelyanov <xemul at parallels.com>
---
 crit | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/crit b/crit
index 2758b01..f054dcf 100755
--- a/crit
+++ b/crit
@@ -17,6 +17,8 @@ def outf(opts):
 	else:
 		return sys.stdout
 
+def dinf(opts, name):
+	return open(os.path.join(opts['dir'], name))
 
 def decode(opts):
 	indent = None
@@ -46,6 +48,15 @@ def info(opts):
 	json.dump(infs, sys.stdout, indent = 4)
 	print
 
+#
+# Explorers
+#
+
+explorers = { }
+
+def explore(opts):
+	explorers[opts['what']](opts)
+
 def main():
 	desc = 'CRiu Image Tool'
 	parser = argparse.ArgumentParser(description=desc,
@@ -84,6 +95,12 @@ def main():
 	info_parser.add_argument("in")
 	info_parser.set_defaults(func=info)
 
+	# Explore
+	x_parser = subparsers.add_parser('x', help = 'explore image dir')
+	x_parser.add_argument('dir')
+	x_parser.add_argument('what', choices = [ ])
+	x_parser.set_defaults(func=explore)
+
 	# Show
 	show_parser = subparsers.add_parser('show',
 			help = "convert criu image from binary to human-readable json")
-- 
1.9.3




More information about the CRIU mailing list