Changes

Jump to navigation Jump to search
242 bytes added ,  06:26, 1 November 2016
→‎External TTYs: explain why mnt_id:inode is not used for TTYs
Line 1: Line 1: −
This article describes why and how to use the <code>--inherit-fd</code> command line option.
+
This article describes why and how to use the <code>--external file[...]</code>, <code>--external tty[...]</code> and <code>--inherit-fd</code> command line options.
    
== Background ==
 
== Background ==
Line 127: Line 127:     
=== External files, FIFOs ===
 
=== External files, FIFOs ===
"criu dump" tries to resolve paths for each files, so the first example works only for files which can be resolved from dumped mount namespaces. If we have a file from another namespace, we call it as "external" and criu isn't able to restore it without external help. We need to enumerate all external files on dump and set inherit file descriptors on restore. This descriptors will be used only to open a file via <code>/proc/self/fd</code>, so it doesn't metter with which flags an inherited descriptor has been opened. The format of file id is <code>file[mnt_id:inode]</code>.
+
"criu dump" tries to resolve paths for each files, so the first example works only for files which can be resolved from dumped mount namespaces. If we have a file from another namespace, we call it as "external" and criu isn't able to restore it without external help. We need to enumerate all external files on dump and set inherit file descriptors on restore. This descriptors will be used only to open a file via <code>/proc/self/fd</code>, so it doesn't matter with which flags an inherited descriptor has been opened. The format of file id is <code>file[''mnt_id'':''inode'']</code>.
    
<pre>
 
<pre>
Line 136: Line 136:  
=== External TTYs ===
 
=== External TTYs ===
   −
The format of tty id is <code>tty[rdev:dev]</code>. Why can we not use a pair of <code>mnt_id</code> and <code>inode</code> here?
+
The format of tty id is <code>tty[''rdev'':''dev'']</code>. Note that a pair of <code>''mnt_id'':''inode''</code> is not used here, as there can be two device files with the same <code>''rdev''</code> but different inode numbers.
    +
Here is an example of dumping and restoring an external TTY:
 
<pre>
 
<pre>
 
     $ ipython
 
     $ ipython

Navigation menu