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

Cyrill Gorcunov gorcunov at openvz.org
Tue Aug 21 16:27:14 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 first then
   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

 - standalone slaves are to be chained in stack if they
   have same master index, at moment if such situation
   happens we will fail on restore

 - need to figure out the best way for tty group restore,
   at moment it's not yet addressed

 - 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 ]

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 Makefile              |    1 +
 cr-dump.c             |   13 +-
 cr-restore.c          |   16 +-
 cr-show.c             |    6 +
 files.c               |   94 ++++++-
 image.c               |    1 +
 include/crtools.h     |    4 +
 include/files.h       |    2 +-
 include/image.h       |    1 +
 include/protobuf.h    |    1 +
 include/pstree.h      |    1 +
 include/tty.h         |   27 ++
 protobuf.c            |    2 +
 protobuf/Makefile     |    1 +
 protobuf/fdinfo.proto |    3 +-
 protobuf/tty.proto    |   37 +++
 tty.c                 |  773 +++++++++++++++++++++++++++++++++++++++++++++++++
 17 files changed, 965 insertions(+), 18 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: 0004-tty-Add-checkpoint-restore-for-unix-terminals.patch
Type: text/x-patch
Size: 31452 bytes
Desc: not available
Url : http://openvz.org/pipermail/criu/attachments/20120822/650debd7/0004-tty-Add-checkpoint-restore-for-unix-terminals-0001.bin


More information about the CRIU mailing list