diff options
author | Pavel Emelyanov <xemul@parallels.com> | 2015-09-16 16:16:24 +0300 |
---|---|---|
committer | Pavel Emelyanov <xemul@parallels.com> | 2015-09-21 11:51:39 +0300 |
commit | d2f8f481c73d513cc31574d0662a734ab4999830 (patch) | |
tree | 56b481a90a0f411d0e2c7648da4e77c766cf9770 /crit | |
parent | e3f900f95429bc0447d8e3cff3cbb2e0a19f8d23 (diff) |
crit: Introduce 'info' action
This should print some information about image file itself, e.g.
statistical information. Right now print magic and the number of
object written in the file.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Diffstat (limited to 'crit')
-rwxr-xr-x | crit | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -41,6 +41,11 @@ def encode(opts): img = json.load(inf(opts)) pycriu.images.dump(img, outf(opts)) +def info(opts): + infs = pycriu.images.info(inf(opts)) + json.dump(infs, sys.stdout, indent = 4) + print + def main(): desc = 'CRiu Image Tool' parser = argparse.ArgumentParser(description=desc, @@ -73,6 +78,12 @@ def main(): help = 'where to put criu image in binary format (stdout by default)') encode_parser.set_defaults(func=encode) + # Info + info_parser = subparsers.add_parser('info', + help = 'show info about image') + info_parser.add_argument("in") + info_parser.set_defaults(func=info) + # Show show_parser = subparsers.add_parser('show', help = "convert criu image from binary to human-readable json") |