[CRIU] [PATCH v4 7/8] p.haul: add htype migration_complete and migration_fail

Alexander Burluka aburluka at virtuozzo.com
Wed Apr 13 03:26:02 PDT 2016


This methods required to perform VZ migration scenario
with shared ploops. This methods perform proper handling
of success and fail cases.

Signed-off-by: Alexander Burluka <aburluka at virtuozzo.com>
---
 phaul/p_haul_docker.py | 6 ++++++
 phaul/p_haul_lxc.py    | 6 ++++++
 phaul/p_haul_pid.py    | 6 ++++++
 phaul/p_haul_vz.py     | 8 ++++++++
 4 files changed, 26 insertions(+)

diff --git a/phaul/p_haul_docker.py b/phaul/p_haul_docker.py
index f8d90db..35d2d2f 100644
--- a/phaul/p_haul_docker.py
+++ b/phaul/p_haul_docker.py
@@ -138,6 +138,12 @@ class p_haul_type:
 			pid = int(line.split(None, 1)[0])
 			os.kill(pid, signal.SIGKILL)
 
+	def migration_complete(self, fs, target_host):
+		pass
+
+	def migration_fail(self, fs):
+		pass
+
 	def target_cleanup(self, src_data):
 		pass
 
diff --git a/phaul/p_haul_lxc.py b/phaul/p_haul_lxc.py
index 5a48989..226ec57 100644
--- a/phaul/p_haul_lxc.py
+++ b/phaul/p_haul_lxc.py
@@ -118,6 +118,12 @@ class p_haul_type:
 	def final_dump(self, pid, img, ccon, fs):
 		criu_cr.criu_dump(self, pid, img, ccon, fs)
 
+	def migration_complete(self, fs, target_host):
+		pass
+
+	def migration_fail(self, fs):
+		pass
+
 	def target_cleanup(self, src_data):
 		pass
 
diff --git a/phaul/p_haul_pid.py b/phaul/p_haul_pid.py
index fb2a6ad..edff9af 100644
--- a/phaul/p_haul_pid.py
+++ b/phaul/p_haul_pid.py
@@ -73,6 +73,12 @@ class p_haul_type:
 	def final_dump(self, pid, img, ccon, fs):
 		criu_cr.criu_dump(self, pid, img, ccon, fs)
 
+	def migration_complete(self, fs, target_host):
+		pass
+
+	def migration_fail(self, fs):
+		pass
+
 	def target_cleanup(self, src_data):
 		pass
 
diff --git a/phaul/p_haul_vz.py b/phaul/p_haul_vz.py
index bee24d1..b867477 100644
--- a/phaul/p_haul_vz.py
+++ b/phaul/p_haul_vz.py
@@ -211,6 +211,14 @@ class p_haul_type:
 			logging.info(proc_output)
 			self._fs_mounted = False
 
+	def migration_complete(self, fs, target_host):
+		fs.cleanup_shared_ploops()
+		self.umount()
+		target_host.migration_complete(fs.prepare_src_data({}))
+
+	def migration_fail(self, fs):
+		fs.restore_shared_ploops()
+
 	def target_cleanup(self, src_data):
 		if "shareds" in src_data:
 			for ploop in src_data["shareds"]:
-- 
1.8.3.1



More information about the CRIU mailing list