Commit 4d80f502 authored by Ruslan Kuprieiev's avatar Ruslan Kuprieiev Committed by Pavel Emelyanov

v2 rpc: add log_file field to opts, add defaults toi log.h and use them where needed

[xemul: Simplified !log_file case and renumbered .proto fields]
Signed-off-by: 's avatarRuslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 99073028
......@@ -111,7 +111,10 @@ static int setup_dump_from_req(int sk, CriuDumpReq *req)
log_closedir();
/* initiate log file in imgs dir */
opts.output = "./dump.log";
if (req->log_file)
opts.output = req->log_file;
else
opts.output = DEFAULT_DUMP_LOG_FILENAME;
log_set_loglevel(req->log_level);
if (log_init(opts.output) == -1) {
......
......@@ -59,4 +59,7 @@ extern int write_pidfile(char *pfname, int pid);
#define pr_perror(fmt, ...) \
pr_err(fmt ": %m\n", ##__VA_ARGS__)
#define DEFAULT_DUMP_LOG_FILENAME "dump.log"
#define DEFAULT_RESTORE_LOG_FILENAME "restore.log"
#endif /* __CR_LOG_H__ */
......@@ -9,6 +9,7 @@ message criu_dump_req {
optional bool shell_job = 7;
optional bool file_locks = 8;
optional int32 log_level = 9 [default = 2];
optional string log_file = 10;
}
message criu_dump_resp {
......
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