Commit cfc980c6 authored by Mike Rapoport's avatar Mike Rapoport Committed by Andrei Vagin

kdat: move kerndat initialization to the very beginning

With kdat cache and unified kerndat_init() we can call it very early in
crtools and then kdat information will be available for all cr-* actions.
Signed-off-by: 's avatarMike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 830dd301
...@@ -1553,9 +1553,6 @@ int cr_pre_dump_tasks(pid_t pid) ...@@ -1553,9 +1553,6 @@ int cr_pre_dump_tasks(pid_t pid)
if (cr_plugin_init(CR_PLUGIN_STAGE__PRE_DUMP)) if (cr_plugin_init(CR_PLUGIN_STAGE__PRE_DUMP))
goto err; goto err;
if (kerndat_init())
goto err;
if (lsm_check_opts()) if (lsm_check_opts())
goto err; goto err;
...@@ -1732,9 +1729,6 @@ int cr_dump_tasks(pid_t pid) ...@@ -1732,9 +1729,6 @@ int cr_dump_tasks(pid_t pid)
if (cr_plugin_init(CR_PLUGIN_STAGE__DUMP)) if (cr_plugin_init(CR_PLUGIN_STAGE__DUMP))
goto err; goto err;
if (kerndat_init())
goto err;
if (lsm_check_opts()) if (lsm_check_opts())
goto err; goto err;
......
...@@ -2197,9 +2197,6 @@ int cr_restore_tasks(void) ...@@ -2197,9 +2197,6 @@ int cr_restore_tasks(void)
if (init_stats(RESTORE_STATS)) if (init_stats(RESTORE_STATS))
goto err; goto err;
if (kerndat_init())
goto err;
if (lsm_check_opts()) if (lsm_check_opts())
goto err; goto err;
......
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
#include "fault-injection.h" #include "fault-injection.h"
#include "lsm.h" #include "lsm.h"
#include "proc_parse.h" #include "proc_parse.h"
#include "kerndat.h"
#include "setproctitle.h" #include "setproctitle.h"
#include "sysctl.h" #include "sysctl.h"
...@@ -316,6 +317,9 @@ int main(int argc, char *argv[], char *envp[]) ...@@ -316,6 +317,9 @@ int main(int argc, char *argv[], char *envp[])
if (init_service_fd()) if (init_service_fd())
return 1; return 1;
if (kerndat_init())
return 1;
if (!strcmp(argv[1], "swrk")) { if (!strcmp(argv[1], "swrk")) {
if (argc < 3) if (argc < 3)
goto usage; goto usage;
......
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