[CRIU] [PATCH] [PATCH 3/4] service: add multireq support

Ruslan Kuprieiev kupruser at gmail.com
Wed Feb 12 04:00:09 PST 2014


On 12.02.2014 15:38, Pavel Emelyanov wrote:
> On 02/12/2014 03:15 PM, Ruslan Kuprieiev wrote:
>> On 12.02.2014 15:00, Pavel Emelyanov wrote:
>>> On 02/02/2014 02:55 PM, Ruslan Kuprieiev wrote:
>>>> Signed-off-by: Ruslan Kuprieiev <kupruser at gmail.com>
>>>> +static int cr_service_work(int sk)
>>>> +{
>>>> +	CriuReq *msg = 0;
>>>> +
>>>> +	if (recv_criu_msg(sk, &msg))
>>>> +		return -1;
>>>> +
>>>> +	if (msg->type == CRIU_REQ_TYPE__MULTIREQ)
>>>> +		return multireq_mode(sk, msg);
>>> By multireq I meant different thing. Not separate request type,
>>> but a flag in the generic request message meaning "don't close
>>> socket after this request, I will send more".
>> Hm, do you mean if i need to send 10 requests, everyone except the last,
>> must have that flag?
> Yes.
>
>> By introducing MULTIREQ type of request, I want criu to open
>> session(with it's own log.)
>> for me, process all my requests and shut session when it will receive
>> second MULTIREQ request.
>> So, basically,  MULTIREQ request is a switcher to start/stop multireq
>> session.
>>
>> So, it will be like that:
>> 1) ask criu to start multireq session with session log.
>> 2) send all request that I need to.
>> 3) ask criu to stop multireq session.
> I'm afraid that such API would imply some state kept during the session,
> but we don't have such.

I don't get it. What state do you mean?

>
> But the issue with the same log for several requests looks nice to me.
> Can you try implementing the idea with "i want to continue" flag that
> allows one log for all requests?

Yes. I could add option for log_init() to append to logfile,
not truncate it. And then I could just add log_append flag to opts.
So, if one want to write to the log from previous request, it will
pass it's path and set log_append=true. But it has nothing to do
with multireq.

>>>> +	else
>>>> +		return subworker(sk, msg);
>>>> +}
>>>> +
>>>>    int cr_service(bool daemon_mode)
>>>>    {
>>>>    	int server_fd = -1, n;
>>>>
>> .
>>
>



More information about the CRIU mailing list