[CRIU] [PATCH 8/9] files: Add c/r for /proc/$pid/ns/$ids references

Cyrill Gorcunov gorcunov at openvz.org
Fri May 17 09:20:13 EDT 2013


In this commit we implement c/r for files which have opened
/proc/$pid/ns/$ids entries.

The idea is rather simple one

Checkpoint
==========

- Check if the file name is the one of known to be ns ref
- If match then use generate_ns_id helper to generate namespace
  ids (note if the ids came from nested namespace we issue error
  out because it's not yet supported by criu)
- Write protobuf entry

Restore
=======

- Read all ns entries from the image
- When criu tries to open one we lookup over process
  tree to figure out which PID should be used in path
  and then just open it.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 cr-restore.c         |   3 ++
 files.c              |   5 +--
 include/files.h      |   2 +
 include/namespaces.h |   3 ++
 namespaces.c         | 121 +++++++++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 131 insertions(+), 3 deletions(-)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0008-files-Add-c-r-for-proc-pid-ns-ids-references.patch
Type: text/x-patch
Size: 5173 bytes
Desc: not available
URL: <http://lists.openvz.org/pipermail/criu/attachments/20130517/c46836f0/attachment.bin>


More information about the CRIU mailing list