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
76017ec5
Commit
76017ec5
authored
Sep 03, 2014
by
Pavel Emelyanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scripts: Use numeric action val in RPC notifications
Signed-off-by:
Pavel Emelyanov
<
xemul@parallels.com
>
parent
17d44de9
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
5 deletions
+9
-5
action-scripts.c
action-scripts.c
+1
-1
cr-service.c
cr-service.c
+7
-3
action-scripts.h
include/action-scripts.h
+1
-0
cr-service.h
include/cr-service.h
+0
-1
No files found.
action-scripts.c
View file @
76017ec5
...
@@ -42,7 +42,7 @@ int run_scripts(enum script_actions act)
...
@@ -42,7 +42,7 @@ int run_scripts(enum script_actions act)
list_for_each_entry
(
script
,
&
opts
.
scripts
,
node
)
{
list_for_each_entry
(
script
,
&
opts
.
scripts
,
node
)
{
if
(
script
->
path
==
SCRIPT_RPC_NOTIFY
)
{
if
(
script
->
path
==
SCRIPT_RPC_NOTIFY
)
{
pr_debug
(
"
\t
RPC
\n
"
);
pr_debug
(
"
\t
RPC
\n
"
);
ret
|=
send_criu_rpc_script
(
action
,
script
->
arg
);
ret
|=
send_criu_rpc_script
(
act
,
act
ion
,
script
->
arg
);
}
else
{
}
else
{
pr_debug
(
"
\t
[%s]
\n
"
,
script
->
path
);
pr_debug
(
"
\t
[%s]
\n
"
,
script
->
path
);
ret
|=
system
(
script
->
path
);
ret
|=
system
(
script
->
path
);
...
...
cr-service.c
View file @
76017ec5
...
@@ -129,7 +129,7 @@ int send_criu_restore_resp(int socket_fd, bool success, int pid)
...
@@ -129,7 +129,7 @@ int send_criu_restore_resp(int socket_fd, bool success, int pid)
return
send_criu_msg
(
socket_fd
,
&
msg
);
return
send_criu_msg
(
socket_fd
,
&
msg
);
}
}
int
send_criu_rpc_script
(
char
*
script
,
int
fd
)
int
send_criu_rpc_script
(
enum
script_actions
act
,
char
*
name
,
int
fd
)
{
{
int
ret
;
int
ret
;
CriuResp
msg
=
CRIU_RESP__INIT
;
CriuResp
msg
=
CRIU_RESP__INIT
;
...
@@ -139,9 +139,10 @@ int send_criu_rpc_script(char *script, int fd)
...
@@ -139,9 +139,10 @@ int send_criu_rpc_script(char *script, int fd)
msg
.
type
=
CRIU_REQ_TYPE__NOTIFY
;
msg
.
type
=
CRIU_REQ_TYPE__NOTIFY
;
msg
.
success
=
true
;
msg
.
success
=
true
;
msg
.
notify
=
&
cn
;
msg
.
notify
=
&
cn
;
cn
.
script
=
script
;
cn
.
script
=
name
;
if
(
!
strcmp
(
script
,
"setup-namespaces"
))
{
switch
(
act
)
{
case
ACT_SETUP_NS
:
/*
/*
* FIXME pid is required only once on
* FIXME pid is required only once on
* restore. Need some more sane way of
* restore. Need some more sane way of
...
@@ -149,6 +150,9 @@ int send_criu_rpc_script(char *script, int fd)
...
@@ -149,6 +150,9 @@ int send_criu_rpc_script(char *script, int fd)
*/
*/
cn
.
has_pid
=
true
;
cn
.
has_pid
=
true
;
cn
.
pid
=
root_item
->
pid
.
real
;
cn
.
pid
=
root_item
->
pid
.
real
;
break
;
default:
break
;
}
}
ret
=
send_criu_msg
(
fd
,
&
msg
);
ret
=
send_criu_msg
(
fd
,
&
msg
);
...
...
include/action-scripts.h
View file @
76017ec5
...
@@ -19,5 +19,6 @@ enum script_actions {
...
@@ -19,5 +19,6 @@ enum script_actions {
extern
int
add_script
(
char
*
path
,
int
arg
);
extern
int
add_script
(
char
*
path
,
int
arg
);
extern
int
run_scripts
(
enum
script_actions
);
extern
int
run_scripts
(
enum
script_actions
);
extern
int
send_criu_rpc_script
(
enum
script_actions
act
,
char
*
name
,
int
arg
);
#endif
/* __CR_ACTION_SCRIPTS_H__ */
#endif
/* __CR_ACTION_SCRIPTS_H__ */
include/cr-service.h
View file @
76017ec5
...
@@ -7,7 +7,6 @@ extern int cr_service(bool deamon_mode);
...
@@ -7,7 +7,6 @@ extern int cr_service(bool deamon_mode);
int
cr_service_work
(
int
sk
);
int
cr_service_work
(
int
sk
);
extern
int
send_criu_dump_resp
(
int
socket_fd
,
bool
success
,
bool
restored
);
extern
int
send_criu_dump_resp
(
int
socket_fd
,
bool
success
,
bool
restored
);
extern
int
send_criu_rpc_script
(
char
*
name
,
int
arg
);
extern
struct
_cr_service_client
*
cr_service_client
;
extern
struct
_cr_service_client
*
cr_service_client
;
extern
unsigned
int
service_sk_ino
;
extern
unsigned
int
service_sk_ino
;
...
...
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