Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
469711c5
Commit
469711c5
authored
Jun 29, 2018
by
2xsec
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools: lxc-info: share internal API symbols
Signed-off-by:
2xsec
<
dh48.jeong@samsung.com
>
parent
b14fc100
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
5 deletions
+17
-5
Makefile.am
src/lxc/Makefile.am
+1
-1
lxc_info.c
src/lxc/tools/lxc_info.c
+16
-4
No files found.
src/lxc/Makefile.am
View file @
469711c5
...
...
@@ -274,7 +274,7 @@ lxc_destroy_SOURCES = tools/lxc_destroy.c tools/arguments.c tools/tool_utils.c
lxc_device_SOURCES
=
tools/lxc_device.c tools/arguments.c tools/tool_utils.c
lxc_execute_SOURCES
=
tools/lxc_execute.c tools/arguments.c tools/tool_utils.c
lxc_freeze_SOURCES
=
tools/lxc_freeze.c tools/arguments.c
lxc_info_SOURCES
=
tools/lxc_info.c tools/arguments.c
tools/tool_utils.c
lxc_info_SOURCES
=
tools/lxc_info.c tools/arguments.c
lxc_monitor_SOURCES
=
tools/lxc_monitor.c tools/arguments.c tools/tool_utils.c
lxc_ls_SOURCES
=
tools/lxc_ls.c tools/arguments.c tools/tool_utils.c
lxc_copy_SOURCES
=
tools/lxc_copy.c tools/arguments.c tools/tool_utils.c
...
...
src/lxc/tools/lxc_info.c
View file @
469711c5
...
...
@@ -34,7 +34,10 @@
#include <lxc/lxccontainer.h>
#include "arguments.h"
#include "tool_utils.h"
#include "log.h"
#include "utils.h"
lxc_log_define
(
lxc_info
,
lxc
);
static
bool
ips
;
static
bool
state
;
...
...
@@ -45,14 +48,16 @@ static char **key = NULL;
static
int
keys
=
0
;
static
int
filter_count
=
0
;
static
int
my_parser
(
struct
lxc_arguments
*
args
,
int
c
,
char
*
arg
)
static
int
my_parser
(
struct
lxc_arguments
*
args
,
int
c
,
char
*
arg
)
{
char
**
newk
;
switch
(
c
)
{
case
'c'
:
newk
=
realloc
(
key
,
(
keys
+
1
)
*
sizeof
(
key
[
0
]));
if
(
!
newk
)
return
-
1
;
key
=
newk
;
key
[
keys
]
=
arg
;
keys
++
;
...
...
@@ -153,6 +158,7 @@ static void print_net_stats(struct lxc_container *c)
for
(
netnr
=
0
;
;
netnr
++
)
{
sprintf
(
buf
,
"lxc.net.%d.type"
,
netnr
);
type
=
c
->
get_running_config_item
(
c
,
buf
);
if
(
!
type
)
break
;
...
...
@@ -163,9 +169,11 @@ static void print_net_stats(struct lxc_container *c)
sprintf
(
buf
,
"lxc.net.%d.link"
,
netnr
);
}
free
(
type
);
ifname
=
c
->
get_running_config_item
(
c
,
buf
);
if
(
!
ifname
)
return
;
printf
(
"%-15s %s
\n
"
,
"Link:"
,
ifname
);
fflush
(
stdout
);
...
...
@@ -303,11 +311,13 @@ static int print_info(const char *name, const char *lxcpath)
if
(
my_args
.
rcfile
)
{
c
->
clear_config
(
c
);
if
(
!
c
->
load_config
(
c
,
my_args
.
rcfile
))
{
fprintf
(
stderr
,
"Failed to load rcfile
\n
"
);
lxc_container_put
(
c
);
return
-
1
;
}
c
->
configfile
=
strdup
(
my_args
.
rcfile
);
if
(
!
c
->
configfile
)
{
fprintf
(
stderr
,
"Out of memory setting new config filename
\n
"
);
...
...
@@ -333,9 +343,8 @@ static int print_info(const char *name, const char *lxcpath)
print_info_msg_str
(
"Name:"
,
c
->
name
);
}
if
(
state
)
{
if
(
state
)
print_info_msg_str
(
"State:"
,
c
->
state
(
c
));
}
if
(
c
->
is_running
(
c
))
{
if
(
pid
)
{
...
...
@@ -348,10 +357,12 @@ static int print_info(const char *name, const char *lxcpath)
if
(
ips
)
{
fflush
(
stdout
);
char
**
addresses
=
c
->
get_ips
(
c
,
NULL
,
NULL
,
0
);
if
(
addresses
)
{
char
*
address
;
i
=
0
;
while
(
addresses
[
i
])
{
address
=
addresses
[
i
];
print_info_msg_str
(
"IP:"
,
address
);
...
...
@@ -380,6 +391,7 @@ static int print_info(const char *name, const char *lxcpath)
else
printf
(
"%s = %s
\n
"
,
key
[
i
],
val
);
}
free
(
val
);
}
else
if
(
len
==
0
)
{
if
(
!
humanize
&&
keys
==
1
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment