Commit fc33d333 authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by Andrei Vagin

criu: Move mod preload into kdat

Modules pre-load is also slow, but guarding this code with
the presence of criu.kdat cache file seems reasonable.

Or course, one may unload the needed modules by hands, but
such smart user may as well remove the /run/criu.kdat file :)
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 07a00662
...@@ -25,11 +25,9 @@ ...@@ -25,11 +25,9 @@
#include "crtools.h" #include "crtools.h"
#include "cr_options.h" #include "cr_options.h"
#include "external.h" #include "external.h"
#include "sockets.h"
#include "files.h" #include "files.h"
#include "sk-inet.h" #include "sk-inet.h"
#include "net.h" #include "net.h"
#include "netfilter.h"
#include "version.h" #include "version.h"
#include "page-xfer.h" #include "page-xfer.h"
#include "tty.h" #include "tty.h"
...@@ -700,9 +698,6 @@ int main(int argc, char *argv[], char *envp[]) ...@@ -700,9 +698,6 @@ int main(int argc, char *argv[], char *envp[])
pr_info("Will do snapshot from %s\n", opts.img_parent); pr_info("Will do snapshot from %s\n", opts.img_parent);
if (!strcmp(argv[optind], "dump")) { if (!strcmp(argv[optind], "dump")) {
preload_socket_modules();
preload_netfilter_modules();
if (!tree_id) if (!tree_id)
goto opt_pid_missing; goto opt_pid_missing;
return cr_dump_tasks(tree_id); return cr_dump_tasks(tree_id);
...@@ -716,7 +711,6 @@ int main(int argc, char *argv[], char *envp[]) ...@@ -716,7 +711,6 @@ int main(int argc, char *argv[], char *envp[])
} }
if (!strcmp(argv[optind], "restore")) { if (!strcmp(argv[optind], "restore")) {
preload_netfilter_modules();
if (tree_id) if (tree_id)
pr_warn("Using -t with criu restore is obsoleted\n"); pr_warn("Using -t with criu restore is obsoleted\n");
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include "sk-inet.h" #include "sk-inet.h"
#include <compel/plugins/std/syscall-codes.h> #include <compel/plugins/std/syscall-codes.h>
#include <compel/compel.h> #include <compel/compel.h>
#include "netfilter.h"
struct kerndat_s kdat = { struct kerndat_s kdat = {
}; };
...@@ -647,6 +648,9 @@ int kerndat_init(void) ...@@ -647,6 +648,9 @@ int kerndat_init(void)
if (ret <= 0) if (ret <= 0)
return ret; return ret;
preload_socket_modules();
preload_netfilter_modules();
ret = check_pagemap(); ret = check_pagemap();
if (!ret) if (!ret)
ret = kerndat_get_shmemdev(); ret = kerndat_get_shmemdev();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment