mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-01 06:45:35 +00:00
libcriu: add skip_mnt and enable_fs support
Signed-off-by: Ruslan Kuprieiev <rkuprieiev@cloudlinux.com> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
c32add821f
commit
2403ee4695
62
lib/criu.c
62
lib/criu.c
@@ -328,6 +328,68 @@ er:
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
int criu_add_enable_fs(char *fs)
|
||||
{
|
||||
int nr;
|
||||
char *str = NULL;
|
||||
char **ptr = NULL;
|
||||
|
||||
str = strdup(fs);
|
||||
if (!str)
|
||||
goto err;
|
||||
|
||||
nr = opts->n_enable_fs + 1;
|
||||
ptr = realloc(opts->enable_fs, nr * sizeof(*ptr));
|
||||
if (!ptr)
|
||||
goto err;
|
||||
|
||||
ptr[nr - 1] = str;
|
||||
|
||||
opts->n_enable_fs = nr;
|
||||
opts->enable_fs = ptr;
|
||||
|
||||
return 0;
|
||||
|
||||
err:
|
||||
if (str)
|
||||
free(str);
|
||||
if (ptr)
|
||||
free(ptr);
|
||||
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
int criu_add_skip_mnt(char *mnt)
|
||||
{
|
||||
int nr;
|
||||
char *str = NULL;
|
||||
char **ptr = NULL;
|
||||
|
||||
str = strdup(mnt);
|
||||
if (!str)
|
||||
goto err;
|
||||
|
||||
nr = opts->n_skip_mnt + 1;
|
||||
ptr = realloc(opts->skip_mnt, nr * sizeof(*ptr));
|
||||
if (!ptr)
|
||||
goto err;
|
||||
|
||||
ptr[nr - 1] = str;
|
||||
|
||||
opts->n_skip_mnt = nr;
|
||||
opts->skip_mnt = ptr;
|
||||
|
||||
return 0;
|
||||
|
||||
err:
|
||||
if (str)
|
||||
free(str);
|
||||
if (ptr)
|
||||
free(ptr);
|
||||
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
static CriuResp *recv_resp(int socket_fd)
|
||||
{
|
||||
unsigned char *buf;
|
||||
|
@@ -55,6 +55,8 @@ int criu_set_exec_cmd(int argc, char *argv[]);
|
||||
int criu_add_ext_mount(char *key, char *val);
|
||||
int criu_add_veth_pair(char *in, char *out);
|
||||
int criu_add_cg_root(char *ctrl, char *path);
|
||||
int criu_add_enable_fs(char *fs);
|
||||
int criu_add_skip_mnt(char *mnt);
|
||||
|
||||
/*
|
||||
* The criu_notify_arg_t na argument is an opaque
|
||||
|
Reference in New Issue
Block a user