diff --git a/criu/cr-dump.c b/criu/cr-dump.c index 1bc5d934f5..e73cad5bc4 100644 --- a/criu/cr-dump.c +++ b/criu/cr-dump.c @@ -1963,6 +1963,9 @@ int cr_pre_dump_tasks(pid_t pid) if (collect_pstree()) goto err; + if (checkpoint_devices()) + goto err; + if (collect_pstree_ids_predump()) goto err; @@ -2192,6 +2195,9 @@ int cr_dump_tasks(pid_t pid) if (collect_pstree()) goto err; + if (checkpoint_devices()) + goto err; + if (collect_pstree_ids()) goto err; diff --git a/criu/include/seize.h b/criu/include/seize.h index 64e8d2d12f..fc7facad37 100644 --- a/criu/include/seize.h +++ b/criu/include/seize.h @@ -2,6 +2,7 @@ #define __CR_SEIZE_H__ extern int collect_pstree(void); +extern int checkpoint_devices(void); struct pstree_item; extern void pstree_switch_state(struct pstree_item *root_item, int st); extern const char *get_real_freezer_state(void); diff --git a/criu/seize.c b/criu/seize.c index 9bd1832d9b..f2c67862bb 100644 --- a/criu/seize.c +++ b/criu/seize.c @@ -1017,7 +1017,6 @@ int collect_pstree(void) pid_t pid = root_item->pid->real; int ret, exit_code = -1; struct proc_status_creds creds; - struct pstree_item *iter; timing_start(TIME_FREEZING); @@ -1078,6 +1077,21 @@ int collect_pstree(void) goto err; } + exit_code = 0; + timing_stop(TIME_FREEZING); + timing_start(TIME_FROZEN); + +err: + /* Freezing stage finished in time - disable timer. */ + alarm(0); + return exit_code; +} + +int checkpoint_devices(void) +{ + struct pstree_item *iter; + int ret, exit_code = -1; + for_each_pstree_item(iter) { if (!task_alive(iter)) continue; @@ -1087,11 +1101,6 @@ int collect_pstree(void) } exit_code = 0; - timing_stop(TIME_FREEZING); - timing_start(TIME_FROZEN); - err: - /* Freezing stage finished in time - disable timer. */ - alarm(0); return exit_code; -} +} \ No newline at end of file