[CRIU] [PATCH] ipc: add check for new IPC sysctls

Kinsbursky Stanislav skinsbursky at openvz.org
Fri Nov 30 04:32:09 EST 2012


From: Stanislav Kinsbursky <skinsbursky at openvz.org>

This patch adds check for "/proc/sys/kernel/sem_next_id" to make sure, that
kernel supports restore of IPC objects.

Signed-off-by: Stanislav Kinsbursky <skinsbursky at openvz.org>
---
 cr-check.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
-------------- next part --------------
diff --git a/cr-check.c b/cr-check.c
index 32ac164..951ee76 100644
--- a/cr-check.c
+++ b/cr-check.c
@@ -405,6 +405,18 @@ static int check_so_get_filter(void)
 	return 0;
 }
 
+static int check_ipc(void)
+{
+	int ret;
+
+	ret = access("/proc/sys/kernel/sem_next_id", R_OK | W_OK);
+	if (!ret)
+		return 0;
+
+	pr_msg("/proc/sys/kernel/sem_next_id sysctl is missing.\n");
+	return -1;
+}
+
 int cr_check(void)
 {
 	int ret = 0;
@@ -429,6 +441,7 @@ int cr_check(void)
 	ret |= check_unaligned_vmsplice();
 	ret |= check_tty();
 	ret |= check_so_get_filter();
+	ret |= check_ipc();
 
 	if (!ret)
 		pr_msg("Looks good.\n");


More information about the CRIU mailing list