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
122cae21
Commit
122cae21
authored
Nov 22, 2011
by
Cyrill Gorcunov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dump: Add -k (kill dumped) option
Signed-off-by:
Cyrill Gorcunov
<
gorcunov@gmail.com
>
parent
d3a30d6b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
3 deletions
+22
-3
cr-dump.c
cr-dump.c
+13
-1
crtools.c
crtools.c
+8
-2
util.h
include/util.h
+1
-0
No files found.
cr-dump.c
View file @
122cae21
...
@@ -1244,12 +1244,24 @@ int cr_dump_tasks(pid_t pid, struct cr_options *opts)
...
@@ -1244,12 +1244,24 @@ int cr_dump_tasks(pid_t pid, struct cr_options *opts)
ret
=
0
;
ret
=
0
;
err:
err:
if
(
!
opts
->
final_state
!=
CR_TASK_LEAVE_STOPPED
)
{
switch
(
opts
->
final_state
)
{
case
CR_TASK_LEAVE_RUNNING
:
list_for_each_entry
(
item
,
&
pstree_list
,
list
)
{
list_for_each_entry
(
item
,
&
pstree_list
,
list
)
{
continue_task
(
item
->
pid
);
continue_task
(
item
->
pid
);
if
(
opts
->
leader_only
)
if
(
opts
->
leader_only
)
break
;
break
;
}
}
break
;
case
CR_TASK_KILL
:
list_for_each_entry
(
item
,
&
pstree_list
,
list
)
{
kill_task
(
item
->
pid
);
if
(
opts
->
leader_only
)
break
;
}
break
;
case
CR_TASK_LEAVE_STOPPED
:
default:
break
;
}
}
free_pstree
(
&
pstree_list
);
free_pstree
(
&
pstree_list
);
...
...
crtools.c
View file @
122cae21
...
@@ -227,7 +227,7 @@ int main(int argc, char *argv[])
...
@@ -227,7 +227,7 @@ int main(int argc, char *argv[])
int
opt
,
idx
;
int
opt
,
idx
;
int
action
=
-
1
;
int
action
=
-
1
;
static
const
char
short_opts
[]
=
"drsp:t:h"
;
static
const
char
short_opts
[]
=
"drs
k
p:t:h"
;
static
const
struct
option
long_opts
[]
=
{
static
const
struct
option
long_opts
[]
=
{
{
"dump"
,
no_argument
,
NULL
,
'd'
},
{
"dump"
,
no_argument
,
NULL
,
'd'
},
{
"restore"
,
no_argument
,
NULL
,
'r'
},
{
"restore"
,
no_argument
,
NULL
,
'r'
},
...
@@ -242,6 +242,9 @@ int main(int argc, char *argv[])
...
@@ -242,6 +242,9 @@ int main(int argc, char *argv[])
memzero_p
(
&
zero_page_entry
);
memzero_p
(
&
zero_page_entry
);
/* Default options */
opts
.
final_state
=
CR_TASK_LEAVE_RUNNING
;
for
(
opt
=
getopt_long
(
argc
,
argv
,
short_opts
,
long_opts
,
&
idx
);
opt
!=
-
1
;
for
(
opt
=
getopt_long
(
argc
,
argv
,
short_opts
,
long_opts
,
&
idx
);
opt
!=
-
1
;
opt
=
getopt_long
(
argc
,
argv
,
short_opts
,
long_opts
,
&
idx
))
{
opt
=
getopt_long
(
argc
,
argv
,
short_opts
,
long_opts
,
&
idx
))
{
switch
(
opt
)
{
switch
(
opt
)
{
...
@@ -262,6 +265,9 @@ int main(int argc, char *argv[])
...
@@ -262,6 +265,9 @@ int main(int argc, char *argv[])
case
's'
:
case
's'
:
action
=
opt
;
action
=
opt
;
break
;
break
;
case
'k'
:
opts
.
final_state
=
CR_TASK_KILL
;
break
;
case
'h'
:
case
'h'
:
default:
default:
goto
usage
;
goto
usage
;
...
@@ -287,6 +293,6 @@ int main(int argc, char *argv[])
...
@@ -287,6 +293,6 @@ int main(int argc, char *argv[])
usage:
usage:
printk
(
"
\n
Usage:
\n
"
);
printk
(
"
\n
Usage:
\n
"
);
printk
(
"
\t
crtools ([--dump|-d]|[--show|-s]|[--restore|-r]) (-p|-t) pid
\n\n
"
);
printk
(
"
\t
crtools ([--dump|-d]|[--show|-s]|[--restore|-r])
[-k]
(-p|-t) pid
\n\n
"
);
return
-
1
;
return
-
1
;
}
}
include/util.h
View file @
122cae21
...
@@ -72,6 +72,7 @@ extern void printk(const char *format, ...);
...
@@ -72,6 +72,7 @@ extern void printk(const char *format, ...);
} while (0)
} while (0)
#define stop_task(pid) kill(pid, SIGSTOP)
#define stop_task(pid) kill(pid, SIGSTOP)
#define kill_task(pid) kill(pid, SIGKILL)
#define continue_task(pid) kill(pid, SIGCONT)
#define continue_task(pid) kill(pid, SIGCONT)
#define write_ptr(fd, ptr) \
#define write_ptr(fd, ptr) \
...
...
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