[CRIU] [PATCH 09/12] kdat: Config for lastcap

Pavel Emelyanov xemul at virtuozzo.com
Mon Apr 24 13:08:39 PDT 2017


The last-cap value is a kernel constant that can be specified
once during criu compilation.

Signed-off-by: Pavel Emelyanov <xemul at virtuozzo.com>
---
 criu/kerndat.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/criu/kerndat.c b/criu/kerndat.c
index 90fca22..e8f955f 100644
--- a/criu/kerndat.c
+++ b/criu/kerndat.c
@@ -360,6 +360,13 @@ static int init_zero_page_pfn()
 	return ret;
 }
 
+#ifdef CONFIG_KERNEL_LASTCAP
+static inline int get_last_cap(void)
+{
+	kdat.last_cap = CONFIG_KERNEL_LASTCAP;
+	return 0;
+}
+#else
 static int get_last_cap(void)
 {
 	struct sysctl_req req[] = {
@@ -368,6 +375,7 @@ static int get_last_cap(void)
 
 	return sysctl_op(req, ARRAY_SIZE(req), CTL_READ, 0);
 }
+#endif
 
 static bool kerndat_has_memfd_create(void)
 {
-- 
2.5.5



More information about the CRIU mailing list