[CRIU] [PATCH 13/14] pstree: Migrate SIDs/PGIDs if requested

Cyrill Gorcunov gorcunov at openvz.org
Sat Oct 6 02:58:42 EDT 2012


In case if user asked us to migrate session we need to
walk over all process entries and update SIDs and PGIDs
where needed.

This should be done before we restore the order of process
entities creation.

An example of usage if migrating a task

| # ps
| pid sid comm
|  2   2 bash
|  3   2  `- my_app
|  4   4 bash
|  5   4  `- ps
|
| # crtools dump -t 3 --ext-tty
| # crtools restore -t 3 --ext-tty
| # ps
| pid sid comm
|  4   4 bash
|  5   4  `- crtools
|  3   4      `- my_app

Also this patches takes into account --ext-tty option,
the real hanlding of tty entries is addressed in next
patch for simplicity.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 cr-restore.c     |    2 +-
 include/pstree.h |   10 ++++++-
 pstree.c         |   82 +++++++++++++++++++++++++++++++++++++++++++++++++++++-
 3 files changed, 91 insertions(+), 3 deletions(-)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0013-pstree-Migrate-SIDs-PGIDs-if-requested.patch
Type: text/x-patch
Size: 4250 bytes
Desc: not available
Url : http://openvz.org/pipermail/criu/attachments/20121006/e6359fad/0013-pstree-Migrate-SIDs-PGIDs-if-requested.bin


More information about the CRIU mailing list