Changes

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
+
     # setsid --ctty ipython
 
     In [1]: import os
 
     In [1]: import os
 
     In [2]: st = os.stat("/proc/self/fd/0")
 
     In [2]: st = os.stat("/proc/self/fd/0")
     In [3]: print "tty[%x:%x]" % (st.st_rdev, st.st_dev)
+
     In [3]: print("tty[%x:%x]" % (st.st_rdev, st.st_dev))
     tty:[8800:d]
+
     tty[8802:19]
   
+
    $ps -C sleep
+
     # criu dump -t `pgrep ipython` --external 'tty[8802:19]'
      PID TTY          TIME CMD
+
     # criu restore --inherit-fd 'fd[1]:tty[8802:19]'
    4109 ?        00:00:00 sleep
  −
      
  −
    $ ./criu dump --external 'tty[8800:d]' -D imgs -v4 -t 4109
  −
     $ ./criu restore --inherit-fd 'fd[1]:tty[8800:d]' -D imgs -v4
   
</pre>
 
</pre>
  
278

edits