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
3b7a4cbe
Commit
3b7a4cbe
authored
Nov 07, 2011
by
Cyrill Gorcunov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
restorer: Start using sigreturn_restore
Signed-off-by:
Cyrill Gorcunov
<
gorcunov@gmail.com
>
parent
7e481f89
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
14 deletions
+21
-14
cr-restore.c
cr-restore.c
+8
-5
restorer.c
restorer.c
+13
-9
No files found.
cr-restore.c
View file @
3b7a4cbe
...
...
@@ -90,6 +90,7 @@ static struct pipe_info *pipes;
static
int
nr_pipes
;
static
int
restore_task_with_children
(
int
my_pid
,
char
*
pstree_path
);
static
void
sigreturn_restore
(
pid_t
pid
);
static
void
show_saved_shmems
(
void
)
{
...
...
@@ -394,7 +395,7 @@ static int prepare_shared(int ps_fd)
break
;
if
(
ret
!=
sizeof
(
e
))
{
perror
(
"Can't read ps"
);
perror
(
"Can't read ps
tree_entry
"
);
return
1
;
}
...
...
@@ -873,7 +874,7 @@ static int prepare_and_execute_image(int pid)
if
(
prepare_image_maps
(
fd_new
,
pid
))
return
1
;
s
ync
(
);
s
igreturn_restore
(
pid
);
if
(
convert_to_elf
(
elf_path
,
fd_new
))
return
1
;
...
...
@@ -1280,7 +1281,7 @@ err_or_found:
return
hint
;
}
static
void
restorer_test
(
pid_t
pid
)
static
void
sigreturn_restore
(
pid_t
pid
)
{
long
code_len
,
vma_len
,
args_offset
,
new_sp
,
hint
;
void
*
args_rip
,
*
exec_mem
,
*
exec_start
;
...
...
@@ -1373,7 +1374,7 @@ static void restorer_test(pid_t pid)
strcpy
(
args
->
self_vmas_path
,
path
);
snprintf
(
path
,
sizeof
(
path
),
"core-%d.img"
,
pid
);
snprintf
(
path
,
sizeof
(
path
),
"core-%d.img
.out
"
,
pid
);
strcpy
(
args
->
core_path
,
path
);
pr_info
(
"vma_len: %li code_len: %li exec_mem: %p exec_start: %p new_sp: %p args: %p
\n
"
,
...
...
@@ -1407,7 +1408,9 @@ err:
int
cr_restore_tasks
(
pid_t
pid
,
struct
cr_options
*
opts
)
{
restorer_test
(
pid
);
#if 0
sigreturn_restore(pid);
#endif
if
(
opts
->
leader_only
)
return
restore_one_task
(
pid
);
...
...
restorer.c
View file @
3b7a4cbe
...
...
@@ -217,8 +217,10 @@ self_len_end:
if
(
!
(
vma_entry
.
status
&
VMA_AREA_REGULAR
))
continue
;
#if 0
vma_entry.fd = -1UL; /* for a while */
vma_entry.pgoff = 0;
#endif
/*
* Should map memory here. Note we map them as
...
...
@@ -228,19 +230,21 @@ self_len_end:
va
=
sys_mmap
((
void
*
)
vma_entry
.
start
,
vma_entry
.
end
-
vma_entry
.
start
,
vma_entry
.
prot
|
PROT_WRITE
,
(
vma_entry
.
flags
|
MAP_ANONYMOUS
|
MAP_FIXED
|
MAP_PRIVATE
)
&
~
MAP_SHARED
,
vma_entry
.
flags
|
MAP_FIXED
,
vma_entry
.
fd
,
vma_entry
.
pgoff
);
if
(
va
!=
vma_entry
.
start
)
{
if
(
va
!=
vma_entry
.
start
)
{
write_hex_n
(
__LINE__
);
write_hex_n
(
vma_entry
.
start
);
write_hex_n
(
va
);
goto
core_restore_end
;
}
write_hex_n
(
vma_entry
.
start
);
write_hex_n
(
vma_entry
.
end
);
write_hex_n
(
vma_entry
.
prot
);
write_hex_n
(
vma_entry
.
flags
);
write_hex_n
(
vma_entry
.
fd
);
write_hex_n
(
vma_entry
.
pgoff
);
write_hex_n
(
va
);
goto
core_restore_end
;
}
}
/*
...
...
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