From 3a5cb29168b79e0e7514bbdf16c79cf52670b531 Mon Sep 17 00:00:00 2001 From: lifeng68 Date: Fri, 10 Jul 2020 11:56:20 +0800 Subject: [PATCH] lxc: do not communicat with lxc parent when unpause Signed-off-by: lifeng68 --- ...mmunicate-to-lxc-parent-when-unpause.patch | 72 +++++++++++++++++++ lxc.spec | 3 +- 2 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 0070-freeze-do-not-communicate-to-lxc-parent-when-unpause.patch diff --git a/0070-freeze-do-not-communicate-to-lxc-parent-when-unpause.patch b/0070-freeze-do-not-communicate-to-lxc-parent-when-unpause.patch new file mode 100644 index 0000000..6c7c124 --- /dev/null +++ b/0070-freeze-do-not-communicate-to-lxc-parent-when-unpause.patch @@ -0,0 +1,72 @@ +From e0387970de1ba7517dcfe88f32297775d90126f5 Mon Sep 17 00:00:00 2001 +From: lifeng68 +Date: Fri, 10 Jul 2020 11:51:20 +0800 +Subject: [PATCH 2/2] freeze: do not communicate to lxc parent when unpause + +Signed-off-by: lifeng68 +--- + src/lxc/lxccontainer.c | 31 +++++++++++++++++++++++++++++++ + 1 file changed, 31 insertions(+) + +diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c +index 6281a8a72..eef98df67 100644 +--- a/src/lxc/lxccontainer.c ++++ b/src/lxc/lxccontainer.c +@@ -516,6 +516,20 @@ static bool do_lxcapi_is_running(struct lxc_container *c) + + WRAP_API(bool, lxcapi_is_running) + ++#ifdef HAVE_ISULAD ++static bool do_lxcapi_freeze(struct lxc_container *c) ++{ ++ if (!c || !c->lxc_conf) { ++ return false; ++ } ++ ++ if (lxc_freeze(c->lxc_conf, c->name, c->config_path) < 0) { ++ return false; ++ } ++ ++ return true; ++} ++#else + static bool do_lxcapi_freeze(struct lxc_container *c) + { + lxc_state_t s; +@@ -529,9 +543,25 @@ static bool do_lxcapi_freeze(struct lxc_container *c) + + return true; + } ++#endif ++ + + WRAP_API(bool, lxcapi_freeze) + ++#ifdef HAVE_ISULAD ++static bool do_lxcapi_unfreeze(struct lxc_container *c) ++{ ++ if (!c || !c->lxc_conf) { ++ return false; ++ } ++ ++ if (lxc_unfreeze(c->lxc_conf, c->name, c->config_path) < 0) { ++ return false; ++ } ++ ++ return true; ++} ++#else + static bool do_lxcapi_unfreeze(struct lxc_container *c) + { + lxc_state_t s; +@@ -545,6 +575,7 @@ static bool do_lxcapi_unfreeze(struct lxc_container *c) + + return true; + } ++#endif + + WRAP_API(bool, lxcapi_unfreeze) + +-- +2.25.1 + diff --git a/lxc.spec b/lxc.spec index 6251f22..62d9a65 100644 --- a/lxc.spec +++ b/lxc.spec @@ -1,4 +1,4 @@ -%global _release 2020062401 +%global _release 2020071001 %global debug_package %{nil} Name: lxc @@ -77,6 +77,7 @@ Patch9065: 0066-lxc-fix-tests-build-error.patch Patch9066: 0067-set-normal-ret-value-when-populate-exist-device-successfully.patch Patch9067: 0068-lxc-config-default-cgroup-pattern-to-lxc-n.patch Patch9068: 0069-rootfs-support-use-host-rootfs-as-container-rootfs.patch +Patch9069: 0070-freeze-do-not-communicate-to-lxc-parent-when-unpause.patch BuildRequires: systemd-units git libtool graphviz docbook2X doxygen chrpath BuildRequires: pkgconfig(libseccomp) -- Gitee