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

Cyrill Gorcunov gorcunov at openvz.org
Mon May 13 11:39:02 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         | 136 +++++++++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 146 insertions(+), 3 deletions(-)

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


More information about the CRIU mailing list