mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-17 16:47:50 +00:00
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>
This commit is contained in:
parent
e3f900f954
commit
d2f8f481c7
2 changed files with 56 additions and 12 deletions
11
crit
11
crit
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue