Exemple #1
0
    def wait_pid(self, pid):
        req = rpc.criu_req()
        req.type = rpc.WAIT_PID
        req.pid = pid

        resp = self._send_req_and_recv_resp(req)

        if not resp.success:
            raise CRIUExceptionExternal(req.type, resp.type, resp.cr_errno)

        return resp.status
Exemple #2
0
    def check(self):
        """
		Checks whether the kernel support is up-to-date.
		"""
        req = rpc.criu_req()
        req.type = rpc.CHECK

        resp = self._send_req_and_recv_resp(req)

        if not resp.success:
            raise CRIUExceptionExternal(req.type, resp.type, resp.cr_errno)
Exemple #3
0
	def wait_pid(self, pid):
		req		= rpc.criu_req()
		req.type	= rpc.WAIT_PID
		req.pid	 = pid

		resp = self._send_req_and_recv_resp(req)

		if not resp.success:
			raise CRIUExceptionExternal(req.type, resp.type, resp.cr_errno)

		return resp.status
Exemple #4
0
	def check(self):
		"""
		Checks whether the kernel support is up-to-date.
		"""
		req		= rpc.criu_req()
		req.type	= rpc.CHECK

		resp = self._send_req_and_recv_resp(req)

		if not resp.success:
			raise CRIUExceptionExternal(req.type, resp.type, resp.cr_errno)
Exemple #5
0
    def page_server_chld(self):
        req = rpc.criu_req()
        req.type = rpc.PAGE_SERVER_CHLD
        req.opts.MergeFrom(self.opts)
        req.keep_open = True

        resp = self._send_req_and_recv_resp(req)

        if not resp.success:
            raise CRIUExceptionExternal(req.type, resp.type, resp.cr_errno)

        return resp.ps
Exemple #6
0
	def page_server_chld(self):
		req		= rpc.criu_req()
		req.type	= rpc.PAGE_SERVER_CHLD
		req.opts.MergeFrom(self.opts)
		req.keep_open   = True

		resp = self._send_req_and_recv_resp(req)

		if not resp.success:
			raise CRIUExceptionExternal(req.type, resp.type, resp.cr_errno)

		return resp.ps
Exemple #7
0
    def restore(self):
        """
		Restore a process/tree.
		"""
        req = rpc.criu_req()
        req.type = rpc.RESTORE
        req.opts.MergeFrom(self.opts)

        resp = self._send_req_and_recv_resp(req)

        if not resp.success:
            raise CRIUExceptionExternal(req.type, resp.type, resp.cr_errno)

        return resp.restore
Exemple #8
0
    def pre_dump(self):
        """
		Checkpoint a process/tree identified by opts.pid.
		"""
        req = rpc.criu_req()
        req.type = rpc.PRE_DUMP
        req.opts.MergeFrom(self.opts)

        resp = self._send_req_and_recv_resp(req)

        if not resp.success:
            raise CRIUExceptionExternal(req.type, resp.type, resp.cr_errno)

        return resp.dump
Exemple #9
0
	def restore(self):
		"""
		Restore a process/tree.
		"""
		req		= rpc.criu_req()
		req.type	= rpc.RESTORE
		req.opts.MergeFrom(self.opts)

		resp = self._send_req_and_recv_resp(req)

		if not resp.success:
			raise CRIUExceptionExternal(req.type, resp.type, resp.cr_errno)

		return resp.restore
Exemple #10
0
	def pre_dump(self):
		"""
		Checkpoint a process/tree identified by opts.pid.
		"""
		req 		= rpc.criu_req()
		req.type	= rpc.PRE_DUMP
		req.opts.MergeFrom(self.opts)

		resp = self._send_req_and_recv_resp(req)

		if not resp.success:
			raise CRIUExceptionExternal(req.type, resp.type, resp.cr_errno)

		return resp.dump