[CRIU] [PATCH 11/32] tools: cpt2 -- Introduce program context and image helpers

Cyrill Gorcunov gorcunov at openvz.org
Sat Mar 30 17:42:49 EDT 2013


Program context, represented by context_t type, stands to
carry critical parameters needed for sharing between code
modules. These are dumpfile and output directory descriptors,
dumpfile statistics, headers, dumpfile sections offsets
and file set for global criu files.

Because context uses global criu file set, we introduce criu
image helpers, which describe criu file templates and helpers
to work with them.

Image helpers and templates are taken from crtools code and
adopted for cpt2 needs, still it might be worth to split
crtools' image helpers in somewhat more abstract code which
would allow to re-use it in cpt2. For a while there is some
code duplication.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 tools/cpt2/src/Makefile          |   2 +
 tools/cpt2/src/context.c         |  54 +++++++++++++++
 tools/cpt2/src/image.c           | 143 +++++++++++++++++++++++++++++++++++++++
 tools/cpt2/src/include/context.h |  37 ++++++++++
 tools/cpt2/src/include/image.h   | 108 +++++++++++++++++++++++++++++
 5 files changed, 344 insertions(+)
 create mode 100644 tools/cpt2/src/context.c
 create mode 100644 tools/cpt2/src/image.c
 create mode 100644 tools/cpt2/src/include/context.h
 create mode 100644 tools/cpt2/src/include/image.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0011-tools-cpt2-Introduce-program-context-and-image-helpe.patch
Type: text/x-patch
Size: 8411 bytes
Desc: not available
URL: <http://lists.openvz.org/pipermail/criu/attachments/20130331/f4d8409d/attachment-0001.bin>


More information about the CRIU mailing list