Py API

From CRIU
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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

Overview

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

Configuring

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 options

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

Running

These calls perform CRIU actions

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

See also