[CRIU] [PATCH 7/9] cpuinfo: x86 -- Add dump and validation of cpuinfo image

Pavel Emelyanov xemul at parallels.com
Tue Sep 30 03:08:21 PDT 2014


>  #endif /* __CR_CPU_H__ */
> diff --git a/cr-dump.c b/cr-dump.c
> index d00c158d205e..1df1ba06aeab 100644
> --- a/cr-dump.c
> +++ b/cr-dump.c
> @@ -1787,6 +1787,11 @@ int cr_dump_tasks(pid_t pid)
>  	if (write_img_inventory())
>  		goto err;
>  
> +	if (opts.cpu_cap & CPU_CAP_CPUINFO) {

What if the "fpu" mode is requested. Shouldn't we produce
the cpuinfo image?

> +		if (cpu_dump_cpuinfo())
> +			goto err;
> +	}
> +
>  	if (connect_to_page_server())
>  		goto err;
>  
> diff --git a/cr-restore.c b/cr-restore.c
> index a903ab2bd1b5..cd108351ecd7 100644
> --- a/cr-restore.c
> +++ b/cr-restore.c
> @@ -1857,6 +1857,9 @@ int cr_restore_tasks(void)
>  	if (vdso_init())
>  		goto err;
>  
> +	if (cpu_validate_image_cpuinfo())

Add the verb "try" in the name.

> +		goto err;
> +
>  	if (prepare_task_entries() < 0)
>  		goto err;
>  
> diff --git a/include/cpu.h b/include/cpu.h
> index aa3516b97f97..7dbe68f7735c 100644
> --- a/include/cpu.h
> +++ b/include/cpu.h
> @@ -5,5 +5,7 @@
>  
>  extern bool cpu_has_feature(unsigned int feature);
>  extern int cpu_init(void);
> +extern int cpu_dump_cpuinfo(void);
> +extern int cpu_validate_image_cpuinfo(void);
>  
>  #endif /* __CR_CPU_H__ */
> 



More information about the CRIU mailing list