[CRIU] [PATCH 12/12] cpuinfo: rpc -- Add CPUINFO_DUMP/CPUINFO_CHECK commands

Pavel Emelyanov xemul at parallels.com
Tue Sep 30 11:11:39 PDT 2014


On 09/30/2014 10:08 PM, Cyrill Gorcunov wrote:
> On Tue, Sep 30, 2014 at 09:57:45PM +0400, Pavel Emelyanov wrote:
>>> +	wait(&status);
>>> +	if (!WIFEXITED(status) || WEXITSTATUS(status))
>>> +		goto out;
>>> +
>>> +	success = true;
>>> +out:
>>> +	resp.type = msg->type;
>>> +	resp.success = success;
>>> +
>>> +	ret = send_criu_msg(sk, &resp);
>>> +
>>> +	if (success == false || ret || !msg->keep_open) {
>>> +		criu_req__free_unpacked(msg, NULL);
>>> +		msg->keep_open = false;
>>> +		ret = -1;
>>
>> Why do we need this? If ret is not 0, then the ct_service_work
>> will just go ahead and terminate.
> 
> ret might be 0 but success = false,

In this case cr_service_work() would free the req and go on the
2nd lap.

> or reverse success = true and ret = -1,

How???

> but the caller cycle frees msg with only one condition
> 
> cr_service_work
> 	...
> 	if (!ret && msg->keep_open) {
> 		criu_req__free_unpacked(msg, NULL);
> 		ret = -1;
> 		goto more;
> 	}
> 
> that said cr_service_work release resources iif ret = 0 and keep_open passed
> so I need to account both: @success and @ret from send_criu_msg, or I miss
> something and there is some simplier condition might be used?
> .
> 



More information about the CRIU mailing list