Commit a21fdcf9 authored by Mike Rapoport's avatar Mike Rapoport Committed by Pavel Emelyanov

criu: make work_dir part of cr_options

Signed-off-by: 's avatarMike Rapoport <rppt@linux.vnet.ibm.com>
Acked-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent ce4dc617
...@@ -215,7 +215,6 @@ int main(int argc, char *argv[], char *envp[]) ...@@ -215,7 +215,6 @@ int main(int argc, char *argv[], char *envp[])
int opt, idx; int opt, idx;
int log_level = LOG_UNSET; int log_level = LOG_UNSET;
char *imgs_dir = "."; char *imgs_dir = ".";
char *work_dir = NULL;
static const char short_opts[] = "dSsRf:F:t:p:hcD:o:v::x::Vr:jJ:lW:L:M:"; static const char short_opts[] = "dSsRf:F:t:p:hcD:o:v::x::Vr:jJ:lW:L:M:";
static struct option long_opts[] = { static struct option long_opts[] = {
{ "tree", required_argument, 0, 't' }, { "tree", required_argument, 0, 't' },
...@@ -364,7 +363,7 @@ int main(int argc, char *argv[], char *envp[]) ...@@ -364,7 +363,7 @@ int main(int argc, char *argv[], char *envp[])
imgs_dir = optarg; imgs_dir = optarg;
break; break;
case 'W': case 'W':
work_dir = optarg; opts.work_dir = optarg;
break; break;
case 'o': case 'o':
opts.output = optarg; opts.output = optarg;
...@@ -616,8 +615,8 @@ int main(int argc, char *argv[], char *envp[]) ...@@ -616,8 +615,8 @@ int main(int argc, char *argv[], char *envp[])
return 1; return 1;
} }
if (work_dir == NULL) if (opts.work_dir == NULL)
work_dir = imgs_dir; opts.work_dir = imgs_dir;
if (optind >= argc) { if (optind >= argc) {
pr_msg("Error: command is required\n"); pr_msg("Error: command is required\n");
...@@ -654,8 +653,8 @@ int main(int argc, char *argv[], char *envp[]) ...@@ -654,8 +653,8 @@ int main(int argc, char *argv[], char *envp[])
return 1; return 1;
} }
if (chdir(work_dir)) { if (chdir(opts.work_dir)) {
pr_perror("Can't change directory to %s", work_dir); pr_perror("Can't change directory to %s", opts.work_dir);
return 1; return 1;
} }
......
...@@ -110,6 +110,7 @@ struct cr_options { ...@@ -110,6 +110,7 @@ struct cr_options {
unsigned int timeout; unsigned int timeout;
unsigned int empty_ns; unsigned int empty_ns;
bool tcp_skip_in_flight; bool tcp_skip_in_flight;
char *work_dir;
}; };
extern struct cr_options opts; extern struct cr_options opts;
......
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