mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-18 00:58:31 +00:00
restorer/fault: add fault-injection into restorer
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
parent
9062e59e5e
commit
d4a60bb201
4 changed files with 26 additions and 4 deletions
|
|
@ -3035,6 +3035,7 @@ static int sigreturn_restore(pid_t pid, struct task_restore_args *task_args, uns
|
|||
}
|
||||
|
||||
task_args->breakpoint = &rsti(current)->breakpoint;
|
||||
task_args->fault_strategy = fi_strategy;
|
||||
|
||||
sigemptyset(&blockmask);
|
||||
sigaddset(&blockmask, SIGCHLD);
|
||||
|
|
|
|||
|
|
@ -18,10 +18,7 @@ enum faults {
|
|||
FI_MAX,
|
||||
};
|
||||
|
||||
extern enum faults fi_strategy;
|
||||
extern int fault_injection_init(void);
|
||||
|
||||
static inline bool fault_injected(enum faults f)
|
||||
static inline bool __fault_injected(enum faults f, enum faults fi_strategy)
|
||||
{
|
||||
/*
|
||||
* Temporary workaround for Xen guests. Breakpoints degrade
|
||||
|
|
@ -33,4 +30,18 @@ static inline bool fault_injected(enum faults f)
|
|||
|
||||
return fi_strategy == f;
|
||||
}
|
||||
|
||||
#ifndef CR_NOGLIBC
|
||||
|
||||
extern enum faults fi_strategy;
|
||||
#define fault_injected(f) __fault_injected(f, fi_strategy)
|
||||
|
||||
extern int fault_injection_init(void);
|
||||
|
||||
#else /* CR_NOGLIBC */
|
||||
|
||||
extern bool fault_injected(enum faults f);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
#include "timerfd.h"
|
||||
#include "shmem.h"
|
||||
#include "parasite-vdso.h"
|
||||
#include "fault-injection.h"
|
||||
|
||||
#include <time.h>
|
||||
|
||||
|
|
@ -182,6 +183,8 @@ struct task_restore_args {
|
|||
unsigned long vdso_rt_parked_at; /* safe place to keep vdso */
|
||||
#endif
|
||||
void **breakpoint;
|
||||
|
||||
enum faults fault_strategy;
|
||||
} __aligned(64);
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -61,6 +61,11 @@ static pid_t *helpers;
|
|||
static int n_helpers;
|
||||
static pid_t *zombies;
|
||||
static int n_zombies;
|
||||
static enum faults fi_strategy;
|
||||
bool fault_injected(enum faults f)
|
||||
{
|
||||
return __fault_injected(f, fi_strategy);
|
||||
}
|
||||
|
||||
/*
|
||||
* These are stubs for std compel plugin.
|
||||
|
|
@ -1087,6 +1092,8 @@ long __export_restore_task(struct task_restore_args *args)
|
|||
vdso_rt_size = args->vdso_rt_size;
|
||||
#endif
|
||||
|
||||
fi_strategy = args->fault_strategy;
|
||||
|
||||
task_entries_local = args->task_entries;
|
||||
helpers = args->helpers;
|
||||
n_helpers = args->helpers_n;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue