Commit 1a5a0344 authored by Pavel Emelyanov's avatar Pavel Emelyanov

libcriu: Add add_ext_mount_map call

Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 3f4447d7
......@@ -170,6 +170,41 @@ out:
return -ENOMEM;
}
int criu_add_ext_mount(char *key, char *val)
{
int nr;
ExtMountMap **a, *m;
m = malloc(sizeof(*m));
if (!m)
goto er;
m->key = strdup(key);
if (!m->key)
goto er_n;
m->val = strdup(val);
if (!m->val)
goto er_k;
nr = opts->n_ext_mnt + 1;
a = realloc(opts->ext_mnt, nr * sizeof(m));
if (!a)
goto er_v;
a[nr - 1] = m;
opts->ext_mnt = a;
opts->n_ext_mnt = nr;
return 0;
er_v:
free(m->val);
er_k:
free(m->key);
er_n:
free(m);
er:
return -ENOMEM;
}
static CriuResp *recv_resp(int socket_fd)
{
unsigned char buf[CR_MAX_MSG_SIZE];
......
......@@ -48,6 +48,7 @@ void criu_set_log_file(char *log_file);
void criu_set_cpu_cap(unsigned int cap);
void criu_set_root(char *root);
int criu_set_exec_cmd(int argc, char *argv[]);
int criu_add_ext_mount(char *key, char *val);
/* Here is a table of return values and errno's of functions
* from the list down below.
......
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