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

Adrian Reber adrian at lisas.de
Thu Nov 5 05:54:23 PST 2015


On Thu, Nov 05, 2015 at 03:52:35PM +0300, Pavel Emelyanov wrote:
> On 11/03/2015 01:16 PM, Adrian Reber wrote:
> > 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):
> 
> Ouch. So this is the answer to my question about criu side. Can we better fix criu
> to report ENOTSUP (without minus) so that this place just looks
> 
>    resp.cr_errno == errno.ENOTSUP
> 
> ?

Sure. Patch will soon be on its way.

		Adrian


More information about the CRIU mailing list