[CRIU] [PATCH v2 4/4] RPC: Evaluate configuration file before switching to RPC mode
Adrian Reber
adrian at lisas.de
Wed May 9 20:16:50 MSK 2018
From: Adrian Reber <areber at redhat.com>
When CRIU is started in RPC mode ('criu swrk') it used to ignore all
command-line options and configuration files. This moves the jump to RPC
mode after the configuration file parsing to enable configuration.
With this configuration files are now also evaluated in RPC mode and it
is possible to change the behavior of CRIU via the configuration file if
used via RPC.
Signed-off-by: Adrian Reber <areber at redhat.com>
---
criu/crtools.c | 29 +++++++++++++----------------
1 file changed, 13 insertions(+), 16 deletions(-)
diff --git a/criu/crtools.c b/criu/crtools.c
index 4d91e51..5f38cfe 100644
--- a/criu/crtools.c
+++ b/criu/crtools.c
@@ -378,22 +378,6 @@ int main(int argc, char *argv[], char *envp[])
init_opts();
- if (!strcmp(argv[1], "swrk")) {
- if (argc < 3)
- goto usage;
-
- if (early_init())
- return -1;
-
- /*
- * This is to start criu service worker from libcriu calls.
- * The usage is "criu swrk <fd>" and is not for CLI/scripts.
- * The arguments semantics can change at any time with the
- * corresponding lib call change.
- */
- opts.swrk_restore = true;
- return cr_service_work(atoi(argv[2]));
- }
init_config(argc, argv, &first_count, &second_count);
@@ -719,6 +703,19 @@ int main(int argc, char *argv[], char *envp[])
if (early_init())
return -1;
+ if (!strcmp(argv[1], "swrk")) {
+ if (argc < 3)
+ goto usage;
+ /*
+ * This is to start criu service worker from libcriu calls.
+ * The usage is "criu swrk <fd>" and is not for CLI/scripts.
+ * The arguments semantics can change at any time with the
+ * corresponding lib call change.
+ */
+ opts.swrk_restore = true;
+ return cr_service_work(atoi(argv[2]));
+ }
+
if (opts.deprecated_ok)
pr_msg("Turn deprecated stuff ON\n");
if (opts.tcp_skip_in_flight)
--
1.8.3.1
More information about the CRIU
mailing list