lxc/0036-containers-in-the-FREEZING-state-also-need-to-be-unf.patch

33 lines
997 B
Diff
Raw Normal View History

From 0b9387f46b4656b6f7f87abb86153013e561c242 Mon Sep 17 00:00:00 2001
From: zhongtao <zhongtao17@huawei.com>
Date: Mon, 11 Sep 2023 20:05:49 +0800
Subject: [PATCH] containers in the FREEZING state also need to be unfreeze
Signed-off-by: zhongtao <zhongtao17@huawei.com>
---
src/lxc/lxccontainer.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c
index cc6c5cd..3ce2ba7 100644
--- a/src/lxc/lxccontainer.c
+++ b/src/lxc/lxccontainer.c
@@ -546,7 +546,14 @@ static bool do_lxcapi_unfreeze(struct lxc_container *c)
return false;
s = lxc_getstate(c->name, c->config_path);
+#ifdef HAVE_ISULAD
+ // Prevent lxc from unexpectedly exiting when executing freeze,
+ // causing the container to be in the FREEZING state,
+ // making normal life cycle management impossible.
+ if (s == FROZEN || s == FREEZING)
+#else
if (s == FROZEN)
+#endif
return lxc_unfreeze(c->lxc_conf, c->name, c->config_path) == 0;
return true;
--
2.25.1