[CRIU] [PATCH 3/3] cgroups: clarify comment about when dumping criu cgset

Tycho Andersen tycho.andersen at canonical.com
Thu Jun 16 14:38:29 PDT 2016


Empty cgroups will not be preserved in the criu cgset, since we don't ever
dump the criu cgset. This is perhaps a corner case that we may want to
address, but is probably (?) really only relevant for test cases.

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

diff --git a/criu/cgroup.c b/criu/cgroup.c
index 924830f..112c7ee 100644
--- a/criu/cgroup.c
+++ b/criu/cgroup.c
@@ -854,7 +854,10 @@ int dump_cgroups(void)
 
 	/*
 	 * Check whether root task lives in its own set as compared
-	 * to criu. If yes, we should not dump anything.
+	 * to criu. If yes, we should not dump anything. Note that
+	 * list_is_singular() is slightly wrong here: if the criu cgset has
+	 * empty cgroups, those will not be restored on the target host, since
+	 * we're not dumping anything here.
 	 */
 
 	if (root_cgset == criu_cgset && list_is_singular(&cg_sets)) {
-- 
2.7.4



More information about the CRIU mailing list