From f638b6c1215204f72304ddc462de6a27fec295f9 Mon Sep 17 00:00:00 2001 From: Andrei Vagin Date: Thu, 12 Sep 2024 11:17:56 -0700 Subject: [PATCH] fault: allow to check dont_use_freeze_cgroup Adds a new "fault" to call dont_use_freeze_cgroup. --- criu/fault-injection.c | 9 +++++++++ criu/include/fault-injection.h | 1 + criu/include/seize.h | 1 + test/jenkins/criu-fault.sh | 6 ++++++ 4 files changed, 17 insertions(+) diff --git a/criu/fault-injection.c b/criu/fault-injection.c index 83dc1fc8d6..2272e6d842 100644 --- a/criu/fault-injection.c +++ b/criu/fault-injection.c @@ -1,6 +1,7 @@ #include #include "criu-log.h" #include "fault-injection.h" +#include "seize.h" enum faults fi_strategy; @@ -21,5 +22,13 @@ int fault_injection_init(void) } fi_strategy = start; + + switch (fi_strategy) { + case FI_DISABLE_FREEZE_CGROUP: + dont_use_freeze_cgroup(); + break; + default: + break; + }; return 0; } diff --git a/criu/include/fault-injection.h b/criu/include/fault-injection.h index 552ee43389..82c3a1f7fc 100644 --- a/criu/include/fault-injection.h +++ b/criu/include/fault-injection.h @@ -21,6 +21,7 @@ enum faults { FI_CORRUPT_EXTREGS = 134, FI_DONT_USE_PAGEMAP_SCAN = 135, FI_DUMP_CRASH = 136, + FI_DISABLE_FREEZE_CGROUP = 137, FI_MAX, }; diff --git a/criu/include/seize.h b/criu/include/seize.h index 3225029dd3..f5ea76b16c 100644 --- a/criu/include/seize.h +++ b/criu/include/seize.h @@ -2,6 +2,7 @@ #define __CR_SEIZE_H__ extern int collect_pstree(void); +struct pstree_item; extern void pstree_switch_state(struct pstree_item *root_item, int st); extern const char *get_real_freezer_state(void); extern bool alarm_timeouted(void); diff --git a/test/jenkins/criu-fault.sh b/test/jenkins/criu-fault.sh index 1fda40a969..203cb07289 100755 --- a/test/jenkins/criu-fault.sh +++ b/test/jenkins/criu-fault.sh @@ -40,6 +40,12 @@ fi # also check for the main thread corruption ./test/zdtm.py run -t zdtm/static/fpu00 --fault 134 -f h --norst || fail +# check dont_use_freeze_cgroup +./test/zdtm.py run -t zdtm/static/env00 --freezecg zdtm:t --fault 137 +./test/zdtm.py run -t zdtm/static/env00 --freezecg zdtm:f --fault 137 +./test/zdtm.py run -t zdtm/static/env00 --freezecg zdtm:t --fault 137 --norst +./test/zdtm.py run -t zdtm/static/env00 --freezecg zdtm:f --fault 137 --norst + if ./test/zdtm.py run -t zdtm/static/vfork00 --fault 136 --report report -f h ; then fail fi