[CRIU] [PATCH 15/32] tools: cpt2 -- Read files, fds, inodes, fs related info

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


In this patch we put the ground for reading files,
opened file descriptors, inodes and fs related info
(current working directory and root).

The relation between structures is the following

 - fs_struct keeps info about root and cwd directory
   which is associated with a task

 - files_struct keeps a list of opened file descriptors
   which is associated with a task as well

 - fd_struct represents opened file descriptor itself
   and it's associated with files_struct

 - file_struct represents data associated with a file,
   among other things we have @dumped entry here thus
   once file is converted and written to criu image
   file the @dumped set to true and we never write it
   again (in criu this work is indirectly done for us
   by kcmp call -- we never generate "new" files if one
   has been seen already)

There is no "write to criu image" action yet, just reading
for simplicity.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 tools/cpt2/src/Makefile        |   1 +
 tools/cpt2/src/files.c         | 314 +++++++++++++++++++++++++++++++++++++++++
 tools/cpt2/src/include/files.h |  50 +++++++
 3 files changed, 365 insertions(+)
 create mode 100644 tools/cpt2/src/files.c
 create mode 100644 tools/cpt2/src/include/files.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0015-tools-cpt2-Read-files-fds-inodes-fs-related-info.patch
Type: text/x-patch
Size: 9073 bytes
Desc: not available
URL: <http://lists.openvz.org/pipermail/criu/attachments/20130331/c92636e7/attachment-0001.bin>


More information about the CRIU mailing list