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
19eacdc0
Unverified
Commit
19eacdc0
authored
Jun 28, 2018
by
2xsec
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools: lxc-stop: share internal API symbols
Signed-off-by:
2xsec
<
dh48.jeong@samsung.com
>
parent
eb0c9382
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
12 deletions
+15
-12
Makefile.am
src/lxc/Makefile.am
+1
-1
lxc_stop.c
src/lxc/tools/lxc_stop.c
+14
-11
No files found.
src/lxc/Makefile.am
View file @
19eacdc0
...
@@ -279,7 +279,7 @@ lxc_monitor_SOURCES = tools/lxc_monitor.c tools/arguments.c tools/tool_utils.c
...
@@ -279,7 +279,7 @@ 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_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
lxc_copy_SOURCES
=
tools/lxc_copy.c tools/arguments.c tools/tool_utils.c
lxc_start_SOURCES
=
tools/lxc_start.c tools/arguments.c
lxc_start_SOURCES
=
tools/lxc_start.c tools/arguments.c
lxc_stop_SOURCES
=
tools/lxc_stop.c tools/arguments.c
tools/tool_utils.c
lxc_stop_SOURCES
=
tools/lxc_stop.c tools/arguments.c
lxc_top_SOURCES
=
tools/lxc_top.c tools/arguments.c tools/tool_utils.c
lxc_top_SOURCES
=
tools/lxc_top.c tools/arguments.c tools/tool_utils.c
lxc_unfreeze_SOURCES
=
tools/lxc_unfreeze.c tools/arguments.c tools/tool_utils.c
lxc_unfreeze_SOURCES
=
tools/lxc_unfreeze.c tools/arguments.c tools/tool_utils.c
lxc_unshare_SOURCES
=
tools/lxc_unshare.c tools/arguments.c tools/tool_utils.c
lxc_unshare_SOURCES
=
tools/lxc_unshare.c tools/arguments.c tools/tool_utils.c
...
...
src/lxc/tools/lxc_stop.c
View file @
19eacdc0
...
@@ -31,11 +31,14 @@
...
@@ -31,11 +31,14 @@
#include <lxc/lxccontainer.h>
#include <lxc/lxccontainer.h>
#include "arguments.h"
#include "arguments.h"
#include "tool_utils.h"
#include "log.h"
#include "utils.h"
#define OPT_NO_LOCK OPT_USAGE + 1
#define OPT_NO_LOCK OPT_USAGE + 1
#define OPT_NO_KILL OPT_USAGE + 2
#define OPT_NO_KILL OPT_USAGE + 2
lxc_log_define
(
lxc_stop
,
lxc
);
static
int
my_parser
(
struct
lxc_arguments
*
args
,
int
c
,
char
*
arg
)
static
int
my_parser
(
struct
lxc_arguments
*
args
,
int
c
,
char
*
arg
)
{
{
switch
(
c
)
{
switch
(
c
)
{
...
@@ -130,33 +133,33 @@ int main(int argc, char *argv[])
...
@@ -130,33 +133,33 @@ int main(int argc, char *argv[])
/* some checks */
/* some checks */
if
(
!
my_args
.
hardstop
&&
my_args
.
timeout
<
-
1
)
{
if
(
!
my_args
.
hardstop
&&
my_args
.
timeout
<
-
1
)
{
lxc_error
(
&
my_args
,
"Invalid timeout"
);
ERROR
(
"Invalid timeout"
);
exit
(
ret
);
exit
(
ret
);
}
}
if
(
my_args
.
hardstop
&&
my_args
.
nokill
)
{
if
(
my_args
.
hardstop
&&
my_args
.
nokill
)
{
lxc_error
(
&
my_args
,
"-k can't be used with --nokill"
);
ERROR
(
"-k can't be used with --nokill"
);
exit
(
ret
);
exit
(
ret
);
}
}
if
(
my_args
.
hardstop
&&
my_args
.
reboot
)
{
if
(
my_args
.
hardstop
&&
my_args
.
reboot
)
{
lxc_error
(
&
my_args
,
"-k can't be used with -r"
);
ERROR
(
"-k can't be used with -r"
);
exit
(
ret
);
exit
(
ret
);
}
}
if
(
my_args
.
hardstop
&&
my_args
.
timeout
)
{
if
(
my_args
.
hardstop
&&
my_args
.
timeout
)
{
lxc_error
(
&
my_args
,
"-k doesn't allow timeouts"
);
ERROR
(
"-k doesn't allow timeouts"
);
exit
(
ret
);
exit
(
ret
);
}
}
if
(
my_args
.
nolock
&&
!
my_args
.
hardstop
)
{
if
(
my_args
.
nolock
&&
!
my_args
.
hardstop
)
{
lxc_error
(
&
my_args
,
"--nolock may only be used with -k"
);
ERROR
(
"--nolock may only be used with -k"
);
exit
(
ret
);
exit
(
ret
);
}
}
c
=
lxc_container_new
(
my_args
.
name
,
my_args
.
lxcpath
[
0
]);
c
=
lxc_container_new
(
my_args
.
name
,
my_args
.
lxcpath
[
0
]);
if
(
!
c
)
{
if
(
!
c
)
{
lxc_error
(
&
my_args
,
"Error opening container"
);
ERROR
(
"Error opening container"
);
goto
out
;
goto
out
;
}
}
...
@@ -164,24 +167,24 @@ int main(int argc, char *argv[])
...
@@ -164,24 +167,24 @@ int main(int argc, char *argv[])
c
->
clear_config
(
c
);
c
->
clear_config
(
c
);
if
(
!
c
->
load_config
(
c
,
my_args
.
rcfile
))
{
if
(
!
c
->
load_config
(
c
,
my_args
.
rcfile
))
{
lxc_error
(
&
my_args
,
"Failed to load rcfile"
);
ERROR
(
"Failed to load rcfile"
);
goto
out
;
goto
out
;
}
}
c
->
configfile
=
strdup
(
my_args
.
rcfile
);
c
->
configfile
=
strdup
(
my_args
.
rcfile
);
if
(
!
c
->
configfile
)
{
if
(
!
c
->
configfile
)
{
lxc_error
(
&
my_args
,
"Out of memory setting new config filename"
);
ERROR
(
"Out of memory setting new config filename"
);
goto
out
;
goto
out
;
}
}
}
}
if
(
!
c
->
may_control
(
c
))
{
if
(
!
c
->
may_control
(
c
))
{
lxc_error
(
&
my_args
,
"Insufficent privileges to control %s"
,
c
->
name
);
ERROR
(
"Insufficent privileges to control %s"
,
c
->
name
);
goto
out
;
goto
out
;
}
}
if
(
!
c
->
is_running
(
c
))
{
if
(
!
c
->
is_running
(
c
))
{
lxc_error
(
&
my_args
,
"%s is not running"
,
c
->
name
);
ERROR
(
"%s is not running"
,
c
->
name
);
/* Per our manpage we need to exit with exit code:
/* Per our manpage we need to exit with exit code:
* 2: The specified container exists but was not running.
* 2: The specified container exists but was not running.
...
...
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