[CRIU] [PATCH] cr-service: set cr_errno if cpuinfo dump is not supported

Pavel Emelyanov xemul at parallels.com
Thu Nov 5 04:38:13 PST 2015


On 11/03/2015 06:21 PM, Adrian Reber wrote:
> From: Adrian Reber <areber at redhat.com>
> 
> Right now only x86 supports dumping and checking the cpuinfo. All other
> architectures are returning -ENOTSUP and thus p.haul fails if started
> without '--force'. This adds -ENOTSUP to the RPC field cr_errno in the
> case cpuinfo dumping and checking failed with this return code.
> 
> Signed-off-by: Adrian Reber <areber at redhat.com>

Applied, thanks. Just one question, inline.

> ---
>  cr-service.c | 14 ++++++++++++--
>  1 file changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/cr-service.c b/cr-service.c
> index 7fe0e48..599aab7 100644
> --- a/cr-service.c
> +++ b/cr-service.c
> @@ -837,10 +837,20 @@ cout:
>  	}
>  
>  	wait(&status);
> -	if (!WIFEXITED(status) || WEXITSTATUS(status))
> +	if (!WIFEXITED(status))
>  		goto out;
> +	switch (WEXITSTATUS(status)) {
> +	case (-ENOTSUP & 0xff):
> +		resp.has_cr_errno = 1;
> +		resp.cr_errno = WEXITSTATUS(status);

What would we see in cr_errno on the response receiver side? Would it
be -ENOTSUP, ENOTSUP or smth else?

> +		break;
> +	case 0:
> +		success = true;
> +		break;
> +	default:
> +		break;
> +	}
>  
> -	success = true;
>  out:
>  	resp.type = msg->type;
>  	resp.success = success;
> 



More information about the CRIU mailing list