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

Cyrill Gorcunov gorcunov at gmail.com
Tue Sep 30 11:08:35 PDT 2014


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, or reverse success = true and
ret = -1, 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