Commit f107e8e9 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

dump: Save and remove per-thread argumens in parasite

This patch starts using parasite_init_threads_seized and
parasite_fini_threads_seized helpers to save per-thread
data in parasite and remove it on cure procedure.
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 80928f8c
......@@ -1601,7 +1601,7 @@ static int dump_one_task(struct pstree_item *item)
goto err;
}
ret = parasite_cure_seized(parasite_ctl);
ret = parasite_cure_seized(parasite_ctl, item);
if (ret) {
pr_err("Can't cure (pid: %d) from parasite\n", pid);
goto err;
......@@ -1630,7 +1630,7 @@ err_free:
err_cure:
close_cr_fdset(&cr_fdset);
err_cure_fdset:
parasite_cure_seized(parasite_ctl);
parasite_cure_seized(parasite_ctl, item);
goto err;
}
......
......@@ -45,9 +45,8 @@ extern int parasite_drain_fds_seized(struct parasite_ctl *ctl,
int *lfds, struct fd_opts *flags);
extern int parasite_get_proc_fd_seized(struct parasite_ctl *ctl);
extern int parasite_cure_seized(struct parasite_ctl *ctl);
struct pstree_item;
extern int parasite_cure_seized(struct parasite_ctl *ctl, struct pstree_item *item);
extern struct parasite_ctl *parasite_infect_seized(pid_t pid,
struct pstree_item *item,
struct list_head *vma_area_list);
......
......@@ -726,7 +726,7 @@ int parasite_fini_threads_seized(struct parasite_ctl *ctl, struct pstree_item *i
return ret;
}
int parasite_cure_seized(struct parasite_ctl *ctl)
int parasite_cure_seized(struct parasite_ctl *ctl, struct pstree_item *item)
{
int ret = 0;
......@@ -734,6 +734,7 @@ int parasite_cure_seized(struct parasite_ctl *ctl)
if (ctl->parasite_ip) {
ctl->signals_blocked = 0;
parasite_fini_threads_seized(ctl, item);
parasite_execute(PARASITE_CMD_FINI, ctl);
}
......@@ -865,10 +866,14 @@ struct parasite_ctl *parasite_infect_seized(pid_t pid, struct pstree_item *item,
goto err_restore;
}
ret = parasite_init_threads_seized(ctl, item);
if (ret)
goto err_restore;
return ctl;
err_restore:
parasite_cure_seized(ctl);
parasite_cure_seized(ctl, item);
return NULL;
err:
......
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