Commit 6118210e by Wolfgang Bumiller

tools: set configfile after load_config

In order to cause c->is_defined() to become true. Signed-off-by: 's avatarWolfgang Bumiller <w.bumiller@proxmox.com>
parent 50b737a3
...@@ -385,6 +385,12 @@ int main(int argc, char *argv[]) ...@@ -385,6 +385,12 @@ int main(int argc, char *argv[])
lxc_container_put(c); lxc_container_put(c);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
c->configfile = strdup(my_args.rcfile);
if (!c->configfile) {
ERROR("Out of memory setting new config filename");
lxc_container_put(c);
exit(EXIT_FAILURE);
}
} }
if (!c->may_control(c)) { if (!c->may_control(c)) {
......
...@@ -92,6 +92,12 @@ int main(int argc, char *argv[]) ...@@ -92,6 +92,12 @@ int main(int argc, char *argv[])
lxc_container_put(c); lxc_container_put(c);
return 1; return 1;
} }
c->configfile = strdup(my_args.rcfile);
if (!c->configfile) {
ERROR("Out of memory setting new config filename");
lxc_container_put(c);
return 1;
}
} }
if (!c->may_control(c)) { if (!c->may_control(c)) {
......
...@@ -222,6 +222,12 @@ int main(int argc, char *argv[]) ...@@ -222,6 +222,12 @@ int main(int argc, char *argv[])
lxc_container_put(c); lxc_container_put(c);
exit(1); exit(1);
} }
c->configfile = strdup(my_args.rcfile);
if (!c->configfile) {
fprintf(stderr, "Out of memory setting new config filename\n");
lxc_container_put(c);
exit(1);
}
} }
if (!c->may_control(c)) { if (!c->may_control(c)) {
......
...@@ -120,6 +120,12 @@ int main(int argc, char *argv[]) ...@@ -120,6 +120,12 @@ int main(int argc, char *argv[])
lxc_container_put(c); lxc_container_put(c);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
c->configfile = strdup(my_args.rcfile);
if (!c->configfile) {
fprintf(stderr, "Out of memory setting new config filename\n");
lxc_container_put(c);
exit(EXIT_FAILURE);
}
} }
if (!c->may_control(c)) { if (!c->may_control(c)) {
......
...@@ -217,6 +217,11 @@ int main(int argc, char *argv[]) ...@@ -217,6 +217,11 @@ int main(int argc, char *argv[])
fprintf(stderr, "Failed to load rcfile\n"); fprintf(stderr, "Failed to load rcfile\n");
goto out; goto out;
} }
c->configfile = strdup(my_args.rcfile);
if (!c->configfile) {
fprintf(stderr, "Out of memory setting new config filename\n");
goto out;
}
} }
if (!c->may_control(c)) { if (!c->may_control(c)) {
......
...@@ -96,6 +96,12 @@ int main(int argc, char *argv[]) ...@@ -96,6 +96,12 @@ int main(int argc, char *argv[])
lxc_container_put(c); lxc_container_put(c);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
c->configfile = strdup(my_args.rcfile);
if (!c->configfile) {
fprintf(stderr, "Out of memory setting new config filename\n");
lxc_container_put(c);
exit(EXIT_FAILURE);
}
} }
if (!c->may_control(c)) { if (!c->may_control(c)) {
......
...@@ -132,6 +132,11 @@ int main(int argc, char *argv[]) ...@@ -132,6 +132,11 @@ int main(int argc, char *argv[])
ERROR("Failed to load rcfile"); ERROR("Failed to load rcfile");
goto err1; goto err1;
} }
c->configfile = strdup(my_args.rcfile);
if (!c->configfile) {
ERROR("Out of memory setting new config filename");
goto err1;
}
} }
if (!c->is_running(c)) { if (!c->is_running(c)) {
......
...@@ -82,6 +82,12 @@ int main(int argc, char *argv[]) ...@@ -82,6 +82,12 @@ int main(int argc, char *argv[])
lxc_container_put(c); lxc_container_put(c);
exit(1); exit(1);
} }
c->configfile = strdup(my_args.rcfile);
if (!c->configfile) {
ERROR("Out of memory setting new config filename");
lxc_container_put(c);
exit(1);
}
} }
if (!c->may_control(c)) { if (!c->may_control(c)) {
......
...@@ -303,6 +303,12 @@ static int print_info(const char *name, const char *lxcpath) ...@@ -303,6 +303,12 @@ static int print_info(const char *name, const char *lxcpath)
lxc_container_put(c); lxc_container_put(c);
return -1; return -1;
} }
c->configfile = strdup(my_args.rcfile);
if (!c->configfile) {
fprintf(stderr, "Out of memory setting new config filename\n");
lxc_container_put(c);
return -1;
}
} }
if (!c->may_control(c)) { if (!c->may_control(c)) {
......
...@@ -115,6 +115,12 @@ int main(int argc, char *argv[]) ...@@ -115,6 +115,12 @@ int main(int argc, char *argv[])
lxc_container_put(c); lxc_container_put(c);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
c->configfile = strdup(my_args.rcfile);
if (!c->configfile) {
fprintf(stderr, "Out of memory setting new config filename\n");
lxc_container_put(c);
exit(EXIT_FAILURE);
}
} }
if (!c->may_control(c)) { if (!c->may_control(c)) {
......
...@@ -210,6 +210,11 @@ int main(int argc, char *argv[]) ...@@ -210,6 +210,11 @@ int main(int argc, char *argv[])
fprintf(stderr, "Failed to load rcfile\n"); fprintf(stderr, "Failed to load rcfile\n");
goto out; goto out;
} }
c->configfile = strdup(my_args.rcfile);
if (!c->configfile) {
fprintf(stderr, "Out of memory setting new config filename\n");
goto out;
}
} }
if (!c->may_control(c)) { if (!c->may_control(c)) {
......
...@@ -86,6 +86,12 @@ int main(int argc, char *argv[]) ...@@ -86,6 +86,12 @@ int main(int argc, char *argv[])
lxc_container_put(c); lxc_container_put(c);
exit(1); exit(1);
} }
c->configfile = strdup(my_args.rcfile);
if (!c->configfile) {
ERROR("Out of memory setting new config filename");
lxc_container_put(c);
exit(1);
}
} }
if (!c->unfreeze(c)) { if (!c->unfreeze(c)) {
......
...@@ -112,6 +112,12 @@ int main(int argc, char *argv[]) ...@@ -112,6 +112,12 @@ int main(int argc, char *argv[])
lxc_container_put(c); lxc_container_put(c);
return 1; return 1;
} }
c->configfile = strdup(my_args.rcfile);
if (!c->configfile) {
fprintf(stderr, "Out of memory setting new config filename\n");
lxc_container_put(c);
return 1;
}
} }
if (!c->wait(c, my_args.states, my_args.timeout)) { if (!c->wait(c, my_args.states, my_args.timeout)) {
......
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