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
fe8c37ef
Commit
fe8c37ef
authored
Aug 18, 2018
by
2xsec
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools: lxc-freeze: add default log priority & cleanups
Signed-off-by:
2xsec
<
dh48.jeong@samsung.com
>
parent
c2a23ef6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
16 deletions
+15
-16
lxc_freeze.c
src/lxc/tools/lxc_freeze.c
+15
-16
No files found.
src/lxc/tools/lxc_freeze.c
View file @
fe8c37ef
...
...
@@ -41,8 +41,8 @@ static const struct option my_longopts[] = {
};
static
struct
lxc_arguments
my_args
=
{
.
progname
=
"lxc-freeze"
,
.
help
=
"\
.
progname
=
"lxc-freeze"
,
.
help
=
"\
--name=NAME
\n
\
\n
\
lxc-freeze freezes a container with the identifier NAME
\n
\
...
...
@@ -50,9 +50,11 @@ lxc-freeze freezes a container with the identifier NAME\n\
Options :
\n
\
-n, --name=NAME NAME of the container
\n
\
--rcfile=FILE Load configuration file FILE
\n
"
,
.
options
=
my_longopts
,
.
parser
=
NULL
,
.
checker
=
NULL
,
.
options
=
my_longopts
,
.
parser
=
NULL
,
.
checker
=
NULL
,
.
log_priority
=
"ERROR"
,
.
log_file
=
"none"
,
};
int
main
(
int
argc
,
char
*
argv
[])
...
...
@@ -63,18 +65,15 @@ int main(int argc, char *argv[])
if
(
lxc_arguments_parse
(
&
my_args
,
argc
,
argv
))
exit
(
EXIT_FAILURE
);
/* Only create log if explicitly instructed */
if
(
my_args
.
log_file
||
my_args
.
log_priority
)
{
log
.
name
=
my_args
.
name
;
log
.
file
=
my_args
.
log_file
;
log
.
level
=
my_args
.
log_priority
;
log
.
prefix
=
my_args
.
progname
;
log
.
quiet
=
my_args
.
quiet
;
log
.
lxcpath
=
my_args
.
lxcpath
[
0
];
log
.
name
=
my_args
.
name
;
log
.
file
=
my_args
.
log_file
;
log
.
level
=
my_args
.
log_priority
;
log
.
prefix
=
my_args
.
progname
;
log
.
quiet
=
my_args
.
quiet
;
log
.
lxcpath
=
my_args
.
lxcpath
[
0
];
if
(
lxc_log_init
(
&
log
))
exit
(
EXIT_FAILURE
);
}
if
(
lxc_log_init
(
&
log
))
exit
(
EXIT_FAILURE
);
c
=
lxc_container_new
(
my_args
.
name
,
my_args
.
lxcpath
[
0
]);
if
(
!
c
)
{
...
...
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