diff options
author | Pavel Emelyanov <xemul@virtuozzo.com> | 2017-07-13 14:24:29 +0300 |
---|---|---|
committer | Pavel Emelyanov <xemul@virtuozzo.com> | 2017-10-17 11:41:51 +0300 |
commit | 5087faa0b852ab19f7f4dcc0a03afadce12b8a0c (patch) | |
tree | 53ecea74d17fa65301030fe43a18a4610f46f5e3 /images/sk-packet.proto | |
parent | e52341f5a300ef1557c7e22087aaa28e7219f287 (diff) |
SCM: Dump and restore SCM_RIGHTs
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: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Diffstat (limited to 'images/sk-packet.proto')
-rw-r--r-- | images/sk-packet.proto | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/images/sk-packet.proto b/images/sk-packet.proto index 5f61c7376..dcda280f6 100644 --- a/images/sk-packet.proto +++ b/images/sk-packet.proto @@ -1,6 +1,12 @@ syntax = "proto2"; +message scm_entry { + required uint32 type = 1; + repeated uint32 rights = 2; +} + message sk_packet_entry { required uint32 id_for = 1; required uint32 length = 2; + repeated scm_entry scm = 4; } |