Changes

880 bytes added ,  14:43, 1 December 2014
no edit summary
Line 2: Line 2:     
The criu_req/criu_resp are two main messages for requests/responses. They are to be used for transferring messages and needed to provide compatibility with an older versions of rpc. Field type in them ''must'' be set accordingly to type of request/response that is stored. Types of request/response are defined in enum criu_req_type. See the [[API compliance]] page for information what each option might mean.
 
The criu_req/criu_resp are two main messages for requests/responses. They are to be used for transferring messages and needed to provide compatibility with an older versions of rpc. Field type in them ''must'' be set accordingly to type of request/response that is stored. Types of request/response are defined in enum criu_req_type. See the [[API compliance]] page for information what each option might mean.
 +
 +
== Protocol ==
 +
 +
The protocol is simple -- client connect to service, send a ''criu_req'' message to server, server responds back with ''criu_resp'' and closes the socket. There are three exceptions from this rule, see below.
    
== Request ==
 
== Request ==
Line 12: Line 16:  
optional criu_opts opts = 2;
 
optional criu_opts opts = 2;
 
optional notify_success        = 3; /* see Notifications below */
 
optional notify_success        = 3; /* see Notifications below */
optional keep_open              = 4; /* see Multi-req below */
+
optional keep_open              = 4; /* for multi-req, below */
 
}
 
}
 
</pre>
 
</pre>
Line 171: Line 175:  
</pre>
 
</pre>
   −
After handling the notification the client must responce with the request again with the type set to NOTIFY and the ''notify_success'' set to the successfulness of the notification.
+
After handling the notification the client must response with the request again with the type set to NOTIFY and the ''notify_success'' set to the successfulness of the notification. In case of successful notification acknowledge the server doesn't close the socket and continues to work.
 +
 
 +
== Pre-dumps ==
 +
 
 +
Before issuing a DUMP request client may send one or more PRE_DUMP requests. Once the PRE_DUMP is sent and response is received, client may send one more PRE_DUMP or DUMP request. The server would only close the socket after the DUMP one.
 +
 
 +
== Multi-request mode ==
 +
 
 +
If the ''req.keep_open'' flag is set to true server will not close the socket after response, but will wait for more requests. This mode is supported only for the following request types:
 +
 
 +
* PRE_DUMP (automatically)
 +
* PAGE_SERVER
 +
* CPUINFO_DUMP and CPUINFO_CHECK
    
== Run ==
 
== Run ==