1 Star 0 Fork 35

bzg_repo/criu

forked from src-openEuler/criu 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0039-unlock-network-when-restore-fails.patch 1.66 KB
一键复制 编辑 原始数据 按行查看 历史
river 提交于 2022-04-13 15:05 . criu: backport kinds of features/bugfix
From 5421245cf87bac71cbe999f257ba5b3a96c8733b Mon Sep 17 00:00:00 2001
From: Liu Chao <liuchao173@huawei.com>
Date: Fri, 9 Jul 2021 07:32:20 +0000
Subject: [PATCH 39/72] unlock network when restore fails
Conflict:NA
Reference:https://gitee.com/src-openeuler/criu/pulls/21
Signed-off-by: fu.lin <fu.lin10@huawei.com>
---
criu/cr-restore.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/criu/cr-restore.c b/criu/cr-restore.c
index 152bace..d19768d 100644
--- a/criu/cr-restore.c
+++ b/criu/cr-restore.c
@@ -115,6 +115,9 @@
#endif
struct pstree_item *current;
+#define NETWORK_COLLECTED 0x1
+#define NETWORK_UNLOCK 0x2
+static int network_status = 0;
static int restore_task_with_children(void *);
static int sigreturn_restore(pid_t pid, struct task_restore_args *ta, unsigned long alen, CoreEntry *core);
@@ -249,6 +252,7 @@ static int crtools_prepare_shared(void)
/* Connections are unlocked from criu */
if (!files_collected() && collect_image(&inet_sk_cinfo))
return -1;
+ network_status |= NETWORK_COLLECTED;
if (collect_binfmt_misc())
return -1;
@@ -2525,6 +2529,7 @@ skip_ns_bouncing:
/* Unlock network before disabling repair mode on sockets */
network_unlock();
+ network_status |= NETWORK_UNLOCK;
/*
* Stop getting sigchld, after we resume the tasks they
@@ -2734,6 +2739,14 @@ clean_cgroup:
fini_cgroup();
err:
cr_plugin_fini(CR_PLUGIN_STAGE__RESTORE, ret);
+ if (ret < 0) {
+ if (!!(network_status & NETWORK_COLLECTED)
+ && !files_collected() && collect_image(&inet_sk_cinfo))
+ pr_err("collect inet sk cinfo fail\n");
+
+ if (!!(network_status & NETWORK_UNLOCK))
+ network_unlock();
+ }
return ret;
}
--
2.34.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/baizg1107/criu.git
git@gitee.com:baizg1107/criu.git
baizg1107
criu
criu
master

搜索帮助