Changes

Jump to navigation Jump to search
1,436 bytes added ,  07:17, 26 December 2013
+ external bind mounts
Line 49: Line 49:  
The dump callback gets a file descriptor, which must be dumped.
 
The dump callback gets a file descriptor, which must be dumped.
 
The restore callback returns a restored file.
 
The restore callback returns a restored file.
 +
 +
=== External bind mounts ===
 +
 +
These are mount points with target sitting out of the namespace's visible FS tree. E.g. this is how LXC people configure the console and ttys for a container. In order to dump and restore those plugin can define calls:
 +
 +
int cr_plugin_dump_ext_mount(char *mountpoint, int id)
 +
 +
The <code>mountpoint</code> is the path where the mount is.
 +
 +
The <code>id</code> is an identifier of a mountpoint as seen in <code>/proc/self/mountinfo</code> and that will at restore time be passed to identify the mount to restore (at that time it will no longer match the proc info!).
 +
 +
int cr_plugin_restore_ext_mount(int id, char *mountpoint, char *old_root, int *is_file)
 +
 +
The <code>id</code> is the mountpoint id.
 +
 +
The <code>mountpoint</code> is where the mount should be attached to. Note, that this path may ''not'' coincide with the one at dump stage! CRIU may ask to mount it as some different location and will move it to proper place eventually.
 +
 +
The <code>old_root</code> argument is the path to a tree where files visible from the original namespace are. Plugins should get files they want to bind-mount inside the new namespace starting from that path.
 +
 +
The <code>is_file</code> if not NULL points to the boolean variable saying whether the mountpoint is file or directory. Since in Linux one can bind mount files or directories, CRIU need to know whether the new mount point, created by plugin, is one of those.
    
=== Examples ===
 
=== Examples ===

Navigation menu