[CRIU] [PATCH] zdtm: Mount devtmpfs and devpts in new root

Cyrill Gorcunov gorcunov at openvz.org
Mon Sep 17 05:53:33 EDT 2012


In case if we enter the new rootfs don't forget to
maount devtmpfs and devpts, otherwise ttys can't
be connected.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 test/zdtm/lib/ns.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/test/zdtm/lib/ns.c b/test/zdtm/lib/ns.c
index 664715f..4a933cc 100644
--- a/test/zdtm/lib/ns.c
+++ b/test/zdtm/lib/ns.c
@@ -107,6 +107,15 @@ done:
 			fprintf(stderr, "mount(/proc) failed: %m\n");
 			return -1;
 		}
+		if (mount("devtmpfs", "/dev", "devtmpfs", MS_MGC_VAL, NULL)) {
+			fprintf(stderr, "mount(/dev) failed: %m\n");
+			return -1;
+		}
+		if (mount("pts", "/dev/pts", "devpts", MS_MGC_VAL, NULL)) {
+			fprintf(stderr, "mount(/dev/pts) failed: %m\n");
+			return -1;
+		}
+
 		if (fchdir(dfd)) {
 			fprintf(stderr, "fchdir() failed: %m\n");
 			return -1;
-- 
1.7.7.6



More information about the CRIU mailing list