Difference between revisions of "CRIT"

From CRIU
Jump to navigation Jump to search
(fix examples)
Line 33: Line 33:
 
With "--format raw":
 
With "--format raw":
 
<pre>
 
<pre>
#<magic value>
+
{ "magic" : "FOO", "entries" : [{"foo": "bar", "bar": "foo", "extra": "abc"}, {"foo": "bar", "bar" : "foo", "extra" : "abc"} ]}
#0
 
<pb entry in text_format>
 
....
 
#N
 
<pb entry in text_format>
 
 
</pre>
 
</pre>
  
With "--format nice":
+
With "--format nice"(default for stdout):
 
<pre>
 
<pre>
#<magic name>
+
{
#0 <pb entry name>
+
    "magic" : "FOO",
<pb entry in text_format with tabs>
+
    "entries" : [
....
+
        {
#N <pb entry name>
+
            "foo" : "bar",
<pb entry in text_format with tabs>
+
            "bar" : "foo",
 +
            "extra" : "abc"
 +
        },
 +
        {
 +
            "foo" : "bar",
 +
            "bar" : "foo",
 +
            "extra" : "abc"
 +
        }
 +
    ]
 +
}
 
</pre>
 
</pre>
  

Revision as of 19:16, 14 January 2015

This page describes the CRiu Image Tool.

Usage

usage: crit [-h] [-i IN] [-o OUT] [-f {raw,nice}] {decode,encode}

CRiu Image Tool

positional arguments:
  {decode,encode}       decode/encode - convert criu image from/to binary type
                        to/from json

optional arguments:
  -h, --help            show this help message and exit
  -i IN, --in IN        input file (stdin by default)
  -o OUT, --out OUT     output file (stdout by default)
  -f {raw,nice}, --format {raw,nice}
                        well-formated output (by default: raw for files and
                        nice for stdout)

Functionality

Convert images to JSON and back

This is the replacement for (rather nasty) criu show code. Also this is the way to edit the images before restoring from them.

Status: Ready

It uses text_format as a human-readable format for protobuf messages.

The output file is structured in the following way.

With "--format raw":

{ "magic" : "FOO", "entries" : [{"foo": "bar", "bar": "foo", "extra": "abc"}, {"foo": "bar", "bar" : "foo", "extra" : "abc"} ]}

With "--format nice"(default for stdout):

{
    "magic" : "FOO",
    "entries" : [
        {
            "foo" : "bar",
            "bar" : "foo",
            "extra" : "abc"
        },
        {
            "foo" : "bar",
            "bar" : "foo",
            "extra" : "abc"
        }
    ]
}

Generate core files out of task images

All the needed information is in core-$pid.img and pagemap-$pid.img

Status: Not ready

On-the-fly conversion

There's an idea to make CRIU spawn CRIT and read images "through" it, to allow for at-the-restore-time modifications

Status: Not ready

Convert between different image versions

Right now we store the images version in inventory.img and collect info about what's bad with V1 images. If some day we have v2, CRIT will convert from v1. And for backward compatibility we'll use on-the-fly conversion when restoring from old images.

Status: Not ready

Show images statistics

E.g. -- total number of processes, files, memory, sockets, etc.

Status: Not ready

Check/validate images

Check that

  • all images are present
  • the inter-images IDs are in consistent state

Status: Not ready