2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-29 05:18:00 +00:00

fault: add dump pages fault for parasite_dump_pages_seized

Parasite should cleanup after fauilure and remove read-protection
from VMAs. Check it with maps00 test & fault injection.

Tested on travis with some addition:
python test/zdtm.py run -t zdtm/static/maps00 --fault 3 --keep-going --report report -f h || false
https://travis-ci.org/0x7f454c46/criu/jobs/119252291

Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
Dmitry Safonov 2016-03-29 17:21:00 +03:00 committed by Pavel Emelyanov
parent 058808007b
commit 35f209ff76
3 changed files with 13 additions and 1 deletions

View File

@ -6,6 +6,7 @@ enum faults {
FI_NONE = 0,
FI_DUMP_EARLY,
FI_RESTORE_ROOT_ONLY,
FI_DUMP_PAGES,
/* not fatal */
FI_CHECK_OPEN_HANDLE = 128,
FI_NO_MEMFD = 129,

View File

@ -20,6 +20,7 @@
#include "restorer.h"
#include "files-reg.h"
#include "pagemap-cache.h"
#include "fault-injection.h"
#include "protobuf.h"
#include "images/pagemap.pb-c.h"
@ -370,9 +371,18 @@ int parasite_dump_pages_seized(struct parasite_ctl *ctl,
return ret;
}
if (fault_injected(FI_DUMP_PAGES)) {
pr_err("fault: Dump VMA pages failure!\n");
return -1;
}
ret = __parasite_dump_pages_seized(ctl, pargs, vma_area_list, pp);
if (ret)
if (ret) {
pr_err("Can't dump page with parasite\n");
/* Parasite will unprotect VMAs after fail in fini() */
return ret;
}
pargs->add_prot = 0;
if (parasite_execute_daemon(PARASITE_CMD_MPROTECT_VMAS, ctl)) {

View File

@ -4,5 +4,6 @@ source `dirname $0`/criu-lib.sh
prep
./test/zdtm.py run -t zdtm/static/env00 --fault 1 --keep-going --report report -f h || fail
./test/zdtm.py run -t zdtm/static/unlink_fstat00 --fault 2 --keep-going --report report -f h || fail
./test/zdtm.py run -t zdtm/static/maps00 --fault 3 --keep-going --report report -f h || fail
./test/zdtm.py run -t zdtm/static/inotify_irmap --fault 128 --keep-going --pre 2 -f uns || fail
./test/zdtm.py run -t zdtm/static/env00 --fault 129 -f uns || fail