[CRIU] [PATCH 07/12] p.haul: add two common fs methods for shared backups

Alexander Burluka aburluka at virtuozzo.com
Fri Apr 1 08:45:24 PDT 2016


restore_shared_backups and cleanup_shared_backups
was added

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

diff --git a/phaul/fs_haul_ploop.py b/phaul/fs_haul_ploop.py
index f59f831..f95086c 100644
--- a/phaul/fs_haul_ploop.py
+++ b/phaul/fs_haul_ploop.py
@@ -112,6 +112,16 @@ class p_haul_fs:
 			total_xferred += ploopcopy.copy_stop()
 		return mstats.fs_iter_stats(total_xferred)
 
+	def restore_shared_backups(self):
+		if iters.is_live_mode(self.__mode):
+			for pl in self.__shared_ploops:
+				pl.restore()
+
+	def cleanup_shared_backups(self):
+		if iters.is_live_mode(self.__mode):
+			for pl in self.__shared_ploops:
+				pl.cleanup()
+
 	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 77a5a27..28fd322 100644
--- a/phaul/fs_haul_shared.py
+++ b/phaul/fs_haul_shared.py
@@ -24,6 +24,12 @@ class p_haul_fs:
 	def stop_migration(self):
 		return None
 
+	def restore_shared_backups(self):
+		pass
+
+	def cleanup_shared_backups(self):
+		pass
+
 	# Inode numbers do not change on this FS
 	# during migration
 	def persistent_inodes(self):
diff --git a/phaul/fs_haul_subtree.py b/phaul/fs_haul_subtree.py
index 7f7e46d..ffb0788 100644
--- a/phaul/fs_haul_subtree.py
+++ b/phaul/fs_haul_subtree.py
@@ -58,3 +58,9 @@ class p_haul_fs:
 	# When rsync-ing FS inodes number will change
 	def persistent_inodes(self):
 		return False
+
+	def restore_shared_backups(self):
+		pass
+
+	def cleanup_shared_backups(self):
+		pass
-- 
1.8.3.1



More information about the CRIU mailing list