mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 14:25:49 +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)
|
if (work_dir == NULL)
|
||||||
work_dir = imgs_dir;
|
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)
|
if (optind >= argc)
|
||||||
goto usage;
|
goto usage;
|
||||||
|
|
||||||
@@ -310,6 +302,14 @@ int main(int argc, char *argv[])
|
|||||||
return -1;
|
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 (!strcmp(argv[optind], "dump")) {
|
||||||
if (!tree_id)
|
if (!tree_id)
|
||||||
goto opt_pid_missing;
|
goto opt_pid_missing;
|
||||||
|
Reference in New Issue
Block a user