2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 06:15:24 +00:00

uffdd: Implement --daemon mode

Right now the zdtm.py hacks around core code and waits for
a second for the socket to appear. Let's better make proper
--daemon mode for lazy-pages daemon and pidfile generation.

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Acked-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
This commit is contained in:
Pavel Emelyanov
2016-11-13 11:52:38 +02:00
committed by Andrei Vagin
parent fe53a87f70
commit 0086dca47d
4 changed files with 48 additions and 14 deletions

View File

@@ -962,11 +962,9 @@ class criu:
r_opts.append('--external')
r_opts.append('mnt[zdtm]:%s' % criu_dir)
lazy_pages_p = None
if self.__lazy_pages:
lazy_pages_p = self.__criu_act("lazy-pages", opts = [], nowait = True)
self.__criu_act("lazy-pages", opts = ["--daemon", "--pidfile", "lp.pid"])
r_opts += ["--lazy-pages"]
time.sleep(1) # FIXME wait user fault fd socket
if self.__leave_stopped:
r_opts += ['--leave-stopped']
@@ -989,8 +987,8 @@ class criu:
pstree_check_stopped(self.__test.getpid())
pstree_signal(self.__test.getpid(), signal.SIGCONT)
if lazy_pages_p and lazy_pages_p.wait():
raise test_fail_exc("CRIU lazy-pages")
if self.__lazy_pages:
wait_pid_die(int(rpidfile(self.__ddir() + "/lp.pid")), "lazy pages daemon")
@staticmethod
def check(feature):