[CRIU] [PATCH] check: return non-zero code if PR_SET_MM_MAP is unsupported

Andrey Vagin avagin at openvz.org
Fri Nov 7 10:27:28 PST 2014


We do the same for other features.

Here is an exception in case of the --ms option.

Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 cr-check.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/cr-check.c b/cr-check.c
index fe370ff..e96da14 100644
--- a/cr-check.c
+++ b/cr-check.c
@@ -183,6 +183,12 @@ static int check_prctl(void)
 	 */
 	ret = sys_prctl(PR_SET_MM, PR_SET_MM_MAP_SIZE, (unsigned long)&size, 0, 0);
 	if (ret) {
+		if (!opts.check_ms_kernel) {
+			pr_msg("prctl: PR_SET_MM_MAP is not supported, which "
+			       "is required for restoring user namespaces\n");
+			return -1;
+		} else
+			pr_warn("Skipping unssuported PR_SET_MM_MAP\n");
 
 		ret = sys_prctl(PR_SET_MM, PR_SET_MM_BRK, sys_brk(0), 0, 0);
 		if (ret) {
-- 
1.9.3



More information about the CRIU mailing list