[CRIU] [PATCH v3 06/12] p.haul: modify p_haul_fs initialization

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


Add parsing of shared disks

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

diff --git a/phaul/fs_haul_ploop.py b/phaul/fs_haul_ploop.py
index 194c5d9..a1d5df4 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"
@@ -70,6 +71,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)
@@ -83,7 +85,10 @@ class p_haul_fs:
 		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