Py API

From CRIU
Revision as of 09:26, 21 September 2016 by Xemul (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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

Overview[edit]

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

Configuring[edit]

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[edit]

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

Running[edit]

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[edit]