[CRIU] [PATCH p.haul] add --auto_dedup option

Pavel Tikhomirov ptikhomirov at virtuozzo.com
Thu Dec 29 01:05:52 PST 2016


add option on local dump/predump, on page-server and on restore

Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
---
 phaul/args_parser.py | 5 +++++
 phaul/criu_req.py    | 3 +++
 phaul/images.py      | 1 +
 3 files changed, 9 insertions(+)

diff --git a/phaul/args_parser.py b/phaul/args_parser.py
index 6a1863c..30d8a82 100644
--- a/phaul/args_parser.py
+++ b/phaul/args_parser.py
@@ -116,6 +116,11 @@ import iters
 		default=False, action='store_true',
 		help="Don't start on destination node (if run in restart mode)")
 
+	parser.add_argument(
+		"--auto-dedup",
+		default=False, action='store_true',
+		help="Do automatic deduplication of criu memory images to save disk/memory space")
+
 	# Add haulers specific arguments
 	if len(sys.argv) > 1 and sys.argv[1] in htype.get_haul_names():
 		htype.add_hauler_args(sys.argv[1], parser)
diff --git a/phaul/criu_req.py b/phaul/criu_req.py
index ab6e1aa..8aabb60 100644
--- a/phaul/criu_req.py
+++ b/phaul/criu_req.py
@@ -57,6 +57,7 @@ _names = _build_names(_name_strings)
 
 	req.opts.images_dir_fd = img.image_dir_fd()
 	req.opts.work_dir_fd = img.work_dir_fd()
+	req.opts.auto_dedup = img.auto_dedup
 	p_img = img.prev_image_dir()
 	if p_img:
 		req.opts.parent_img = p_img
@@ -93,6 +94,7 @@ _names = _build_names(_name_strings)
 	req.opts.ps.fd = connection.mem_sk_fileno()
 	req.opts.images_dir_fd = img.image_dir_fd()
 	req.opts.work_dir_fd = img.work_dir_fd()
+	req.opts.auto_dedup = img.auto_dedup
 
 	p_img = img.prev_image_dir()
 	if p_img:
@@ -115,6 +117,7 @@ _names = _build_names(_name_strings)
 	req = _make_req(pycriu.rpc.RESTORE, htype)
 	req.opts.images_dir_fd = img.image_dir_fd()
 	req.opts.work_dir_fd = img.work_dir_fd()
+	req.opts.auto_dedup = img.auto_dedup
 	req.opts.notify_scripts = True
 
 	if htype.can_migrate_tcp():
diff --git a/phaul/images.py b/phaul/images.py
index 728af7c..18db9ec 100644
--- a/phaul/images.py
+++ b/phaul/images.py
@@ -84,6 +84,7 @@ def_path = "/var/local/p.haul-fs/"
 		self._keep_on_close = True
 
 	def set_options(self, opts):
+		self.auto_dedup = opts["auto_dedup"]
 		self._keep_on_close = opts["keep_images"]
 
 		suf = time.strftime("-%y.%m.%d-%H.%M", time.localtime())
-- 
2.9.3



More information about the CRIU mailing list