[lxc-devel] [lxc/lxc] 5f4e44: c/r: explicitly emit bind mounts as criu arguments

GitHub noreply at github.com
Mon Oct 31 21:34:57 UTC 2016


  Branch: refs/heads/master
  Home:   https://github.com/lxc/lxc
  Commit: 5f4e44a22df60c25005c95b9326fd989efd80569
      https://github.com/lxc/lxc/commit/5f4e44a22df60c25005c95b9326fd989efd80569
  Author: Tycho Andersen <tycho.andersen at canonical.com>
  Date:   2016-10-31 (Mon, 31 Oct 2016)

  Changed paths:
    M src/lxc/criu.c

  Log Message:
  -----------
  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 at canonical.com>


  Commit: ed408e6674bd5372d6213c5d672422bf4d2862a7
      https://github.com/lxc/lxc/commit/ed408e6674bd5372d6213c5d672422bf4d2862a7
  Author: Tycho Andersen <tycho.andersen at canonical.com>
  Date:   2016-10-31 (Mon, 31 Oct 2016)

  Changed paths:
    M src/lxc/log.h

  Log Message:
  -----------
  log: bump LXC_LOG_BUFFER_SIZE to 4096

We need to log longer lines due to CRIU arguments.

Signed-off-by: Tycho Andersen <tycho.andersen at canonical.com>


  Commit: 52e129450eae6f916f1e5bf4342f543d07cfb481
      https://github.com/lxc/lxc/commit/52e129450eae6f916f1e5bf4342f543d07cfb481
  Author: Stéphane Graber <stgraber at stgraber.org>
  Date:   2016-10-31 (Mon, 31 Oct 2016)

  Changed paths:
    M src/lxc/criu.c
    M src/lxc/log.h

  Log Message:
  -----------
  Merge pull request #1266 from tych0/do-mount-rewriting

Do mount rewriting


Compare: https://github.com/lxc/lxc/compare/a99e57fe9bd9...52e129450eae


More information about the lxc-devel mailing list