[CRIU] [PATCH 04/11] p.haul: move predump creation to separate function
Nikita Spiridonov
nspiridonov at virtuozzo.com
Mon Mar 21 09:35:19 PDT 2016
Move predump creation to criu_cr.criu_predump function to simplify
iters.start_migration logic.
Signed-off-by: Nikita Spiridonov <nspiridonov at virtuozzo.com>
---
phaul/criu_cr.py | 7 +++++++
phaul/iters.py | 8 ++------
2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/phaul/criu_cr.py b/phaul/criu_cr.py
index d402ce1..8064193 100644
--- a/phaul/criu_cr.py
+++ b/phaul/criu_cr.py
@@ -7,6 +7,13 @@ import pycriu.rpc
import criu_req
+def criu_predump(pid, img, criu_connection, fs):
+ req = criu_req.make_predump_req(pid, img, criu_connection, fs)
+ resp = criu_connection.send_req(req)
+ if not resp.success:
+ raise Exception("Pre-dump failed")
+
+
def criu_dump(htype, pid, img, criu_connection, fs):
req = criu_req.make_dump_req(pid, htype, img, criu_connection, fs)
resp = criu_connection.send_req(req)
diff --git a/phaul/iters.py b/phaul/iters.py
index 1ac1fd2..f721ae8 100644
--- a/phaul/iters.py
+++ b/phaul/iters.py
@@ -7,6 +7,7 @@ import images
import mstats
import xem_rpc_client
import criu_api
+import criu_cr
import criu_req
import htype
import errno
@@ -140,12 +141,7 @@ class phaul_iter_worker:
self.img.new_image_dir()
logging.info("\tIssuing pre-dump command to service")
- req = criu_req.make_predump_req(
- self.pid, self.img, self.criu_connection, self.fs)
- resp = self.criu_connection.send_req(req)
- if not resp.success:
- raise Exception("Pre-dump failed")
- logging.info("\tPre-dump succeeded")
+ criu_cr.criu_predump(self.pid, self.img, self.criu_connection, self.fs)
fsstats = self.fs.next_iteration()
--
1.7.1
More information about the CRIU
mailing list