Commit 2177dbc7 by Stéphane Graber

lxc-info: Limit information when not running

Don't try to print the PID, IP addresses or statistics for a container that's not current running. Signed-off-by: 's avatarStéphane Graber <stgraber@ubuntu.com> Acked-by: 's avatarSerge E. Hallyn <serge.hallyn@ubuntu.com>
parent 7f12cae9
...@@ -301,6 +301,7 @@ static int print_info(const char *name, const char *lxcpath) ...@@ -301,6 +301,7 @@ static int print_info(const char *name, const char *lxcpath)
print_info_msg_str("State:", c->state(c)); print_info_msg_str("State:", c->state(c));
} }
if (c->is_running(c)) {
if (pid) { if (pid) {
pid_t initpid; pid_t initpid;
...@@ -321,6 +322,7 @@ static int print_info(const char *name, const char *lxcpath) ...@@ -321,6 +322,7 @@ static int print_info(const char *name, const char *lxcpath)
} }
} }
} }
}
if (stats) { if (stats) {
print_stats(c); print_stats(c);
......
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