2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 06:15:24 +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:
Ruslan Kuprieiev
2015-05-06 12:22:00 +03:00
committed by Pavel Emelyanov
parent c32add821f
commit 2403ee4695
2 changed files with 64 additions and 0 deletions

View File

@@ -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;