[CRIU] [PATCH] Enable manage cgroup modes in criu service

Hui Kang hkang.sunysb at gmail.com
Wed Aug 5 07:56:32 PDT 2015


Hi, Ruslan and Cyrill
Thanks for your suggestions. i will re-submit the patch.

- Hui

On Wed, Aug 5, 2015 at 3:12 AM, Ruslan Kuprieiev <kupruser at gmail.com> wrote:
> Hi Hui,
>
>
> On 08/05/2015 01:56 AM, Hui Kang wrote:
>>
>>  From c0a95f908eef92ec2c1199fc7a333654d944a8de Mon Sep 17 00:00:00 2001
>> From: Hui Kang <hkang.sunysb at gmail.com>
>> Date: Tue, 4 Aug 2015 22:41:14 +0000
>> Subject: [PATCH] Enable manage cgroup modes in criu service
>>
>> Signed-off-by: Hui Kang <hkang.sunysb at gmail.com>
>> ---
>>   cr-service.c       | 2 +-
>>   lib/criu.c         | 4 ++--
>>   lib/criu.h         | 4 ++--
>>   protobuf/rpc.proto | 2 +-
>>   4 files changed, 6 insertions(+), 6 deletions(-)
>>
>> diff --git a/cr-service.c b/cr-service.c
>> index 105787e..ba442ad 100644
>> --- a/cr-service.c
>> +++ b/cr-service.c
>> @@ -398,7 +398,7 @@ static int setup_opts_from_req(int sk, CriuOpts *req)
>>        * probably.
>>        */
>>       if (req->has_manage_cgroups)
>> -        opts.manage_cgroups = req->manage_cgroups ? CG_MODE_SOFT :
>> CG_MODE_IGNORE;
>> +        opts.manage_cgroups = req->manage_cgroups;
>>
>>       if (req->has_auto_ext_mnt)
>>           opts.autodetect_ext_mounts = req->auto_ext_mnt;
>> diff --git a/lib/criu.c b/lib/criu.c
>> index 3c194a1..a7c2dc5 100644
>> --- a/lib/criu.c
>> +++ b/lib/criu.c
>> @@ -364,13 +364,13 @@ void criu_set_root(char *root)
>>       criu_local_set_root(global_opts, root);
>>   }
>>
>> -void criu_local_set_manage_cgroups(criu_opts *opts, bool manage)
>> +void criu_local_set_manage_cgroups(criu_opts *opts, unsigned int manage)
>>   {
>>       opts->rpc->has_manage_cgroups = true;
>>       opts->rpc->manage_cgroups = manage;
>>   }
>>
>> -void criu_set_manage_cgroups(bool manage)
>> +void criu_set_manage_cgroups(unsigned int manage)
>>   {
>>       criu_local_set_manage_cgroups(global_opts, manage);
>>   }
>> diff --git a/lib/criu.h b/lib/criu.h
>> index 3cb0322..e3817e6 100644
>> --- a/lib/criu.h
>> +++ b/lib/criu.h
>> @@ -66,7 +66,7 @@ void criu_set_log_level(int log_level);
>>   void criu_set_log_file(char *log_file);
>>   void criu_set_cpu_cap(unsigned int cap);
>>   void criu_set_root(char *root);
>> -void criu_set_manage_cgroups(bool manage);
>> +void criu_set_manage_cgroups(unsigned int manage);
>
>
>
> This will break backward compatibility.
>
>>   void criu_set_auto_ext_mnt(bool val);
>>   void criu_set_ext_sharing(bool val);
>>   void criu_set_ext_masters(bool val);
>> @@ -165,7 +165,7 @@ void criu_local_set_log_level(criu_opts *opts, int
>> log_level);
>>   void criu_local_set_log_file(criu_opts *opts, char *log_file);
>>   void criu_local_set_cpu_cap(criu_opts *opts, unsigned int cap);
>>   void criu_local_set_root(criu_opts *opts, char *root);
>> -void criu_local_set_manage_cgroups(criu_opts *opts, bool manage);
>> +void criu_local_set_manage_cgroups(criu_opts *opts, unsigned int manage);
>>   void criu_local_set_auto_ext_mnt(criu_opts *opts, bool val);
>>   void criu_local_set_ext_sharing(criu_opts *opts, bool val);
>>   void criu_local_set_ext_masters(criu_opts *opts, bool val);
>> diff --git a/protobuf/rpc.proto b/protobuf/rpc.proto
>> index 2f4d0c0..f167ad8 100644
>> --- a/protobuf/rpc.proto
>> +++ b/protobuf/rpc.proto
>> @@ -60,7 +60,7 @@ message criu_opts {
>>       repeated string            exec_cmd    = 22;
>>
>>       repeated ext_mount_map        ext_mnt        = 23;
>> -    optional bool            manage_cgroups    = 24;
>> +    optional uint32            manage_cgroups    = 24;
>
>
> This will break protobuf wire, breaking backward compatibility.
>
>>       repeated cgroup_root        cg_root        = 25;
>>
>>       optional bool            rst_sibling    = 26; /* swrk only */
>
>
> Consider adding an optional int manage_cgroups_mode and
> criu_set_manage_cgroups_mode(mode) instead.
>
>
> Thanks,
> Ruslan
>
>


More information about the CRIU mailing list