Line 1: |
Line 1: |
| + | For python developers there exists an easy API to communicate with CRIU. The module sits in <code>lib/py/criu.py</code> file. |
| + | |
| + | == Overview == |
| + | |
| + | To use CRIU just create the instance of the <code>criu</code> class. |
| + | |
| + | === Configuring === |
| + | |
| + | Specify the way to call CRIU binary by calling one of criu class methods |
| + | |
| + | ; <code>criu.use_sk(name)</code> |
| + | : CRIU is run as [[RPC#Server|service]] and listens on the socket <code>name</code> |
| + | |
| + | ; <code>criu.use_fd(fd)</code> |
| + | : CRIU is already [[RPC#SWRK mode|spawn]] and accepts requests on socket <code>fd</code> |
| + | |
| + | ; <code>criu.use_binary(path)</code> |
| + | : CRIU binary is located in <code>path</code> and it will be fork()-ed and execp()-ed |
| + | |
| + | By default the <code>use_binary('criu')</code> mode is activated. |
| + | |
| + | === Specifying options === |
| + | |
| + | Use the <code>criu.opts</code> object to set the [[RPC]] options by their [[RPC#Request|regular names]] |
| + | |
| + | === Running === |
| + | |
| + | These calls perform CRIU actions |
| + | |
| + | ; <code>criu.dump()</code> |
| + | : Run the [[CLI/cmd/dump|dump action]] |
| + | |
| + | ; <code>criu.restore()</code> |
| + | : Run the [[CLI/cmd/restore|restore action]] |
| + | |
| + | ; <code>criu.check()</code> |
| + | : Run the [[CLI/cmd/check|check action]] |
| + | |
| == See also == | | == See also == |
| | | |
Line 6: |
Line 44: |
| | | |
| [[Category:API]] | | [[Category:API]] |
− | [[Category:Empty articles]]
| |