For python developers there exists an easy API to communicate with CRIU. The module sits in lib/py/criu.py file.

OverviewEdit

To use CRIU just create the instance of the criu class.

ConfiguringEdit

Specify the way to call CRIU binary by calling one of criu class methods

criu.use_sk(name)
CRIU is run as service and listens on the socket name
criu.use_fd(fd)
CRIU is already spawn and accepts requests on socket fd
criu.use_binary(path)
CRIU binary is located in path and it will be fork()-ed and execp()-ed

By default the use_binary('criu') mode is activated.

Specifying optionsEdit

Use the criu.opts object to set the RPC options by their regular names

RunningEdit

These calls perform CRIU actions

criu.dump()
Run the dump action
criu.restore()
Run the restore action
criu.check()
Run the check action

See alsoEdit