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
29597423
Unverified
Commit
29597423
authored
Jun 12, 2019
by
Christian Brauner
Committed by
GitHub
Jun 12, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3040 from Rachid-Koucha/patch-11
Centralize hook names
parents
16512e0c
3ea957c6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
23 deletions
+8
-23
conf.c
src/lxc/conf.c
+8
-23
No files found.
src/lxc/conf.c
View file @
29597423
...
@@ -3754,29 +3754,14 @@ int run_lxc_hooks(const char *name, char *hookname, struct lxc_conf *conf,
...
@@ -3754,29 +3754,14 @@ int run_lxc_hooks(const char *name, char *hookname, struct lxc_conf *conf,
char
*
argv
[])
char
*
argv
[])
{
{
struct
lxc_list
*
it
;
struct
lxc_list
*
it
;
int
which
=
-
1
;
int
which
;
if
(
strcmp
(
hookname
,
"pre-start"
)
==
0
)
for
(
which
=
0
;
which
<
NUM_LXC_HOOKS
;
which
++
)
{
which
=
LXCHOOK_PRESTART
;
if
(
strcmp
(
hookname
,
lxchook_names
[
which
])
==
0
)
else
if
(
strcmp
(
hookname
,
"start-host"
)
==
0
)
break
;
which
=
LXCHOOK_START_HOST
;
}
else
if
(
strcmp
(
hookname
,
"pre-mount"
)
==
0
)
which
=
LXCHOOK_PREMOUNT
;
if
(
which
>=
NUM_LXC_HOOKS
)
else
if
(
strcmp
(
hookname
,
"mount"
)
==
0
)
which
=
LXCHOOK_MOUNT
;
else
if
(
strcmp
(
hookname
,
"autodev"
)
==
0
)
which
=
LXCHOOK_AUTODEV
;
else
if
(
strcmp
(
hookname
,
"start"
)
==
0
)
which
=
LXCHOOK_START
;
else
if
(
strcmp
(
hookname
,
"stop"
)
==
0
)
which
=
LXCHOOK_STOP
;
else
if
(
strcmp
(
hookname
,
"post-stop"
)
==
0
)
which
=
LXCHOOK_POSTSTOP
;
else
if
(
strcmp
(
hookname
,
"clone"
)
==
0
)
which
=
LXCHOOK_CLONE
;
else
if
(
strcmp
(
hookname
,
"destroy"
)
==
0
)
which
=
LXCHOOK_DESTROY
;
else
return
-
1
;
return
-
1
;
lxc_list_for_each
(
it
,
&
conf
->
hooks
[
which
])
{
lxc_list_for_each
(
it
,
&
conf
->
hooks
[
which
])
{
...
...
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