mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 02:14:37 +00:00
service: add support for the --external option
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
parent
751a4982a9
commit
ef8d4cf285
4 changed files with 22 additions and 9 deletions
|
|
@ -381,6 +381,10 @@ static int setup_opts_from_req(int sk, CriuOpts *req)
|
|||
goto err;
|
||||
}
|
||||
|
||||
for (i = 0; i < req->n_external; i++)
|
||||
if (add_external(req->external[i]))
|
||||
goto err;
|
||||
|
||||
for (i = 0; i < req->n_cg_root; i++) {
|
||||
if (new_cg_root_add(req->cg_root[i]->ctrl,
|
||||
req->cg_root[i]->path))
|
||||
|
|
|
|||
24
crtools.c
24
crtools.c
|
|
@ -193,6 +193,19 @@ static size_t parse_size(char *optarg)
|
|||
return (size_t)atol(optarg);
|
||||
}
|
||||
|
||||
int add_external(char *key)
|
||||
{
|
||||
struct external *ext;
|
||||
|
||||
ext = xmalloc(sizeof(*ext));
|
||||
if (!ext)
|
||||
return -1;
|
||||
ext->id = key;
|
||||
list_add(&ext->node, &opts.external);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[], char *envp[])
|
||||
{
|
||||
pid_t pid = 0, tree_id = 0;
|
||||
|
|
@ -526,15 +539,8 @@ int main(int argc, char *argv[], char *envp[])
|
|||
}
|
||||
break;
|
||||
case 1073:
|
||||
{
|
||||
struct external *ext;
|
||||
|
||||
ext = xmalloc(sizeof(*ext));
|
||||
if (!ext)
|
||||
return 1;
|
||||
ext->id = optarg;
|
||||
list_add(&ext->node, &opts.external);
|
||||
}
|
||||
if (add_external(optarg))
|
||||
return 1;
|
||||
break;
|
||||
case 'V':
|
||||
pr_msg("Version: %s\n", CRIU_VERSION);
|
||||
|
|
|
|||
|
|
@ -112,4 +112,6 @@ extern struct cr_options opts;
|
|||
|
||||
extern void init_opts(void);
|
||||
|
||||
extern int add_external(char *key);
|
||||
|
||||
#endif /* __CR_OPTIONS_H__ */
|
||||
|
|
|
|||
|
|
@ -88,6 +88,7 @@ message criu_opts {
|
|||
optional criu_cg_mode manage_cgroups_mode = 34;
|
||||
optional uint32 ghost_limit = 35 [default = 0x100000];
|
||||
repeated string irmap_scan_paths = 36;
|
||||
repeated string external = 37;
|
||||
}
|
||||
|
||||
message criu_dump_resp {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue