From 5c815672d648d54bcd01a4293c03f8ae4abe4e0a Mon Sep 17 00:00:00 2001 From: zhongtao Date: Mon, 11 Sep 2023 20:09:01 +0800 Subject: [PATCH] containers in the FREEZING state also need to be unfreeze Signed-off-by: zhongtao --- ...e-FREEZING-state-also-need-to-be-unf.patch | 32 +++++++++++++++++++ lxc.spec | 9 +++++- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 0036-containers-in-the-FREEZING-state-also-need-to-be-unf.patch diff --git a/0036-containers-in-the-FREEZING-state-also-need-to-be-unf.patch b/0036-containers-in-the-FREEZING-state-also-need-to-be-unf.patch new file mode 100644 index 0000000..810307f --- /dev/null +++ b/0036-containers-in-the-FREEZING-state-also-need-to-be-unf.patch @@ -0,0 +1,32 @@ +From 0b9387f46b4656b6f7f87abb86153013e561c242 Mon Sep 17 00:00:00 2001 +From: zhongtao +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 +--- + 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 + diff --git a/lxc.spec b/lxc.spec index eb47190..998775b 100644 --- a/lxc.spec +++ b/lxc.spec @@ -1,4 +1,4 @@ -%global _release 2022102422 +%global _release 2022102423 Name: lxc Version: 4.0.3 @@ -43,6 +43,7 @@ Patch0032: 0032-fix-load-bpf-failed.patch Patch0033: 0033-fix-mount-device-path-incorrect.patch Patch0034: 0034-add-secure-compile-macro.patch Patch0035: 0035-codecheck-fix.patch +Patch0036: 0036-containers-in-the-FREEZING-state-also-need-to-be-unf.patch BuildRequires: systemd-units git libtool graphviz docbook2X doxygen chrpath BuildRequires: pkgconfig(libseccomp) @@ -229,6 +230,12 @@ rm -rf %{buildroot}%{_sysconfdir}/default/%{name} %endif %changelog +* Mon Sep 11 2023 zhongtao - 4.0.3-2022102423 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC: containers in the FREEZING state also need to be unfreeze + * Wed Sep 06 2023 zhangxiaoyu - 4.0.3-2022102422 - Type:bugfix - ID:NA -- Gitee