[lxc-devel] [PATCH 1/2] c/r: use --restore-sibling option in CRIU

Tycho Andersen tycho.andersen at canonical.com
Fri Sep 12 20:56:07 UTC 2014


In order for LXC to be the parent of the restored process, CRIU needs to
restore init as its sibling, not as its child. This was previously accomplished
essentially via luck :). CRIU now has a --restore-sibling option which forces
this behavior that LXC expects. See more discussion in this thread:
http://lists.openvz.org/pipermail/criu/2014-September/thread.html#16330

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

diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c
index ff5167a..8c75267 100644
--- a/src/lxc/lxccontainer.c
+++ b/src/lxc/lxccontainer.c
@@ -3546,11 +3546,11 @@ static int read_criu_file(const char *directory, const char *file, int netnr, ch
 static void exec_criu(struct criu_opts *opts)
 {
 	char **argv, log[PATH_MAX];
-	int static_args = 14, argc = 0, i, ret;
+	int static_args = 15, argc = 0, i, ret;
 
 	/* The command line always looks like:
 	 * criu $(action) --tcp-established --file-locks --link-remap --force-irmap \
-	 * --manage-cgroups action-script foo.sh -D $(directory) \
+	 * --manage-cgroups --restore-sibling action-script foo.sh -D $(directory) \
 	 * -o $(directory)/$(action).log
 	 * +1 for final NULL */
 
@@ -3601,6 +3601,7 @@ static void exec_criu(struct criu_opts *opts)
 	DECLARE_ARG("--file-locks");
 	DECLARE_ARG("--link-remap");
 	DECLARE_ARG("--force-irmap");
+	DECLARE_ARG("--restore-sibling");
 	DECLARE_ARG("--manage-cgroups");
 	DECLARE_ARG("--action-script");
 	DECLARE_ARG(LIBEXECDIR "/lxc/lxc-restore-net");
-- 
1.9.1



More information about the lxc-devel mailing list