[CRIU] [PATCH v3 09/12] p.haul: add prepare_src_data function

Alexander Burluka aburluka at virtuozzo.com
Mon Apr 11 09:29:05 PDT 2016


Signed-off-by: Alexander Burluka <aburluka at virtuozzo.com>
---
 phaul/fs_haul_ploop.py   | 9 +++++++++
 phaul/fs_haul_shared.py  | 3 +++
 phaul/fs_haul_subtree.py | 3 +++
 3 files changed, 15 insertions(+)

diff --git a/phaul/fs_haul_ploop.py b/phaul/fs_haul_ploop.py
index f253cab..b8b47d5 100644
--- a/phaul/fs_haul_ploop.py
+++ b/phaul/fs_haul_ploop.py
@@ -59,6 +59,8 @@ class shared_ploop:
 			os.remove(self.__backup_ddxml)
 			os.remove(self.__backup_ddxml + ".lck")
 
+	def get_orig_info(self):
+		return {"ddxml": self.__orig_ddxml, "guid": self.__orig_guid}
 
 class p_haul_fs:
 	def __init__(self, deltas, ct_priv):
@@ -124,6 +126,13 @@ class p_haul_fs:
 		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
diff --git a/phaul/fs_haul_shared.py b/phaul/fs_haul_shared.py
index 28fd322..d925256 100644
--- a/phaul/fs_haul_shared.py
+++ b/phaul/fs_haul_shared.py
@@ -24,6 +24,9 @@ class p_haul_fs:
 	def stop_migration(self):
 		return None
 
+	def prepare_src_data(self, data):
+		return data
+
 	def restore_shared_backups(self):
 		pass
 
diff --git a/phaul/fs_haul_subtree.py b/phaul/fs_haul_subtree.py
index ffb0788..2f5a56f 100644
--- a/phaul/fs_haul_subtree.py
+++ b/phaul/fs_haul_subtree.py
@@ -59,6 +59,9 @@ class p_haul_fs:
 	def persistent_inodes(self):
 		return False
 
+	def prepare_src_data(self, data):
+		return data
+
 	def restore_shared_backups(self):
 		pass
 
-- 
1.8.3.1



More information about the CRIU mailing list