[CRIU] [PATCH 4/4] p.haul: check if cpuinfo dumping is actually supported

Adrian Reber adrian at lisas.de
Tue Nov 3 02:16:42 PST 2015


From: Adrian Reber <areber at redhat.com>

For criu architectures which do not have cpuinfo dumping
and checking supported newer criu versions return -ENOTSUP
in the optional cr_errno field. Check if it is set and disable cpuinfo
dumping and checking if it is not supported.

Signed-off-by: Adrian Reber <areber at redhat.com>
---
 phaul/iters.py | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/phaul/iters.py b/phaul/iters.py
index a578078..c3e9f0a 100644
--- a/phaul/iters.py
+++ b/phaul/iters.py
@@ -10,6 +10,7 @@ import pycriu
 import criu_api
 import criu_req
 import htype
+import errno
 
 PRE_DUMP_AUTO_DETECT = None
 PRE_DUMP_DISABLE = False
@@ -64,11 +65,17 @@ class phaul_iter_worker:
 		self.pre_dump = opts["pre_dump"]
 
 	def validate_cpu(self):
+		if self.__force:
+			return
 		logging.info("Checking CPU compatibility")
 
 		logging.info("\t`- Dumping CPU info")
 		req = criu_req.make_cpuinfo_dump_req(self.img)
 		resp = self.criu_connection.send_req(req)
+		if resp.HasField('cr_errno') and (resp.cr_errno == -errno.ENOTSUP & 0xff):
+			logging.info("\t`- Dumping CPU info not supported")
+			self.__force = True
+			return
 		if not resp.success:
 			raise Exception("Can't dump cpuinfo")
 
@@ -102,8 +109,7 @@ class phaul_iter_worker:
 
 		migration_stats.start()
 
-		if not self.__force:
-			self.validate_cpu()
+		self.validate_cpu()
 
 		logging.info("Preliminary FS migration")
 		self.fs.set_work_dir(self.img.work_dir())
-- 
1.8.3.1



More information about the CRIU mailing list