Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
criu
Project
Project
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
zhul
criu
Commits
17d44de9
Commit
17d44de9
authored
Sep 03, 2014
by
Pavel Emelyanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scripts: Use numeric script names
Signed-off-by:
Pavel Emelyanov
<
xemul@parallels.com
>
parent
069bdd96
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
7 deletions
+25
-7
action-scripts.c
action-scripts.c
+10
-1
cr-dump.c
cr-dump.c
+1
-1
cr-restore.c
cr-restore.c
+2
-2
action-scripts.h
include/action-scripts.h
+10
-1
net.c
net.c
+2
-2
No files found.
action-scripts.c
View file @
17d44de9
...
...
@@ -11,11 +11,20 @@
#include "cr-service.h"
#include "action-scripts.h"
int
run_scripts
(
char
*
action
)
static
char
*
action_names
[]
=
{
[
ACT_POST_DUMP
]
=
"post-dump"
,
[
ACT_POST_RESTORE
]
=
"post-restore"
,
[
ACT_NET_LOCK
]
=
"network-lock"
,
[
ACT_NET_UNLOCK
]
=
"network-unlock"
,
[
ACT_SETUP_NS
]
=
"setup-namespaces"
,
};
int
run_scripts
(
enum
script_actions
act
)
{
struct
script
*
script
;
int
ret
=
0
;
char
image_dir
[
PATH_MAX
];
char
*
action
=
action_names
[
act
];
pr_debug
(
"Running %s scripts
\n
"
,
action
);
...
...
cr-dump.c
View file @
17d44de9
...
...
@@ -1873,7 +1873,7 @@ err:
* Thus ask user via script if we're to break
* checkpoint.
*/
post_dump_ret
=
run_scripts
(
"post-dump"
);
post_dump_ret
=
run_scripts
(
ACT_POST_DUMP
);
if
(
post_dump_ret
)
{
post_dump_ret
=
WEXITSTATUS
(
post_dump_ret
);
pr_info
(
"Post dump script passed with %d
\n
"
,
post_dump_ret
);
...
...
cr-restore.c
View file @
17d44de9
...
...
@@ -1680,7 +1680,7 @@ static int restore_root_task(struct pstree_item *init)
if
(
ret
)
goto
out
;
ret
=
run_scripts
(
"setup-namespaces"
);
ret
=
run_scripts
(
ACT_SETUP_NS
);
if
(
ret
)
goto
out
;
...
...
@@ -1700,7 +1700,7 @@ static int restore_root_task(struct pstree_item *init)
if
(
ret
<
0
)
goto
out_kill
;
ret
=
run_scripts
(
"post-restore"
);
ret
=
run_scripts
(
ACT_POST_RESTORE
);
if
(
ret
!=
0
)
{
pr_err
(
"Aborting restore due to script ret code %d
\n
"
,
ret
);
timing_stop
(
TIME_RESTORE
);
...
...
include/action-scripts.h
View file @
17d44de9
...
...
@@ -9,6 +9,15 @@ struct script {
#define SCRIPT_RPC_NOTIFY (char *)0x1
enum
script_actions
{
ACT_POST_DUMP
,
ACT_POST_RESTORE
,
ACT_NET_LOCK
,
ACT_NET_UNLOCK
,
ACT_SETUP_NS
,
};
extern
int
add_script
(
char
*
path
,
int
arg
);
extern
int
run_scripts
(
char
*
action
);
extern
int
run_scripts
(
enum
script_actions
);
#endif
/* __CR_ACTION_SCRIPTS_H__ */
net.c
View file @
17d44de9
...
...
@@ -592,7 +592,7 @@ int network_lock(void)
if
(
!
(
root_ns_mask
&
CLONE_NEWNET
))
return
0
;
return
run_scripts
(
"network-lock"
);
return
run_scripts
(
ACT_NET_LOCK
);
}
void
network_unlock
(
void
)
...
...
@@ -603,7 +603,7 @@ void network_unlock(void)
rst_unlock_tcp_connections
();
if
(
root_ns_mask
&
CLONE_NEWNET
)
run_scripts
(
"network-unlock"
);
run_scripts
(
ACT_NET_UNLOCK
);
}
int
veth_pair_add
(
char
*
in
,
char
*
out
)
...
...
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