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

Submitted by Nikita Spiridonov on June 13, 2016, 8 a.m.

Details

Message ID 1465804848-695649-2-git-send-email-nspiridonov@virtuozzo.com
State New
Series "Series without cover letter"
Headers show

Commit Message

Nikita Spiridonov June 13, 2016, 8 a.m.
Pass htype to criu_predump function to make it possible to adjust
predump requests in specific hauler modules.

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

Patch hide | download patch | download mbox

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

Comments

Pavel Emelyanov June 15, 2016, 11:47 a.m.
Both applied