[CRIU] [RFC PATCH 3/3] zdtm.py: simulate lazy migration with page server that can send pages

Mike Rapoport rppt at linux.vnet.ibm.com
Mon Nov 21 06:16:47 PST 2016


Lazy migration requires both dumped and restored processes to coexist at
the same time. This breaks some basic assumptions in the zdtm design.
Simulation of lazy migration with the page server allows testing most of
the involved code paths without major intervention into zdtm
infrastructure.

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

diff --git a/test/zdtm.py b/test/zdtm.py
index ca7884c..a96a010 100755
--- a/test/zdtm.py
+++ b/test/zdtm.py
@@ -767,7 +767,9 @@ class criu:
 		self.__iter = 0
 		self.__prev_dump_iter = None
 		self.__page_server = (opts['page_server'] and True or False)
-		self.__lazy_pages = (opts['lazy_pages'] and True or False)
+		self.__remote_lazy_pages = (opts['remote_lazy_pages'] and True or False)
+		self.__lazy_pages = (self.__remote_lazy_pages or
+                                     opts['lazy_pages'] and True or False)
 		self.__restore_sibling = (opts['sibling'] and True or False)
 		self.__join_ns = (opts['join_ns'] and True or False)
 		self.__empty_ns = (opts['empty_ns'] and True or False)
@@ -932,7 +934,13 @@ class criu:
 			r_opts.append('mnt[zdtm]:%s' % criu_dir)
 
 		if self.__lazy_pages:
-			self.__criu_act("lazy-pages", opts = ["--daemon", "--pidfile", "lp.pid"])
+			lp_opts = ["--daemon", "--pidfile", "lp.pid"]
+			if self.__remote_lazy_pages:
+				lp_opts += ['--page-server', "--port", "12345"]
+				ps_opts = ["--daemon", "--pidfile", "ps.pid",
+					   "--port", "12345", "--lazy-pages"]
+				self.__criu_act("page-server", opts = ps_opts)
+			self.__criu_act("lazy-pages", opts = lp_opts)
 			r_opts += ["--lazy-pages"]
 
 		if self.__leave_stopped:
@@ -1364,7 +1372,7 @@ class launcher:
 
 		nd = ('nocr', 'norst', 'pre', 'iters', 'page_server', 'sibling', 'stop', 'lazy_pages', 'empty_ns',
 				'fault', 'keep_img', 'report', 'snaps', 'sat', 'script', 'rpc',
-				'join_ns', 'dedup', 'sbs', 'freezecg', 'user', 'dry_run', 'noauto_dedup')
+				'join_ns', 'dedup', 'sbs', 'freezecg', 'user', 'dry_run', 'noauto_dedup', 'remote_lazy_pages')
 		arg = repr((name, desc, flavor, {d: self.__opts[d] for d in nd}))
 
 		if self.__use_log:
@@ -1832,6 +1840,7 @@ rp.add_argument("-k", "--keep-img", help = "Whether or not to keep images after
 rp.add_argument("--report", help = "Generate summary report in directory")
 rp.add_argument("--keep-going", help = "Keep running tests in spite of failures", action = 'store_true')
 rp.add_argument("--lazy-pages", help = "restore pages on demand", action = 'store_true')
+rp.add_argument("--remote-lazy-pages", help = "simulate lazy migration", action = 'store_true')
 
 lp = sp.add_parser("list", help = "List tests")
 lp.set_defaults(action = list_tests)
-- 
1.9.1



More information about the CRIU mailing list