[CRIU] [PATCH 14/32] tools: cpt2 -- Start reading dumpfile

Pavel Emelyanov xemul at parallels.com
Mon Apr 1 06:05:10 EDT 2013


On 03/31/2013 01:42 AM, Cyrill Gorcunov wrote:
> 
> This commit introduces dumpfile reading routines.
> The main one is read_dumpfile() which is supposed
> to call all readers from other subsystems.
> 
> Once read complete (and conversion is done, which is
> addressed in further patches) the read_fini() should
> be called to free all resource allocated.
> 
> At moment we only read dumpfile headers and parse
> sections, nothing else.
> 
> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> ---
>  tools/cpt2/src/Makefile       |   1 +
>  tools/cpt2/src/include/read.h |  13 +++
>  tools/cpt2/src/read.c         | 260 ++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 274 insertions(+)
>  create mode 100644 tools/cpt2/src/include/read.h
>  create mode 100644 tools/cpt2/src/read.c
> 


> +	version = CPT_VERSION_MAJOR(ctx->h.cpt_image_version);
> +	if ((version == CPT_VERSION_18 &&
> +	    (ctx->h.cpt_image_version < CPT_VERSION_18_3)) ||
> +	    (version == CPT_VERSION_32 &&
> +	     (CPT_VERSION_MINOR(ctx->h.cpt_image_version) >
> +	      CPT_VERSION_MINOR(CPT_CURRENT_VERSION)))) {
> +		pr_err("Unsupported image version %d:%d\n",
> +		       CPT_VERSION_MAJOR(ctx->h.cpt_image_version),
> +		       CPT_VERSION_MINOR(ctx->h.cpt_image_version));
> +		return -1;
> +	}

You copied it from the kernel? Have you _really_ checked, that you could
convert every single image, that matched this if?


More information about the CRIU mailing list