[CRIU] [PATCH v2 0/9] unix: Add support for bindmounted dgram sockets

Cyrill Gorcunov gorcunov at gmail.com
Tue Aug 28 16:21:15 MSK 2018


Sometime digram sockets are bindmounted to other locations, for
example we had containers where /dev/log is mounted into another
places.

To support it we do the following:

 - on checkpoint we examitate bindmounts if there is a unix
   socket behind it, and if so we mark it with flag in images;

 - on restore we use fdstore to keep "pre-opened" sockets since
   generation of mount tree is happened earlier than file restoration,
   later when we need to open such file we simply fetch it from the
   fdstore.

v2:
 - rebase on fresh criu-dev branch
 - reserve mnt_id = 17 for vz7 images

Cyrill Gorcunov (9):
  unix: image -- Shift mnt_id index
  unix: image -- Move uflags into enum
  unix: Collect bindmounted unix sockets
  unix: Collect images before opening mountpoints
  unix: Collect bindmounted unix sockets into own list
  unix: Move shared data init into early stage
  unix: Add support for bindmounted sockets
  zdtm: Add sstrncpy helper
  unix: test -- Add bind-mount-unix test case

 criu/cr-dump.c                        |   3 +
 criu/cr-restore.c                     |   5 +-
 criu/include/sockets.h                |   4 +
 criu/mount.c                          |   7 +
 criu/sk-unix.c                        | 412 +++++++++++++++++++++-----
 images/sk-unix.proto                  |  17 +-
 test/zdtm/lib/zdtmtst.h               |   5 +
 test/zdtm/static/Makefile             |   1 +
 test/zdtm/static/bind-mount-unix.c    | 139 +++++++++
 test/zdtm/static/bind-mount-unix.desc |   1 +
 10 files changed, 511 insertions(+), 83 deletions(-)
 create mode 100644 test/zdtm/static/bind-mount-unix.c
 create mode 100644 test/zdtm/static/bind-mount-unix.desc

-- 
2.17.1



More information about the CRIU mailing list