Commit 2403ee46 authored by Ruslan Kuprieiev's avatar Ruslan Kuprieiev Committed by Pavel Emelyanov

libcriu: add skip_mnt and enable_fs support

Signed-off-by: 's avatarRuslan Kuprieiev <rkuprieiev@cloudlinux.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent c32add82
...@@ -328,6 +328,68 @@ er: ...@@ -328,6 +328,68 @@ er:
return -ENOMEM; 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) static CriuResp *recv_resp(int socket_fd)
{ {
unsigned char *buf; unsigned char *buf;
......
...@@ -55,6 +55,8 @@ int criu_set_exec_cmd(int argc, char *argv[]); ...@@ -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_ext_mount(char *key, char *val);
int criu_add_veth_pair(char *in, char *out); int criu_add_veth_pair(char *in, char *out);
int criu_add_cg_root(char *ctrl, char *path); 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 * The criu_notify_arg_t na argument is an opaque
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment