Commit 0162665c authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

cgroup: rpc -- Fix @manage_cgroups option parsing

In commit c7d646af 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: 's avatarRoss Boucher <rboucher@gmail.com>
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent de70936e
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment