]> git.proxmox.com Git - mirror_lxc.git/commit - src/lxc/criu.c
c/r: explicitly emit bind mounts as criu arguments
authorTycho Andersen <tycho.andersen@canonical.com>
Mon, 31 Oct 2016 16:07:25 +0000 (10:07 -0600)
committerTycho Andersen <tycho.andersen@canonical.com>
Mon, 31 Oct 2016 20:45:50 +0000 (20:45 +0000)
commit5f4e44a22df60c25005c95b9326fd989efd80569
tree51338481ca4126d55ea881d463ce4c37ea2b5d75
parentdfef27a5a1d80a2d3e7483390728c060e304d14f
c/r: explicitly emit bind mounts as criu arguments

We switched to --ext-mount-map auto because of "system" (liblxc) added
mounts like the cgmanager socket that weren't in the config file. This had
the added advantage that we could drop all the mount processing code,
because we no longer needed an --ext-mount-map argument.

The problem here is that mounts can move between hosts. While
--ext-mount-map auto does its best to detect this situation, it explicitly
disallows moves that change the path name. In LXD, we bind mount
/var/lib/lxd/shmounts/$container to /dev/.lxd-mounts for each container,
and so when a container is renamed in a migration, the name changes.
--ext-mount-map auto won't detect this, and so the migration fails.

We *could* implement mount rewriting in CRIU, but my experience with cgroup
and apparmor rewriting is that this is painful and error prone. Instead, it
is much easier to go back to explicitly listing --ext-mount-map arguments
from the config file, and allow the source of the bind to change. We leave
--ext-mount-map auto to catch any stragling (or future) system added
mounts.

I believe this should fix Launchpad Bug 1580765

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
src/lxc/criu.c