mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-30 22:05:36 +00:00
pagemap-cache: add an ability to run tests without PAGEMAP_SCAN
This change adds a new injectable fault (135) to disable PAGEMAP_SCAN and fault back to read pagemap files. Signed-off-by: Andrei Vagin <avagin@gmail.com>
This commit is contained in:
@@ -19,6 +19,7 @@ enum faults {
|
||||
FI_HUGE_ANON_SHMEM_ID = 132,
|
||||
FI_CANNOT_MAP_VDSO = 133,
|
||||
FI_CORRUPT_EXTREGS = 134,
|
||||
FI_DONT_USE_PAGEMAP_SCAN = 135,
|
||||
FI_MAX,
|
||||
};
|
||||
|
||||
|
@@ -11,6 +11,7 @@
|
||||
#include "vma.h"
|
||||
#include "mem.h"
|
||||
#include "kerndat.h"
|
||||
#include "fault-injection.h"
|
||||
|
||||
#undef LOG_PREFIX
|
||||
#define LOG_PREFIX "pagemap-cache: "
|
||||
@@ -61,7 +62,7 @@ int pmc_init(pmc_t *pmc, pid_t pid, const struct list_head *vma_head, size_t siz
|
||||
pmc->regs = NULL;
|
||||
pmc->map = NULL;
|
||||
|
||||
if (kdat.has_pagemap_scan) {
|
||||
if (kdat.has_pagemap_scan && !fault_injected(FI_DONT_USE_PAGEMAP_SCAN)) {
|
||||
pmc->regs = xmalloc(pmc->regs_max_len * sizeof(struct page_region));
|
||||
if (!pmc->regs)
|
||||
goto err;
|
||||
|
Reference in New Issue
Block a user