[CRIU] [PATCH] zdtm.py: Fix iterations

Pavel Emelyanov xemul at parallels.com
Tue Oct 27 06:29:51 PDT 2015


Currently --iter N results in sequential images for every new iteration.

Signed-off-by: Pavel Emelyanov <xemul at parallels.com>
---
 test/zdtm.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/test/zdtm.py b/test/zdtm.py
index a7db8d9..71bddb9 100755
--- a/test/zdtm.py
+++ b/test/zdtm.py
@@ -388,6 +388,7 @@ class criu_cli:
 		self.__test = None
 		self.__dump_path = None
 		self.__iter = 0
+		self.__prev_dump_iter = None
 		self.__page_server = (opts['page_server'] and True or False)
 		self.__restore_sibling = (opts['sibling'] and True or False)
 		self.__fault = (opts['fault'])
@@ -434,8 +435,9 @@ class criu_cli:
 		os.mkdir(self.__ddir())
 
 		a_opts = ["-t", self.__test.getpid()]
-		if self.__iter > 1:
-			a_opts += ["--prev-images-dir", "../%d" % (self.__iter - 1), "--track-mem"]
+		if self.__prev_dump_iter:
+			a_opts += ["--prev-images-dir", "../%d" % self.__prev_dump_iter, "--track-mem"]
+		self.__prev_dump_iter = self.__iter
 
 		if self.__page_server:
 			print "Adding page server"
@@ -457,6 +459,7 @@ class criu_cli:
 			self.__test.auto_reap = False
 		r_opts += self.__test.getropts()
 
+		self.__prev_dump_iter = None
 		self.__criu_act("restore", opts = r_opts + ["--restore-detached"])
 
 	@staticmethod
-- 
1.9.3



More information about the CRIU mailing list