mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-17 16:47:50 +00:00
check: Introduce --ms option
This option skips checking for features, that are known to be absent in mainstream kernel. Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
parent
8201e08081
commit
379abca968
4 changed files with 23 additions and 2 deletions
12
cr-check.c
12
cr-check.c
|
|
@ -459,6 +459,11 @@ int check_ptrace_peeksiginfo()
|
|||
siginfo_t siginfo;
|
||||
pid_t pid, ret = 0;
|
||||
|
||||
if (opts.check_ms_kernel) {
|
||||
pr_warn("Skipping peeking siginfos check (not yet merged)\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
pid = fork();
|
||||
if (pid < 0)
|
||||
pr_perror("fork");
|
||||
|
|
@ -489,11 +494,16 @@ int check_ptrace_peeksiginfo()
|
|||
|
||||
static int check_mem_dirty_track(void)
|
||||
{
|
||||
if (opts.check_ms_kernel) {
|
||||
pr_warn("Skipping dirty tracking check (not yet merged)\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (kerndat_get_dirty_track() < 0)
|
||||
return -1;
|
||||
|
||||
if (!kerndat_has_dirty_track)
|
||||
pr_info("Dirty tracking is OFF. Memory snapshot will not work.\n");
|
||||
pr_warn("Dirty tracking is OFF. Memory snapshot will not work.\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -114,6 +114,7 @@ int main(int argc, char *argv[])
|
|||
{ "address", required_argument, 0, 51},
|
||||
{ "port", required_argument, 0, 52},
|
||||
{ "snapshot", optional_argument, 0, 53},
|
||||
{ "ms", no_argument, 0, 54},
|
||||
{ },
|
||||
};
|
||||
|
||||
|
|
@ -264,6 +265,9 @@ int main(int argc, char *argv[])
|
|||
opts.mem_snapshot = true;
|
||||
opts.snap_parent = optarg;
|
||||
break;
|
||||
case 54:
|
||||
opts.check_ms_kernel = true;
|
||||
break;
|
||||
case 'V':
|
||||
pr_msg("Version: %s\n", version);
|
||||
return 0;
|
||||
|
|
@ -413,6 +417,7 @@ usage:
|
|||
pr_msg("\nOther options:\n");
|
||||
pr_msg(" -h|--help show this text\n");
|
||||
pr_msg(" -V|--version show version\n");
|
||||
pr_msg(" --ms don't check not yet merged kernel features\n");
|
||||
|
||||
return -1;
|
||||
|
||||
|
|
|
|||
|
|
@ -100,6 +100,7 @@ struct script {
|
|||
struct cr_options {
|
||||
int final_state;
|
||||
char *show_dump_file;
|
||||
bool check_ms_kernel;
|
||||
bool show_pages_content;
|
||||
bool restore_detach;
|
||||
bool ext_unix_sk;
|
||||
|
|
|
|||
|
|
@ -612,6 +612,11 @@ int collect_sockets(int pid)
|
|||
err = tmp;
|
||||
}
|
||||
|
||||
if (pid == 0 && opts.check_ms_kernel) {
|
||||
pr_warn("Skipping netling diag check (not yet merged)\n");
|
||||
goto skip;
|
||||
}
|
||||
|
||||
req.r.n.sdiag_family = AF_NETLINK;
|
||||
req.r.n.sdiag_protocol = NDIAG_PROTO_ALL;
|
||||
req.r.n.ndiag_show = NDIAG_SHOW_GROUPS;
|
||||
|
|
@ -621,7 +626,7 @@ int collect_sockets(int pid)
|
|||
if (pid == 0 || tmp != -ENOENT) /* Going to be in 3.10 */
|
||||
err = tmp;
|
||||
}
|
||||
|
||||
skip:
|
||||
close(nl);
|
||||
out:
|
||||
if (rst >= 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue