2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 06:15:24 +00:00

mem-snap: Redefine CLI options for mem snapshot

They are not documented, thus OK for now. Two options --
* one to specify where the parent images are
* one to reset dirty memory tracking

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Pavel Emelyanov
2013-05-08 15:52:48 +04:00
parent d9c3b91cf1
commit d416e6a135
5 changed files with 22 additions and 22 deletions

17
mem.c
View File

@@ -45,9 +45,15 @@ static int task_reset_dirty_track(int pid)
int fd, ret;
char cmd[] = "4";
if (!opts.mem_snapshot)
if (!opts.track_mem)
return 0;
if (!kerndat_has_dirty_track) {
pr_err("Kernel doesn't support dirty tracking. "
"No snapshot available.\n");
return -1;
}
pr_info("Reset %d's dirty tracking\n", pid);
fd = open_proc_rw(pid, "clear_refs");
if (fd < 0)
@@ -71,15 +77,6 @@ static struct mem_snap_ctx *mem_snap_init(struct parasite_ctl *ctl)
int p_fd, pm_fd;
PagemapHead *h;
if (!opts.mem_snapshot)
return NULL;
if (!kerndat_has_dirty_track) {
pr_err("Kernel doesn't support dirty tracking. "
"No snapshot available.\n");
return ERR_PTR(-1);
}
p_fd = get_service_fd(PARENT_FD_OFF);
if (p_fd < 0) {
pr_debug("Will do full memory dump\n");