[CRIU] [PATCH v2 00/19] unix: Add support for bindmounted dgram sockets

Cyrill Gorcunov gorcunov at gmail.com
Fri Sep 14 17:08:23 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:
 - improve code and address various nits (started from patch
   unix: bindmount -- Show details about queuer)

Andrew Vagin (1):
  util: Add cr_set_root/cr_restore_root helpers

Cyrill Gorcunov (18):
  zdtm: Add sstrncpy helper
  unix: Use cr_set_root/cr_restore_root when resolving names
  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
  unix: test -- Add bind-mount-unix test case
  unix: bindmount -- Show details about queuer
  unix: break_connected -- Add a log recod
  unix: make_socket -- Add more detailed logs
  unix: make_socket -- Break connected pair if requested
  unix: bind_unix_sk -- Add ability to skip waiters notification
  unix: unlink_sk -- Don't unlink bindmounted sockets
  unix: unix_prepare_bindmount -- Allow to connect via relative name
  test: bind-mount-unix -- Implement real connect

 criu/cr-dump.c                        |   3 +
 criu/cr-restore.c                     |   5 +-
 criu/include/sockets.h                |   4 +
 criu/include/util.h                   |   3 +
 criu/mount.c                          |   7 +
 criu/sk-unix.c                        | 472 +++++++++++++++++++++-----
 criu/util.c                           |  65 ++++
 images/sk-unix.proto                  |  17 +-
 test/zdtm/lib/zdtmtst.h               |   5 +
 test/zdtm/static/Makefile             |   1 +
 test/zdtm/static/bind-mount-unix.c    | 177 ++++++++++
 test/zdtm/static/bind-mount-unix.desc |   1 +
 12 files changed, 669 insertions(+), 91 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