[CRIU] [PATCH] test/zdtm: do not allow running with --lazy-pages on kernel without uffd

Mike Rapoport rppt at linux.vnet.ibm.com
Sun Jul 9 09:12:37 MSK 2017


Raise an exception for kernels that do not have userfaultfd. For the
kernels that have userfaultfd but do not provide non-cooperative events
(4.3 - 4.10) warn about incomplete feature.

Fixes: #363

Signed-off-by: Mike Rapoport <rppt at linux.vnet.ibm.com>
---
 test/zdtm.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/test/zdtm.py b/test/zdtm.py
index 2ee76cd..e6d2701 100755
--- a/test/zdtm.py
+++ b/test/zdtm.py
@@ -1767,6 +1767,16 @@ def run_tests(opts):
 		if subprocess.Popen(["ip", "netns", "exec", "zdtm_netns", "ip", "link", "set", "up", "dev", "lo"]).wait():
 			raise Exception("ip link set up dev lo")
 
+	if opts['lazy_pages'] or opts['remote_lazy_pages']:
+		check = subprocess.Popen([criu_bin, "check", "--feature", "lazy_pages"], stderr = subprocess.PIPE)
+		ret = check.wait()
+		err = ''.join(check.stderr.readlines())
+		if ret:
+			if "UFFD is not supported" in err:
+				raise Exception("UFFD is not supported, cannot run with --lazy-pages")
+			# Most test will work with 4.3 - 4.10
+			print "WARNING: UFFD is missing essentail features"
+
 	l = launcher(opts, len(torun))
 	try:
 		for t in torun:
-- 
2.7.4



More information about the CRIU mailing list