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:
17
mem.c
17
mem.c
@@ -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");
|
||||
|
Reference in New Issue
Block a user