[CRIU] [PATCH] cgroup: rpc -- Fix @manage_cgroups option parsing
Cyrill Gorcunov
gorcunov at openvz.org
Tue Jul 14 12:30:53 PDT 2015
In commit c7d646afb3737 we introduced cgroup resotre
modes but when option passed via RPC code it simply
either true or false which erroniously maps to
CG_MODE_PROPS or CG_MODE_IGNORE modes.
Lets map @true to CG_MODE_SOFT to preserve backward
compatibility and enhance this option in future via
separate option.
Reported-by: Ross Boucher <rboucher at gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
cr-service.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/cr-service.c b/cr-service.c
index 60a728987c18..9c40989046b6 100644
--- a/cr-service.c
+++ b/cr-service.c
@@ -385,8 +385,14 @@ static int setup_opts_from_req(int sk, CriuOpts *req)
if (req->has_cpu_cap)
opts.cpu_cap = req->cpu_cap;
+ /*
+ * FIXME: For backward compatibility we setup
+ * soft mode here, need to enhance to support
+ * other modes as well via separate option
+ * probably.
+ */
if (req->has_manage_cgroups)
- opts.manage_cgroups = req->manage_cgroups;
+ opts.manage_cgroups = req->manage_cgroups ? CG_MODE_SOFT : CG_MODE_IGNORE;
if (req->has_auto_ext_mnt)
opts.autodetect_ext_mounts = req->auto_ext_mnt;
--
2.4.3
More information about the CRIU
mailing list