mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 02:14:37 +00:00
criu: Fault injection core
This patch(set) is inspired by similar from Andrey Vagin sent sime time earlier. The major idea is to artificially fail criu dump or restore at specific places and let zdtm tests check whether failed dump or restore resulted in anything bad. This particular patch introduces the ability to tell criu "fail at X point". Each point is specified with a integer constant and with the next patches there will appear places over the code checking for specific fail code being set and failing. Two points are introduced -- early on dump, right after loading the parasite and right after creation of the root task. Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
parent
c405304fcc
commit
68baf8e77d
6 changed files with 58 additions and 1 deletions
19
include/fault-injection.h
Normal file
19
include/fault-injection.h
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#ifndef __CR_FAULT_INJECTION_H__
|
||||
#define __CR_FAULT_INJECTION_H__
|
||||
#include <stdbool.h>
|
||||
|
||||
enum faults {
|
||||
FI_NONE = 0,
|
||||
FI_DUMP_EARLY,
|
||||
FI_RESTORE_ROOT_ONLY,
|
||||
FI_MAX,
|
||||
};
|
||||
|
||||
extern enum faults fi_strategy;
|
||||
extern int fault_injection_init(void);
|
||||
|
||||
static inline bool fault_injected(enum faults f)
|
||||
{
|
||||
return fi_strategy == f;
|
||||
}
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue