]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
containers in the FREEZING state also need to be unfreeze 4346/head
authorzhongtao <zhongtao17@huawei.com>
Wed, 13 Sep 2023 03:11:36 +0000 (11:11 +0800)
committerzhongtao <zhongtao17@huawei.com>
Thu, 14 Sep 2023 03:35:04 +0000 (11:35 +0800)
Signed-off-by: zhongtao <zhongtao17@huawei.com>
src/lxc/lxccontainer.c

index 9805b7a3f368c7d87f5bf8e77fa3c14db6c40837..ec6afbe243bd43993071c608c7ddc17b2de9fcc4 100644 (file)
@@ -544,7 +544,10 @@ static bool do_lxcapi_unfreeze(struct lxc_container *c)
                return false;
 
        s = lxc_getstate(c->name, c->config_path, 0);
-       if (s == FROZEN) {
+       // 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) {
                ret = cgroup_unfreeze(c->name, c->config_path, -1);
                if (ret == -ENOCGROUP2)
                        ret = lxc_unfreeze(c->lxc_conf, c->name, c->config_path);