[CRIU] [PATCH 06/12] cr-dump: Try to cure remote on err-pathes

Dmitry Safonov dima at arista.com
Sun Nov 10 01:20:39 MSK 2019


On daemon stop or threads dump failures it's still desired to remove
parasite from the remote (if possible). Try best and keep hopeing.

Signed-off-by: Dmitry Safonov <dima at arista.com>
---
 criu/cr-dump.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/criu/cr-dump.c b/criu/cr-dump.c
index 8aabb85b11b0..d8cc4f915e43 100644
--- a/criu/cr-dump.c
+++ b/criu/cr-dump.c
@@ -1386,16 +1386,20 @@ static int dump_one_task(struct pstree_item *item, InventoryEntry *parent_ie)
 
 	ret = compel_stop_daemon(parasite_ctl);
 	if (ret) {
-		pr_err("Can't cure (pid: %d) from parasite\n", pid);
-		goto err;
+		pr_err("Can't stop daemon in parasite (pid: %d)\n", pid);
+		goto err_cure;
 	}
 
 	ret = dump_task_threads(parasite_ctl, item);
 	if (ret) {
 		pr_err("Can't dump threads\n");
-		goto err;
+		goto err_cure;
 	}
 
+	/*
+	 * On failure local map will be cured in cr_dump_finish()
+	 * for lazy pages.
+	 */
 	if (opts.lazy_pages)
 		ret = compel_cure_remote(parasite_ctl);
 	else
@@ -1428,7 +1432,9 @@ err:
 err_cure:
 	close_cr_imgset(&cr_imgset);
 err_cure_imgset:
-	compel_cure(parasite_ctl);
+	ret = compel_cure(parasite_ctl);
+	if (ret)
+		pr_err("Can't cure (pid: %d) from parasite\n", pid);
 	goto err;
 }
 
-- 
2.24.0



More information about the CRIU mailing list