[CRIU] [PATCH 3/3] p.haul: add --skip-cpu-check and --skip-criu-check options

Nikita Spiridonov nspiridonov at virtuozzo.com
Thu Apr 14 04:18:11 PDT 2016


Add --skip-cpu-check and --skip-criu-check options needed to
skip specified sanity check. In addition --force option
still skip all sanity checks.

Signed-off-by: Nikita Spiridonov <nspiridonov at virtuozzo.com>
---
 phaul/args_parser.py |    6 +++++-
 phaul/iters.py       |    6 ++++--
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/phaul/args_parser.py b/phaul/args_parser.py
index 165ef60..8735aa2 100644
--- a/phaul/args_parser.py
+++ b/phaul/args_parser.py
@@ -31,7 +31,11 @@ def parse_client_args():
 	parser.add_argument("--img-path", default=images.def_path,
 		help="Directory where to put images")
 	parser.add_argument("--pid-root", help="Path to tree's FS root")
-	parser.add_argument("--force", default=False, action='store_true', help="Don't do any sanity (CPU compat) checks")
+	parser.add_argument("--force", default=False, action='store_true', help="Don't do any sanity checks")
+	parser.add_argument("--skip-cpu-check", default=False, action='store_true',
+		help="Skip CPU compatibility check")
+	parser.add_argument("--skip-criu-check", default=False, action='store_true',
+		help="Skip criu compatibility check")
 	parser.add_argument("--log-file", help="Write logging messages to specified file")
 	parser.add_argument("-j", "--shell-job", default=False, action='store_true',
 		help="Allow migration of shell jobs")
diff --git a/phaul/iters.py b/phaul/iters.py
index 93fa539..db878c0 100644
--- a/phaul/iters.py
+++ b/phaul/iters.py
@@ -77,6 +77,8 @@ class phaul_iter_worker:
 
 	def set_options(self, opts):
 		self.__force = opts["force"]
+		self.__skip_cpu_check = opts["skip_cpu_check"]
+		self.__skip_criu_check = opts["skip_criu_check"]
 		self.__pre_dump = opts["pre_dump"]
 		self.htype.set_options(opts)
 		self.fs.set_options(opts)
@@ -87,7 +89,7 @@ class phaul_iter_worker:
 		self.target_host.set_options(opts)
 
 	def __validate_cpu(self):
-		if self.__force:
+		if self.__skip_cpu_check or self.__force:
 			return
 		logging.info("Checking CPU compatibility")
 
@@ -109,7 +111,7 @@ class phaul_iter_worker:
 			raise Exception("CPUs mismatch")
 
 	def __validate_criu_version(self):
-		if self.__force:
+		if self.__skip_criu_check or self.__force:
 			return
 		logging.info("Checking criu version")
 		version = criu_api.get_criu_version()
-- 
1.7.1



More information about the CRIU mailing list