[CRIU] [PATCH 2/2] zdtm.py: use --status-fd instead --daemon
Andrei Vagin
avagin at openvz.org
Wed Feb 1 20:46:38 PST 2017
From: Andrei Vagin <avagin at virtuozzo.com>
It works faster and allows to check exit codes.
Signed-off-by: Andrei Vagin <avagin at virtuozzo.com>
---
test/zdtm.py | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/test/zdtm.py b/test/zdtm.py
index b07a06b..98e68e6 100755
--- a/test/zdtm.py
+++ b/test/zdtm.py
@@ -789,8 +789,7 @@ class criu:
self.__page_server_p = None
def fini(self, opts):
- if self.__lazy_pages:
- wait_pid_die(int(rpidfile(self.__ddir() + "/lp.pid")), "lazy-pages")
+ return
def logs(self):
return self.__dump_path
@@ -960,12 +959,12 @@ class criu:
r_opts.append('mnt[zdtm]:%s' % criu_dir)
if self.__lazy_pages:
- lp_opts = ["--daemon", "--pidfile", "lp.pid"]
+ lp_opts = []
if self.__remote_lazy_pages:
lp_opts += ['--page-server', "--port", "12345"]
- ps_opts = ["--daemon", "--pidfile", "ps.pid",
+ ps_opts = ["--pidfile", "ps.pid",
"--port", "12345", "--lazy-pages"]
- self.__criu_act("page-server", opts = ps_opts)
+ self.__page_server_p = self.__criu_act("page-server", opts = ps_opts, nowait = True)
self.__lazy_pages_p = self.__criu_act("lazy-pages", opts = lp_opts, nowait = True)
r_opts += ["--lazy-pages"]
@@ -980,6 +979,12 @@ class criu:
if ret:
raise test_fail_exc("criu lazy-pages exited with %s" % ret)
+ if self.__page_server_p:
+ ret = self.__page_server_p.wait()
+ self.__page_server_p = None
+ if ret:
+ raise test_fail_exc("criu page-server exited with %s" % ret)
+
if self.__leave_stopped:
pstree_check_stopped(self.__test.getpid())
pstree_signal(self.__test.getpid(), signal.SIGCONT)
--
2.7.4
More information about the CRIU
mailing list