• Pavel Emelyanov's avatar
    SCM: Dump and restore SCM_RIGHTs · 5087faa0
    Pavel Emelyanov authored
    Most of the pieces has already been described in the previous patches :)
    so here's the summary.
    
    * Dump:
    
    When receiving a message, also receive any SCM-s (already there) and when
    SCM_RIGHTs one is met -- go ahead and just dump received descriptors using
    regular code, but taking current as the victim task.
    
    Few words about file paths resolution -- since we do dump path-ed files
    by receiving them from victim's parasite, such files sent via sockets
    should still work OK, as we still receive them, just from another socket.
    
    Several problems here:
    
    1. Unix sockets sent via unix sockets form knots. Not supported.
    2. Eventpolls sent via unix might themseves poll unix sockets. Knots
       again. Not supported either.
    
    * Restore:
    
    On restore we need to make unix socket wait for the soon-to-be-scm-sent
    descriptors to get restored, so we need to find them, then put a dependency.
    After that, the fake fdinfo entry is attached to the respective file
    descs, when sent the respective descriptors are closed.
    
    https://github.com/xemul/criu/issues/251
    
    v2: Addressed comments from Kirill
    
    * Moved prepare_scms before adding fake fles (with comment)
    * Add scm-only fles as fake, thus removing close_scm_fds
    * Try hard finding any suitable fle to use as scm one when
      queuing them for unix socket scm list, only allocate a new
      one if really needed
    Reviewed-by: 's avatarKirill Tkhai <ktkhai@virtuozzo.com>
    Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
    Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
    5087faa0
Name
Last commit
Last update
Documentation Loading commit data...
compel Loading commit data...
contrib Loading commit data...
coredump Loading commit data...
crit Loading commit data...
criu Loading commit data...
images Loading commit data...
include/common Loading commit data...
lib Loading commit data...
scripts Loading commit data...
soccr Loading commit data...
test Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
.travis.yml Loading commit data...
COPYING Loading commit data...
CREDITS Loading commit data...
INSTALL.md Loading commit data...
Makefile Loading commit data...
Makefile.compel Loading commit data...
Makefile.config Loading commit data...
Makefile.install Loading commit data...
Makefile.versions Loading commit data...
README.md Loading commit data...