[CRIU] [PATCH v4 4/8] p.haul: modify p_haul_fs initialization

Alexander Burluka aburluka at virtuozzo.com
Wed Apr 13 03:25:59 PDT 2016


Add parsing of shared disks

Signed-off-by: Alexander Burluka <aburluka at virtuozzo.com>
---
 phaul/fs_haul_ploop.py | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/phaul/fs_haul_ploop.py b/phaul/fs_haul_ploop.py
index b0f35d4..c08ba48 100644
--- a/phaul/fs_haul_ploop.py
+++ b/phaul/fs_haul_ploop.py
@@ -8,6 +8,7 @@ import logging
 import threading
 import libploop
 import mstats
+import iters
 
 
 DDXML_FILENAME = "DiskDescriptor.xml"
@@ -72,6 +73,7 @@ class p_haul_fs:
 		# Create libploop.ploopcopy objects, one per active ploop delta
 		self.__log_init_hauler(deltas)
 		self.__ct_priv = ct_priv
+		self.__shared_ploops = []
 		self.__ploop_copies = []
 		for delta_path, delta_fd in deltas:
 			ddxml_path = get_ddxml_path(delta_path)
@@ -79,8 +81,16 @@ class p_haul_fs:
 			self.__ploop_copies.append(
 				libploop.ploopcopy(ddxml_path, delta_fd))
 
+	def __parse_shared_ploops(self, shareds):
+		if not shareds:
+			return []
+		return (get_delta_abspath(s, self.__ct_priv) for s in shareds.split(","))
+
 	def set_options(self, opts):
-		pass
+		if iters.is_live_mode(opts.get("mode", None)):
+			shareds = self.__parse_shared_ploops(opts.get("vz_shared_disks", []))
+			for shared in shareds:
+				self.__shared_ploops.append(shared_ploop(shared))
 
 	def set_work_dir(self, wdir):
 		pass
-- 
1.8.3.1



More information about the CRIU mailing list