Changes

Jump to navigation Jump to search
94 bytes removed ,  18:42, 30 August 2016
reformat the "Limitations", proper structure, etc.
Line 20: Line 20:     
== Limitations ==
 
== Limitations ==
Named unix sockets with stream/seqpacket options can't be dumped\restored now, see plan below.
     −
== What to do with stream/seqpacket? ==
+
Some types of sockets are hard to deal with.
   −
Such sockets cannot be just dumped and restored as once we dump one end, the other one seen EOF on socket and may close one. The plan for this is to extend the --ext-unix-sk semantics to work like this
+
=== stream/seqpacket ===
   −
* On dump the <code>--ext-unix-sk $id</code> says that socket with $id is OK to be disconnected
+
Named unix sockets with stream/seqpacket options can't be dumped/restored, as once we dump one end,
* On restore the <code>--ext-unix-sk$id[=$path]</code> says that the socket $id should be reconnected back to the path it say on dump (or to the $path).
+
the other one will see EOF on the socket and may close it.
   −
== What to do with socketpair()-s? ==
+
The plan for this is to extend the <code>--ext-unix-sk</code> semantics to work like this:
Unnamed unix sockets created with socketpair() systemcall can be dumped and restored.
  −
For dump socketpair put inode of this socket in <code>--ext-unix-sk</code> option, for example:
     −
<code>
+
* On dump, the <code>--ext-unix-sk $id</code> says that socket with $id is OK to be disconnected
criu dump -D images -o dump.log -v4 --ext-unix-sk=11890815 -t 16528
+
* On restore, the <code>--ext-unix-sk$id[=$path]</code> says that the socket $id should be reconnected back to the path it say on dump (or to the $path).
</code>
     −
For restore socketpair the server should create new pair and call criu restore asking it to [[Inheriting FDs on restore|inherit]] one. Example of command:
+
=== socketpair ===
   −
<code>
+
Unnamed unix sockets created with <code>socketpair()</code> system call can be dumped and restored.
criu restore -d -D images -o restore.log --pidfile restore.pid -v4 -x --inherit-fd fd[3]:socket:[11890815]
  −
</code>
     −
test source code also available for this feature and can be found in criu source tree under test/socketpairs.
+
On dump, put inode of this socket in <code>--ext-unix-sk</code> option, for example:
 +
 
 +
criu dump -D images -o dump.log -v4 --ext-unix-sk=11890815 -t 16528
 +
 
 +
On restore, the server should create a new pair and call <code>criu restore</code> asking it to [[Inheriting FDs on restore|inherit]] one.
 +
For example:
 +
 
 +
criu restore -d -D images -o restore.log --pidfile restore.pid -v4 -x --inherit-fd fd[3]:socket:[11890815]
 +
 
 +
Test is available for this feature, see test/socketpairs in criu sources.
    
== See also ==
 
== See also ==

Navigation menu