[CRIU] [RFC][PATCH 0/3] Proposal for native (w/o plugins) support for external bind mounts

Andrew Vagin avagin at parallels.com
Thu Jun 5 02:10:21 PDT 2014


On Tue, Jun 03, 2014 at 08:26:59PM +0400, Pavel Emelyanov wrote:
> Hi,
> 
> I'd like to propose an API to support external mount points w/o plugins.
> It's a typical scenario when people just do a bind mount before going
> into chroot/pivot_root and starting a container. Such a construction is
> not dumpable by CRIU, but I think it's possibly to handle the common and
> typical scenario.
> 
> That said, the proposal is to introduce the --ext-mount option with the
> syntax:
> 
> --ext-mount without arguments on dump says, that mount point with the 
> source sitting outside of the namespace root should be dumped "as is". 
> On restore this will say to try create bind mount with unchanged source
> path. It's useful for suspend/resume scenario and for live-migration
> between hosts with identical FS paths.
> 
> --ext-mount p<path>, e.g. --ext-mount p/foo on restore will cause the
> <path> be prepended to any bind mount source. IOW /bar bind mounted into
> /root will result in /foo/bar get bind mounted into /root on restore
> 
> --ext-mount s<delim><path1><delim><path2>, e.g. --ext-mount s:/foo:/bar
> will case the <path1> prefix get substituted with <path2> prefix for
> every external bind mount on restore. IOW /foo/foobar bind mounted into
> /root will result in /bar/foobar bind mounted to /root on restore.

We can have two pathes with identical prefix (e.g. /dev/pts/7 and
/dev/pts77) and than we can decided to replace /dev/pts/7 on /dev/pts/8
and /dev/pts/77 on /dev/pts/9.

Can this situation be handled by this interface?

> 
> The patchset is not complete, it just demonstrates the intention. Saied,
> it seems to handle your scripted case, the external file gets mounted into
> proper place with plain --ext-mount option, but there's still unresolved
> issue with proc :(
> 
> Comments are welcome.
> 
> TODO
> 
> 1. check that flags (ro, shared) are dumped and restore correctly
> 2. implement p and s modes for --ext-mount option on restore
> 3. support ext-mount option in RPC API
> 4. add option help text and documentation
> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://lists.openvz.org/mailman/listinfo/criu


More information about the CRIU mailing list