[CRIU] [PATCH 6/6] tty: Add checkpoint/restore for unix terminals

Cyrill Gorcunov gorcunov at openvz.org
Sun Aug 26 12:35:42 EDT 2012


The main idea of TTY restore (the dumping is straight forward
and has nothing special) is the following

 - because master peers must be opened before slave peers
   we add new tty list into rst_info structure. This list
   will carry tty information related to file descriptors
   and a task will try to open master peers before slave
   peers

 - because SID should be restored in a task context which
   SID mathes peer's we introduce CTL_TTY special.

Anything else is straighforward -- master get opened via
/dev/ptmx interface, while slaves are via /dev/pts/N.

Known problems

 - need to figure out how to deal with ttys which have some
   data in buffers not yet flushed

 - when open ptmx with specified index we better need a patch
   for kernel which would allow us to open pty with index in
   one pass

[ avagin@:
   - contol terminals restoration code complete rework
   - overall code redesign and simplification
]

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 Makefile              |    1 +
 cr-dump.c             |   23 ++-
 cr-restore.c          |   16 +-
 cr-show.c             |    6 +
 files.c               |   93 ++++++-
 image.c               |    1 +
 include/crtools.h     |    4 +
 include/files.h       |    3 +-
 include/image.h       |    1 +
 include/parasite.h    |    1 +
 include/proc_parse.h  |    1 +
 include/protobuf.h    |    1 +
 include/pstree.h      |    1 +
 include/ptrace.h      |    2 +-
 include/tty.h         |   23 ++
 proc_parse.c          |    2 +-
 protobuf.c            |    2 +
 protobuf/Makefile     |    1 +
 protobuf/fdinfo.proto |    3 +-
 protobuf/tty.proto    |   37 +++
 ptrace.c              |    4 +-
 tty.c                 |  710 +++++++++++++++++++++++++++++++++++++++++++++++++
 22 files changed, 913 insertions(+), 23 deletions(-)
 create mode 100644 include/tty.h
 create mode 100644 protobuf/tty.proto
 create mode 100644 tty.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0006-tty-Add-checkpoint-restore-for-unix-terminals.patch
Type: text/x-patch
Size: 32374 bytes
Desc: not available
Url : http://openvz.org/pipermail/criu/attachments/20120826/387c0a25/0006-tty-Add-checkpoint-restore-for-unix-terminals-0001.bin


More information about the CRIU mailing list