mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-02 07:15:31 +00:00
compel: Add compel_run_at helper
Simply run tracee from specfied IP assuming it's arelady have trapping instruction in stream. It's unsafe low-level function use with caution. travis-ci: success for compel: A fix and new helper Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
committed by
Andrei Vagin
parent
d4c02f2eb1
commit
403c96ad17
@@ -73,6 +73,7 @@ extern int compel_syscall(struct parasite_ctl *ctl, int nr, unsigned long *ret,
|
|||||||
unsigned long arg5,
|
unsigned long arg5,
|
||||||
unsigned long arg6);
|
unsigned long arg6);
|
||||||
extern int compel_run_in_thread(struct parasite_thread_ctl *tctl, unsigned int cmd);
|
extern int compel_run_in_thread(struct parasite_thread_ctl *tctl, unsigned int cmd);
|
||||||
|
extern int compel_run_at(struct parasite_ctl *ctl, unsigned long ip, user_regs_struct_t *ret_regs);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The PTRACE_SYSCALL will trap task twice -- on
|
* The PTRACE_SYSCALL will trap task twice -- on
|
||||||
|
@@ -590,6 +590,17 @@ int compel_execute_syscall(struct parasite_ctl *ctl,
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int compel_run_at(struct parasite_ctl *ctl, unsigned long ip, user_regs_struct_t *ret_regs)
|
||||||
|
{
|
||||||
|
user_regs_struct_t regs = ctl->orig.regs;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
ret = parasite_run(ctl->rpid, PTRACE_CONT, ip, 0, ®s, &ctl->orig);
|
||||||
|
if (!ret)
|
||||||
|
ret = parasite_trap(ctl, ctl->rpid, ret_regs ? ret_regs : ®s, &ctl->orig);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
static int accept_tsock(struct parasite_ctl *ctl)
|
static int accept_tsock(struct parasite_ctl *ctl)
|
||||||
{
|
{
|
||||||
int sock;
|
int sock;
|
||||||
|
Reference in New Issue
Block a user