[CRIU] [PATCH 10/12] cpuinfo: x86 -- Add dump and validation of cpuinfo image, v2

Pavel Emelyanov xemul at parallels.com
Wed Oct 1 05:57:40 PDT 2014


On 10/01/2014 01:07 AM, Cyrill Gorcunov wrote:
> On Tue, Sep 30, 2014 at 09:18:53PM +0400, Cyrill Gorcunov wrote:
>> If a user requested criu to dump cpuinfo image then we
>> write one on dump and verify on restore. At the moment
>> we require all cpu feature bits to match the destination
>> cpu in a sake of simplicity, but in future we need deps
>> engine which would filer out bits and test if cpu we're
>> restoring on is more capable than one we were dumping at
>> allowing to proceed restore procedure.
>>
>> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> 
> Updated to new img format
> 
> diff --git a/cr-dump.c b/cr-dump.c
> index 04c18fa019d2..6402db129582 100644
> --- a/cr-dump.c
> +++ b/cr-dump.c
> @@ -1775,6 +1775,11 @@ int cr_dump_tasks(pid_t pid)
>  	if (write_img_inventory())
>  		goto err;
>  
> +	if (opts.cpu_cap & CPU_CAP_CPU) {
> +		if (cpu_dump_cpuinfo())
> +			goto err;
> +	}
> +
>  	if (connect_to_page_server())
>  		goto err;
>  
> diff --git a/cr-restore.c b/cr-restore.c
> index 4c9308c38335..bd1ec2dfaade 100644
> --- a/cr-restore.c
> +++ b/cr-restore.c
> @@ -1863,6 +1863,9 @@ int cr_restore_tasks(void)
>  	if (vdso_init())
>  		goto err;
>  
> +	if (cpu_validate_cpuinfo())
> +		goto err;
> +


Can this be symmetrical -- either opts check outside
or inside for both?


More information about the CRIU mailing list