PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB`  kx]c@sddlZddlZddlZddlZddlZddljZdddYZdefdYZ defdYZ defd YZ d e fd YZ d e fd YZde fdYZdddYZdS(iNt _criu_commcBsDeZdZdZdZdZdZdZdZ dZ dZ RS(s/ Base class for communication classes. iiicCsdS(s Connect to criu and return socket object. daemon -- is for whether or not criu should daemonize if executing criu from binary(comm_bin). N((tselftdaemon((s//usr/lib/python2.7/site-packages/pycriu/criu.pytconnectscCsdS(s' Disconnect from criu. N((R((s//usr/lib/python2.7/site-packages/pycriu/criu.pyt disconnectsN( t__name__t __module__t__doc__tCOMM_SKtCOMM_FDtCOMM_BINtNonet comm_typetcommtskRR(((s//usr/lib/python2.7/site-packages/pycriu/criu.pyR s t _criu_comm_skcBs)eZdZdZdZdZRS(s. Communication class for unix socket. cCs|j|_||_dS(N(RR R (Rtsk_path((s//usr/lib/python2.7/site-packages/pycriu/criu.pyt__init__*s cCs5tjtjtj|_|jj|j|jS(N(tsockettAF_UNIXtSOCK_SEQPACKETRRR (RR((s//usr/lib/python2.7/site-packages/pycriu/criu.pyR.scCs|jjdS(N(Rtclose(R((s//usr/lib/python2.7/site-packages/pycriu/criu.pyR4s(RRRRRR(((s//usr/lib/python2.7/site-packages/pycriu/criu.pyR%s  t _criu_comm_fdcBs)eZdZdZdZdZRS(s2 Communication class for file descriptor. cCs|j|_||_dS(N(R R R (Rtfd((s//usr/lib/python2.7/site-packages/pycriu/criu.pyR=s cCs(tj|jtjtj|_|jS(N(RtfromfdR RRR(RR((s//usr/lib/python2.7/site-packages/pycriu/criu.pyRAscCs|jjdS(N(RR(R((s//usr/lib/python2.7/site-packages/pycriu/criu.pyRGs(RRRRRR(((s//usr/lib/python2.7/site-packages/pycriu/criu.pyR8s  t_criu_comm_bincBs)eZdZdZdZdZRS(s) Communication class for binary. cCs+|j|_||_d|_d|_dS(N(R R R R tswrkR(Rtbin_path((s//usr/lib/python2.7/site-packages/pycriu/criu.pyRPs   csmtjtjtjtjdtj}tjdtj|tjBtjdtj}tjdtj|tj@|_t j }|dkr fd}|rt j }|dkrt j |q t j dq%|n|r%t j |dndjtjddjdd_d_jS(Niicstjdtjdtjddjtjdtjtjjjdddjgtj ddS(NiiitiRs%d( tosRtsendtstructtpacktgetpidtexecvR tfilenot_exit((tcssR(s//usr/lib/python2.7/site-packages/pycriu/criu.pyt exec_criuds   #  Ri(Rt socketpairRRtfcntltF_GETFDtF_SETFDt FD_CLOEXECRRtforktsetsidR$twaitpidRRtunpacktrecvRR(RRtflagstpR&((R%Rs//usr/lib/python2.7/site-packages/pycriu/criu.pyRVs,!"         & cCs0|jj|js,tj|jdndS(Ni(RRRRR.R(R((s//usr/lib/python2.7/site-packages/pycriu/criu.pyRs  (RRRRRR(((s//usr/lib/python2.7/site-packages/pycriu/criu.pyRKs  0t CRIUExceptioncBs#eZdZdZdZdZRS(s? Exception class for handling and storing criu errors. cCs|jS(N(t_str(R((s//usr/lib/python2.7/site-packages/pycriu/criu.pyt__str__sN(RRRR ttypR4R5(((s//usr/lib/python2.7/site-packages/pycriu/criu.pyR3stCRIUExceptionInternalcBseZdZdZRS(sC Exception class for handling and storing internal errors. cCs/||_dtjj|j|f|_dS(Ns!%s failed with internal error: %s(R6trpct criu_req_typetNameR4(RR6ts((s//usr/lib/python2.7/site-packages/pycriu/criu.pyRs (RRRR(((s//usr/lib/python2.7/site-packages/pycriu/criu.pyR7stCRIUExceptionExternalcBs eZdZdZdZRS(sC Exception class for handling and storing criu RPC errors. cCs.||_||_||_|j|_dS(N(R6tresp_typterrnot_gen_error_strR4(Rtreq_typR=R>((s//usr/lib/python2.7/site-packages/pycriu/criu.pyRs   cCsdtjj|jf}|j|jkrE|d|jf7}n|d|jf7}|jtjkrx|d7}n|jtjkr|jtjkr|d7}qn|jtj kr|jtj kr|d7}qn|d7}|S(Ns %s failed: sUnexpected response type %d: s Error(%d): s Bad optionssNo process with such pids)Process with requested pid already existstUnknown( R8R9R:R6R=R>tEBADRQCtDUMPtESRCHtRESTOREtEEXIST(RR;((s//usr/lib/python2.7/site-packages/pycriu/criu.pyR?s  (RRRRR?(((s//usr/lib/python2.7/site-packages/pycriu/criu.pyR<s tcriucBs}eZdZd Zd ZdZdZdZdZ dZ dZ dZ dZ d Zd Zd ZRS( s Call criu through RPC. cCs)|jdtj|_d|_dS(NRG(t use_binaryR8t criu_optstoptsR R(R((s//usr/lib/python2.7/site-packages/pycriu/criu.pyRs cCst||_dS(sZ Access criu using unix socket which that belongs to criu service daemon. N(Rt_comm(Rtsk_name((s//usr/lib/python2.7/site-packages/pycriu/criu.pytuse_skscCst||_dS(s0 Access criu using provided fd. N(RRK(RR((s//usr/lib/python2.7/site-packages/pycriu/criu.pytuse_fdscCst||_dS(sO Access criu by execing it using provided path to criu binary. N(RRK(Rtbin_name((s//usr/lib/python2.7/site-packages/pycriu/criu.pyRHscCst}|jtjkr4|jjd r4t}ny|jsU|jj |}n |j}|j rs||_n|j |j |j t|j dtjtjB}|j s|jjntj}|j|Wn+tk r}t|jt|nX|S(sA As simple as send request and receive response. tpidi(tFalsettypeR8RCRJtHasFieldtTrueRRKRt keep_openRtSerializeToStringR0tlenRt MSG_TRUNCtMSG_PEEKRt criu_resptParseFromStringt ExceptionR7tstr(RtreqRR;tbuftrespte((s//usr/lib/python2.7/site-packages/pycriu/criu.pyt_send_req_and_recv_resps$%     +  cCsRtj}tj|_|j|}|jsNt|j|j|jndS(sB Checks whether the kernel support is up-to-date. N(R8tcriu_reqtCHECKRRRbtsuccessR<tcr_errno(RR^R`((s//usr/lib/python2.7/site-packages/pycriu/criu.pytchecks    cCshtj}tj|_|jj|j|j|}|jsat|j|j|j n|j S(sC Checkpoint a process/tree identified by opts.pid. ( R8RcRCRRRJt MergeFromRbReR<Rftdump(RR^R`((s//usr/lib/python2.7/site-packages/pycriu/criu.pyRis   cCshtj}tj|_|jj|j|j|}|jsat|j|j|j n|j S(sC Checkpoint a process/tree identified by opts.pid. ( R8RctPRE_DUMPRRRJRhRbReR<RfRi(RR^R`((s//usr/lib/python2.7/site-packages/pycriu/criu.pytpre_dump"s   cCshtj}tj|_|jj|j|j|}|jsat|j|j|j n|j S(s) Restore a process/tree. ( R8RcRERRRJRhRbReR<Rftrestore(RR^R`((s//usr/lib/python2.7/site-packages/pycriu/criu.pyRl1s   cCsqtj}tj|_|jj|jt|_|j|}|j sjt |j|j|j n|j S(N( R8RctPAGE_SERVER_CHLDRRRJRhRTRURbReR<Rftps(RR^R`((s//usr/lib/python2.7/site-packages/pycriu/criu.pytpage_server_chld@s    cCs^tj}tj|_||_|j|}|jsWt|j|j|jn|j S(N( R8RctWAIT_PIDRRRPRbReR<Rftstatus(RRPR^R`((s//usr/lib/python2.7/site-packages/pycriu/criu.pytwait_pidMs    N(RRRR RJRKRRMRNRHRbRgRiRkRlRoRr(((s//usr/lib/python2.7/site-packages/pycriu/criu.pyRGs     #    (((RR>R(RRtpycriu.rpc_pb2trpc_pb2R8RRRRR\R3R7R<RG(((s//usr/lib/python2.7/site-packages/pycriu/criu.pyts     A  #