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
52492063
Commit
52492063
authored
Oct 06, 2015
by
Wolfgang Bumiller
Committed by
Stéphane Graber
Oct 07, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added stop-hook entries
Signed-off-by:
Wolfgang Bumiller
<
w.bumiller@proxmox.com
>
Acked-by:
Serge E. Hallyn
<
serge.hallyn@ubuntu.com
>
parent
b6b2b194
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
2 deletions
+7
-2
conf.c
src/lxc/conf.c
+3
-1
conf.h
src/lxc/conf.h
+1
-1
confile.c
src/lxc/confile.c
+3
-0
No files found.
src/lxc/conf.c
View file @
52492063
...
@@ -163,7 +163,7 @@ return -1;
...
@@ -163,7 +163,7 @@ return -1;
#endif
#endif
char
*
lxchook_names
[
NUM_LXC_HOOKS
]
=
{
char
*
lxchook_names
[
NUM_LXC_HOOKS
]
=
{
"pre-start"
,
"pre-mount"
,
"mount"
,
"autodev"
,
"start"
,
"post-stop"
,
"clone"
,
"destroy"
};
"pre-start"
,
"pre-mount"
,
"mount"
,
"autodev"
,
"start"
,
"
stop"
,
"
post-stop"
,
"clone"
,
"destroy"
};
typedef
int
(
*
instantiate_cb
)(
struct
lxc_handler
*
,
struct
lxc_netdev
*
);
typedef
int
(
*
instantiate_cb
)(
struct
lxc_handler
*
,
struct
lxc_netdev
*
);
...
@@ -4024,6 +4024,8 @@ int run_lxc_hooks(const char *name, char *hook, struct lxc_conf *conf,
...
@@ -4024,6 +4024,8 @@ int run_lxc_hooks(const char *name, char *hook, struct lxc_conf *conf,
which
=
LXCHOOK_AUTODEV
;
which
=
LXCHOOK_AUTODEV
;
else
if
(
strcmp
(
hook
,
"start"
)
==
0
)
else
if
(
strcmp
(
hook
,
"start"
)
==
0
)
which
=
LXCHOOK_START
;
which
=
LXCHOOK_START
;
else
if
(
strcmp
(
hook
,
"stop"
)
==
0
)
which
=
LXCHOOK_STOP
;
else
if
(
strcmp
(
hook
,
"post-stop"
)
==
0
)
else
if
(
strcmp
(
hook
,
"post-stop"
)
==
0
)
which
=
LXCHOOK_POSTSTOP
;
which
=
LXCHOOK_POSTSTOP
;
else
if
(
strcmp
(
hook
,
"clone"
)
==
0
)
else
if
(
strcmp
(
hook
,
"clone"
)
==
0
)
...
...
src/lxc/conf.h
View file @
52492063
...
@@ -279,7 +279,7 @@ enum {
...
@@ -279,7 +279,7 @@ enum {
*/
*/
enum
lxchooks
{
enum
lxchooks
{
LXCHOOK_PRESTART
,
LXCHOOK_PREMOUNT
,
LXCHOOK_MOUNT
,
LXCHOOK_AUTODEV
,
LXCHOOK_PRESTART
,
LXCHOOK_PREMOUNT
,
LXCHOOK_MOUNT
,
LXCHOOK_AUTODEV
,
LXCHOOK_START
,
LXCHOOK_POSTSTOP
,
LXCHOOK_CLONE
,
LXCHOOK_DESTROY
,
LXCHOOK_START
,
LXCHOOK_
STOP
,
LXCHOOK_
POSTSTOP
,
LXCHOOK_CLONE
,
LXCHOOK_DESTROY
,
NUM_LXC_HOOKS
};
NUM_LXC_HOOKS
};
extern
char
*
lxchook_names
[
NUM_LXC_HOOKS
];
extern
char
*
lxchook_names
[
NUM_LXC_HOOKS
];
...
...
src/lxc/confile.c
View file @
52492063
...
@@ -137,6 +137,7 @@ static struct lxc_config_t config[] = {
...
@@ -137,6 +137,7 @@ static struct lxc_config_t config[] = {
{
"lxc.hook.mount"
,
config_hook
},
{
"lxc.hook.mount"
,
config_hook
},
{
"lxc.hook.autodev"
,
config_hook
},
{
"lxc.hook.autodev"
,
config_hook
},
{
"lxc.hook.start"
,
config_hook
},
{
"lxc.hook.start"
,
config_hook
},
{
"lxc.hook.stop"
,
config_hook
},
{
"lxc.hook.post-stop"
,
config_hook
},
{
"lxc.hook.post-stop"
,
config_hook
},
{
"lxc.hook.clone"
,
config_hook
},
{
"lxc.hook.clone"
,
config_hook
},
{
"lxc.hook.destroy"
,
config_hook
},
{
"lxc.hook.destroy"
,
config_hook
},
...
@@ -1085,6 +1086,8 @@ static int config_hook(const char *key, const char *value,
...
@@ -1085,6 +1086,8 @@ static int config_hook(const char *key, const char *value,
return
add_hook
(
lxc_conf
,
LXCHOOK_MOUNT
,
copy
);
return
add_hook
(
lxc_conf
,
LXCHOOK_MOUNT
,
copy
);
else
if
(
strcmp
(
key
,
"lxc.hook.start"
)
==
0
)
else
if
(
strcmp
(
key
,
"lxc.hook.start"
)
==
0
)
return
add_hook
(
lxc_conf
,
LXCHOOK_START
,
copy
);
return
add_hook
(
lxc_conf
,
LXCHOOK_START
,
copy
);
else
if
(
strcmp
(
key
,
"lxc.hook.stop"
)
==
0
)
return
add_hook
(
lxc_conf
,
LXCHOOK_STOP
,
copy
);
else
if
(
strcmp
(
key
,
"lxc.hook.post-stop"
)
==
0
)
else
if
(
strcmp
(
key
,
"lxc.hook.post-stop"
)
==
0
)
return
add_hook
(
lxc_conf
,
LXCHOOK_POSTSTOP
,
copy
);
return
add_hook
(
lxc_conf
,
LXCHOOK_POSTSTOP
,
copy
);
else
if
(
strcmp
(
key
,
"lxc.hook.clone"
)
==
0
)
else
if
(
strcmp
(
key
,
"lxc.hook.clone"
)
==
0
)
...
...
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