[lxc-devel] [lxc/master] c/r: use criu's "full" mode for cgroups

tych0 on Github lxc-bot at linuxcontainers.org
Tue Jun 28 00:11:03 UTC 2016


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 884 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20160628/cc11dd26/attachment.bin>
-------------- next part --------------
From 0a5fc6dfa772b787b9c06896d348b2137edf0cba Mon Sep 17 00:00:00 2001
From: Tycho Andersen <tycho.andersen at canonical.com>
Date: Mon, 27 Jun 2016 22:24:09 +0000
Subject: [PATCH] c/r: use criu's "full" mode for cgroups

A while ago cgroup modes were introduced to CRIU, which slightly changed
the behavior w.r.t. cgroups under the hood. What we're really after is
criu's --full mode, i.e. even if a particular cgroup directory exists
(in particular /lxc/$container[-$number] will, since we create it), we
should restore perms on that cgroup.

Things worked just fine for actual properties (except "special" properties
as criu refers to them, which I've just sent a patch for) because liblxc
creates no subdirectories, just the TLD.

Signed-off-by: Tycho Andersen <tycho.andersen at canonical.com>
---
 src/lxc/criu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lxc/criu.c b/src/lxc/criu.c
index ce8ada6..a1b7d40 100644
--- a/src/lxc/criu.c
+++ b/src/lxc/criu.c
@@ -135,7 +135,7 @@ static void exec_criu(struct criu_opts *opts)
 
 	/* The command line always looks like:
 	 * criu $(action) --tcp-established --file-locks --link-remap \
-	 * --manage-cgroups action-script foo.sh -D $(directory) \
+	 * --manage-cgroups=full action-script foo.sh -D $(directory) \
 	 * -o $(directory)/$(action).log --ext-mount-map auto
 	 * --enable-external-sharing --enable-external-masters
 	 * --enable-fs hugetlbfs --enable-fs tracefs --ext-mount-map console:/dev/pts/n
@@ -218,7 +218,7 @@ static void exec_criu(struct criu_opts *opts)
 	DECLARE_ARG("--tcp-established");
 	DECLARE_ARG("--file-locks");
 	DECLARE_ARG("--link-remap");
-	DECLARE_ARG("--manage-cgroups");
+	DECLARE_ARG("--manage-cgroups=full");
 	DECLARE_ARG("--ext-mount-map");
 	DECLARE_ARG("auto");
 	DECLARE_ARG("--enable-external-sharing");


More information about the lxc-devel mailing list