mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 02:14:37 +00:00
Adding --pre-dump-mode option
Two modes of pre-dump algorithm:
1) splicing memory by parasite
--pre-dump-mode=splice (default)
2) using process_vm_readv syscall
--pre-dump-mode=read
Signed-off-by: Abhishek Dubey <dubeyabhishek777@gmail.com>
Signed-off-by: Andrei Vagin <avagin@gmail.com>
This commit is contained in:
parent
576a99f492
commit
20d4920a8b
10 changed files with 86 additions and 2 deletions
15
lib/c/criu.c
15
lib/c/criu.c
|
|
@ -336,6 +336,21 @@ int criu_set_parent_images(const char *path)
|
|||
return criu_local_set_parent_images(global_opts, path);
|
||||
}
|
||||
|
||||
int criu_local_set_pre_dump_mode(criu_opts *opts, enum criu_pre_dump_mode mode)
|
||||
{
|
||||
opts->rpc->has_pre_dump_mode = true;
|
||||
if (mode == CRIU_PRE_DUMP_SPLICE || mode == CRIU_PRE_DUMP_READ) {
|
||||
opts->rpc->pre_dump_mode = mode;
|
||||
return 0;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
int criu_set_pre_dump_mode(enum criu_pre_dump_mode mode)
|
||||
{
|
||||
return criu_local_set_pre_dump_mode(global_opts, mode);
|
||||
}
|
||||
|
||||
void criu_local_set_track_mem(criu_opts *opts, bool track_mem)
|
||||
{
|
||||
opts->rpc->has_track_mem = true;
|
||||
|
|
|
|||
|
|
@ -43,6 +43,11 @@ enum criu_cg_mode {
|
|||
CRIU_CG_MODE_DEFAULT,
|
||||
};
|
||||
|
||||
enum criu_pre_dump_mode {
|
||||
CRIU_PRE_DUMP_SPLICE = 1,
|
||||
CRIU_PRE_DUMP_READ = 2
|
||||
};
|
||||
|
||||
int criu_set_service_address(const char *path);
|
||||
void criu_set_service_fd(int fd);
|
||||
int criu_set_service_binary(const char *path);
|
||||
|
|
@ -95,6 +100,7 @@ int criu_add_irmap_path(const char *path);
|
|||
int criu_add_inherit_fd(int fd, const char *key);
|
||||
int criu_add_external(const char *key);
|
||||
int criu_set_page_server_address_port(const char *address, int port);
|
||||
int criu_set_pre_dump_mode(enum criu_pre_dump_mode mode);
|
||||
|
||||
/*
|
||||
* The criu_notify_arg_t na argument is an opaque
|
||||
|
|
@ -211,6 +217,7 @@ int criu_local_add_cg_yard(criu_opts *opts, const char *path);
|
|||
int criu_local_add_inherit_fd(criu_opts *opts, int fd, const char *key);
|
||||
int criu_local_add_external(criu_opts *opts, const char *key);
|
||||
int criu_local_set_page_server_address_port(criu_opts *opts, const char *address, int port);
|
||||
int criu_local_set_pre_dump_mode(criu_opts *opts, enum criu_pre_dump_mode mode);
|
||||
|
||||
void criu_local_set_notify_cb(criu_opts *opts, int (*cb)(char *action, criu_notify_arg_t na));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue