criu/include/fault-injection.h
Pavel Emelyanov 68baf8e77d 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>
2015-10-19 12:42:29 +03:00

19 lines
326 B
C

#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