[CRIU] [PATCH 4/5] lib: add check/dump/restore

Pavel Emelyanov xemul at parallels.com
Wed Dec 18 02:25:58 PST 2013


OK, I apply this. Plz, fix one thing on top:

> +/* Here is a table of return values and errno's of functions
> + * from the list down below.
> + *
> + * Return value  errno                Description
> + * ----------------------------------------------------------------------------
> + * 0             0                    Success.
> + *
> + * >0            0                    Success(criu_restore() only).
> + *
> + * -1            0                    RPC has returned fail.

-1 is bad, it's == -EPERM. Let's reshuffle error codes like this:

      0             undefined                success
     >0             undefined                success for criu_restore
     -EBADE         rpc error (if provided, 
                                0 for now)   error in message from service
     -ECONNREFUSED  errno                    unable to connect
     -ECOMM         errno                    error sending message
     -ENODATA       errno                    error receiving responce
     -EBADRQC       0                        invalid message type
     -ENOMSG        0                        unexpected response

> + *
> + * -ECONNREFUSED from failed syscall  Unable to connect to CRIU.
> + *
> + * -ECOMM        from failed syscall  Unable to send/recv msg to/from CRIU.
> + *
> + * -EINVAL       0                    CRIU doesn't support this type of request.
> + *                                    You should probably update CRIU.
> + *
> + * -EBADMSG      0                    Unexpected response from CRIU.
> + *                                    You should probably update CRIU.
> + */
> +int criu_check(void);
> +int criu_dump(void);
> +int criu_restore(void);
> +
> +#endif /* __CRIU_LIB_H__ */
> 




More information about the CRIU mailing list