[CRIU] [PATCHv4 3/4] libcriu: add criu_dump_me() and libcriu header

Pavel Emelyanov xemul at parallels.com
Tue Sep 3 15:00:53 EDT 2013


On 09/03/2013 06:44 PM, Ruslan Kuprieiev wrote:
> criu_dump_me() can be used by program to dump itself.
> Program need to call criu_allocate_args() to prepare arguments and then 
> it can set them using criu_set* functions. criu_set* functions are used 
> instead of give user access to arguments itself, so user will not mess 
> with protobuf. libcriu.h is to be used by user program.
> 
> 
> +	if (send_fd(socket_fd, NULL, 0, args->images_dir_fd) == -1) {
> +		perror("Can't send file descriptor");
> +		return CRIU_DUMP_FAIL;
> +	}

Oh, and one more thing. This args->images_dif_fd is totally useless in the
dump args _if_ we send this fd, since on serivice side, this value would
change.

But, it looks like sending a file descriptor can only easily be done in C
code, but in e.g. Python or Java this is painful, so we probably would have
to reconsider the way we send images dir fd to the service (need more
thinking).




More information about the CRIU mailing list