[CRIU] [PATCH v4 5/8] p.haul: add necessary operations on shared ploops

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


That commit introduces methods that are used in migration
scenario with shared ploops. These operations are simply
consistent calling of appropriate ploop method.
Initialization, restoring, cleanup and gathering info
are implemented that way.
Signed-off-by: Alexander Burluka <aburluka at virtuozzo.com>
---
 phaul/fs_haul_ploop.py | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/phaul/fs_haul_ploop.py b/phaul/fs_haul_ploop.py
index c08ba48..644095a 100644
--- a/phaul/fs_haul_ploop.py
+++ b/phaul/fs_haul_ploop.py
@@ -111,8 +111,27 @@ class p_haul_fs:
 		total_xferred = 0
 		for ploopcopy in self.__ploop_copies:
 			total_xferred += ploopcopy.copy_stop()
+
+		for pl in self.__shared_ploops:
+			pl.prepare()
+
 		return mstats.fs_iter_stats(total_xferred)
 
+	def restore_shared_ploops(self):
+		for pl in self.__shared_ploops:
+			pl.restore()
+
+	def cleanup_shared_ploops(self):
+		for pl in self.__shared_ploops:
+			pl.cleanup()
+
+	def prepare_src_data(self, data):
+		if self.__shared_ploops:
+			data["shareds"] = []
+			for pl in self.__shared_ploops:
+				data["shareds"].append(pl.get_orig_info())
+		return data
+
 	def persistent_inodes(self):
 		"""Inode numbers do not change during ploop disk migration"""
 		return True
-- 
1.8.3.1



More information about the CRIU mailing list