2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 06:15:24 +00:00

parasite: Pull cr_options down (or up) to transport sock creation

We'll need to check whether the socket is to be created in a net
namespace (since we can't detect this automatically yet). Thus the
namespaces flags are required there.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Pavel Emelyanov
2012-08-02 07:53:02 +04:00
parent 38431fb161
commit 9eda83b74a
3 changed files with 10 additions and 7 deletions

View File

@@ -1301,7 +1301,7 @@ static int dump_task_threads(struct parasite_ctl *parasite_ctl,
return 0;
}
static int dump_one_task(struct pstree_item *item)
static int dump_one_task(struct pstree_item *item, const struct cr_options *o)
{
pid_t pid = item->pid.real;
LIST_HEAD(vma_area_list);
@@ -1356,7 +1356,7 @@ static int dump_one_task(struct pstree_item *item)
goto err;
}
parasite_ctl = parasite_infect_seized(pid, &vma_area_list);
parasite_ctl = parasite_infect_seized(pid, &vma_area_list, o);
if (!parasite_ctl) {
ret = -1;
pr_err("Can't infect (pid: %d) with parasite\n", pid);
@@ -1488,7 +1488,7 @@ int cr_dump_tasks(pid_t pid, const struct cr_options *opts)
goto err;
for_each_pstree_item(item) {
if (dump_one_task(item))
if (dump_one_task(item, opts))
goto err;
}

View File

@@ -40,7 +40,9 @@ extern int parasite_dump_thread_seized(struct parasite_ctl *ctl, pid_t pid,
extern int parasite_drain_fds_seized(struct parasite_ctl *ctl, int *fds, int *lfds, int nr_fds, char *flags);
extern int parasite_cure_seized(struct parasite_ctl *ctl);
struct cr_options;
extern struct parasite_ctl *parasite_infect_seized(pid_t pid,
struct list_head *vma_area_list);
struct list_head *vma_area_list, const struct cr_options *);
#endif /* PARASITE_SYSCALL_H_ */

View File

@@ -368,7 +368,7 @@ static int parasite_set_logfd(struct parasite_ctl *ctl, pid_t pid)
return 0;
}
static int parasite_init(struct parasite_ctl *ctl, pid_t pid)
static int parasite_init(struct parasite_ctl *ctl, pid_t pid, const struct cr_options *o)
{
struct parasite_init_args args = { };
static int sock = -1;
@@ -657,7 +657,8 @@ int parasite_cure_seized(struct parasite_ctl *ctl)
return ret;
}
struct parasite_ctl *parasite_infect_seized(pid_t pid, struct list_head *vma_area_list)
struct parasite_ctl *parasite_infect_seized(pid_t pid, struct list_head *vma_area_list,
const struct cr_options *o)
{
struct parasite_ctl *ctl = NULL;
struct vma_area *vma_area;
@@ -742,7 +743,7 @@ struct parasite_ctl *parasite_infect_seized(pid_t pid, struct list_head *vma_are
ctl->addr_cmd = (void *)PARASITE_CMD_ADDR((unsigned long)ctl->local_map);
ctl->addr_args = (void *)PARASITE_ARGS_ADDR((unsigned long)ctl->local_map);
ret = parasite_init(ctl, pid);
ret = parasite_init(ctl, pid, o);
if (ret) {
pr_err("%d: Can't create a transport socket\n", pid);
goto err_restore;