Changes

Jump to navigation Jump to search
76 bytes added ,  14:26, 1 December 2014
Line 6: Line 6:  
=== Request ===
 
=== Request ===
 
==== criu_req ====
 
==== criu_req ====
 +
This is the header of the request. It defines the operation requested and options.
 +
 
<pre>
 
<pre>
 
message criu_req {
 
message criu_req {
 
required criu_req_type type = 1;
 
required criu_req_type type = 1;
   
optional criu_opts opts = 2;
 
optional criu_opts opts = 2;
 
}
 
}
Line 16: Line 17:  
==== criu_req_type ====
 
==== criu_req_type ====
 
There are 8 request/response types for now. Comments show cmdline analogs.
 
There are 8 request/response types for now. Comments show cmdline analogs.
 +
 
<pre>enum criu_req_type {
 
<pre>enum criu_req_type {
 
EMPTY = 0;
 
EMPTY = 0;
Line 23: Line 25:  
PRE_DUMP = 4; /* criu pre-dump */
 
PRE_DUMP = 4; /* criu pre-dump */
 
PAGE_SERVER = 5; /* criu page-server */
 
PAGE_SERVER = 5; /* criu page-server */
  −
NOTIFY = 6;
  −
   
CPUINFO_DUMP = 7; /* criu cpuinfo dump */
 
CPUINFO_DUMP = 7; /* criu cpuinfo dump */
 
CPUINFO_CHECK = 8; /* criu cpuinfo check */
 
CPUINFO_CHECK = 8; /* criu cpuinfo check */
Line 33: Line 32:  
==== criu_opts ====
 
==== criu_opts ====
 
It is used to store options.
 
It is used to store options.
 +
 
<pre>message criu_opts {
 
<pre>message criu_opts {
 
required int32 images_dir_fd = 1;
 
required int32 images_dir_fd = 1;
Line 68: Line 68:     
optional bool rst_sibling = 26; /* swrk only */
 
optional bool rst_sibling = 26; /* swrk only */
}</pre>
+
}
 +
</pre>
   −
If no pid is set and type is DUMP, CRIU will dump client process by default.
+
Comments to options.
Note: Whole tree <pid> must have the same uid, as a client, or client's uid must be == 0, otherwise CRIU won't dump nothing at all.
     −
Only images_dir_fd is required, all other fields may not be set.
+
* If no pid is set and type is DUMP, CRIU will dump client process by default.
Client must open directory for/with images by himself and set images_dir_fd to it's fd.
+
* All processes in the subtree starting with <pid> must have the same uid, as a client, or client's uid must be root (uid == 0), otherwise CRIU will return error.
CRIU will open /proc/<client's_pid>/fd/<images_dir_fd>, so it will work, if client is in another namespace.
+
* Only the images_dir_fd is required, all other fields are optional. Client must open directory for/with images by himself and set images_dir_fd to it's fd. CRIU will open /proc/<client's_pid>/fd/<images_dir_fd>.
    
The logic of setting request is the same as when setting options in console. Here is an example:
 
The logic of setting request is the same as when setting options in console. Here is an example:

Navigation menu