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

Pavel Emelyanov xemul at parallels.com
Tue Jun 3 09:26:59 PDT 2014


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.

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


More information about the CRIU mailing list