[CRIU] [PATCH] RPC: fix wrong log_level handling

Adrian Reber adrian at lisas.de
Thu Sep 6 12:27:43 MSK 2018


From: Adrian Reber <areber at redhat.com>

In RPC mode the log_level was always reset to the default log level of 2, if no
configuration file was used.

This saves the log level set via RPC in opts.log_level and a configuration file
can overwrite it later, but if it is only set via RPC this value is not ignored
now.

Signed-off-by: Adrian Reber <areber at redhat.com>
---
 criu/cr-service.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/criu/cr-service.c b/criu/cr-service.c
index 643aba9cf..d7f12b9c0 100644
--- a/criu/cr-service.c
+++ b/criu/cr-service.c
@@ -363,6 +363,8 @@ static int setup_opts_from_req(int sk, CriuOpts *req)
 		SET_CHAR_OPTS(output, DEFAULT_LOG_FILENAME);
 	}
 
+	/* This is needed later to correctly set the log_level */
+	opts.log_level = req->log_level;
 	log_set_loglevel(req->log_level);
 	if (log_init(opts.output) == -1) {
 		pr_perror("Can't initiate log");
-- 
2.17.1



More information about the CRIU mailing list