[CRIU] [PATCH p.haul 2/2] p.haul: make it possible to adjust predump request

Nikita Spiridonov nspiridonov at virtuozzo.com
Mon Jun 13 01:00:48 PDT 2016


Pass htype to criu_predump function to make it possible to adjust
predump requests in specific hauler modules.

Signed-off-by: Nikita Spiridonov <nspiridonov at virtuozzo.com>
---
 phaul/criu_cr.py  |    4 ++--
 phaul/criu_req.py |    4 ++--
 phaul/iters.py    |    3 ++-
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/phaul/criu_cr.py b/phaul/criu_cr.py
index 4c0f804..8f25cff 100644
--- a/phaul/criu_cr.py
+++ b/phaul/criu_cr.py
@@ -7,9 +7,9 @@ import pycriu.rpc
 import criu_req
 
 
-def criu_predump(pid, img, criu_connection, fs):
+def criu_predump(htype, pid, img, criu_connection, fs):
 	logging.info("\tIssuing pre-dump command to service")
-	req = criu_req.make_predump_req(pid, img, criu_connection, fs)
+	req = criu_req.make_predump_req(pid, htype, img, criu_connection, fs)
 	resp = criu_connection.send_req(req)
 	if not resp.success:
 		raise Exception("Pre-dump failed")
diff --git a/phaul/criu_req.py b/phaul/criu_req.py
index a5bb01c..36d1e43 100644
--- a/phaul/criu_req.py
+++ b/phaul/criu_req.py
@@ -66,10 +66,10 @@ def _make_common_dump_req(typ, pid, htype, img, connection, fs):
 	return req
 
 
-def make_predump_req(pid, img, connection, fs):
+def make_predump_req(pid, htype, img, connection, fs):
 	"""Prepare pre-dump criu request (source side)"""
 	return _make_common_dump_req(
-		pycriu.rpc.PRE_DUMP, pid, None, img, connection, fs)
+		pycriu.rpc.PRE_DUMP, pid, htype, img, connection, fs)
 
 
 def make_dump_req(pid, htype, img, connection, fs):
diff --git a/phaul/iters.py b/phaul/iters.py
index b8b06cf..910cb30 100644
--- a/phaul/iters.py
+++ b/phaul/iters.py
@@ -193,7 +193,8 @@ class phaul_iter_worker:
 			logging.info("* Iteration %d", iter_index)
 			self.target_host.start_iter(True)
 			self.img.new_image_dir()
-			criu_cr.criu_predump(root_pid, self.img, self.criu_connection, self.fs)
+			criu_cr.criu_predump(self.htype, root_pid, self.img,
+				self.criu_connection, self.fs)
 			self.target_host.end_iter()
 
 			# Handle FS migration iteration
-- 
1.7.1



More information about the CRIU mailing list