[CRIU] [PATCH 3/3] libcriu: allow user to specify service fd
Ruslan Kuprieiev
kupruser at gmail.com
Thu Jul 16 04:46:59 PDT 2015
On 07/16/2015 02:32 PM, Pavel Emelyanov wrote:
>> @@ -122,12 +134,21 @@ int criu_dump_iters(int (*more)(criu_predump_info pi));
>> */
>>
>> typedef struct {
>> - CriuOpts *rpc; /* Generic RPC options in protobuf format */
>> - int (*notify)(char *action, criu_notify_arg_t na);
>> + CriuOpts *rpc; /* Generic RPC options in protobuf format */
>> + int (*notify)(char *action, criu_notify_arg_t na);
>> + enum criu_service_comm service_comm;
>> + char *service_address;
>> + int service_fd;
> 3 fields is overkill :) Just put -1 into service_fd if it's not initialized
> and NULL in _address and check them.
I did that because of my next patch(didn't send it yet) implementing
swrk call for users
that don't want to keep criu service running. There, we will have
CRIU_COMM_SWRK to
indicate that. And overall current implementation is quite flexible and
just looks much
more convenient than NULL and -1 checking.
>> } criu_opts;
>>
>> int criu_local_init_opts(criu_opts **opts);
>>
>> +void criu_local_set_service_address(criu_opts *opts, char *path);
>> +void criu_local_set_service_fd(criu_opts *opts, int fd);
>> +void criu_local_set_service_comm(criu_opts *opts, enum criu_service_comm);
>> +
>> +void criu_local_set_service_fd(criu_opts *opts, int fd);
>> +
>> void criu_local_set_pid(criu_opts *opts, int pid);
>> void criu_local_set_images_dir_fd(criu_opts *opts, int fd); /* must be set for dump/restore */
>> void criu_local_set_parent_images(criu_opts *opts, char *path);
>>
> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://lists.openvz.org/mailman/listinfo/criu
More information about the CRIU
mailing list