mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 06:15:24 +00:00
v2 crtools: init log after changing directory to work_dir
After set of patches which add --work-dir option we have an issue: logs are created relatively to current dir and not relatively to images dir(which is work dir, when --work-dir is not given). To solve this lets init log after chdir(work_dir) Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
486cad37cc
commit
9ccbf1bcc8
16
crtools.c
16
crtools.c
@@ -285,14 +285,6 @@ int main(int argc, char *argv[])
|
||||
if (work_dir == NULL)
|
||||
work_dir = imgs_dir;
|
||||
|
||||
log_set_loglevel(log_level);
|
||||
|
||||
if (log_init(opts.output))
|
||||
return -1;
|
||||
|
||||
if (opts.img_parent)
|
||||
pr_info("Will do snapshot from %s\n", opts.img_parent);
|
||||
|
||||
if (optind >= argc)
|
||||
goto usage;
|
||||
|
||||
@@ -310,6 +302,14 @@ int main(int argc, char *argv[])
|
||||
return -1;
|
||||
}
|
||||
|
||||
log_set_loglevel(log_level);
|
||||
|
||||
if (log_init(opts.output))
|
||||
return -1;
|
||||
|
||||
if (opts.img_parent)
|
||||
pr_info("Will do snapshot from %s\n", opts.img_parent);
|
||||
|
||||
if (!strcmp(argv[optind], "dump")) {
|
||||
if (!tree_id)
|
||||
goto opt_pid_missing;
|
||||
|
Reference in New Issue
Block a user