[PATCH v2 1/3] util: Move virGetCgroupValueRaw to vircgroup.c and rename it virGetValueRaw

Yang Fei yangfei85 at huawei.com
Thu Jul 15 13:41:46 UTC 2021



On 2021/7/14 22:17, Michal Prívozník wrote:
> On 7/14/21 2:28 PM, Yang Fei wrote:
>> Move virGetCgroupValueRaw from vircgroup.c, so that we can call
>> it more appropriately at any where. And change it to a more
>> generic name virGetValueRaw.
>> Replace virGetCgroupValueRaw by virGetValueRaw in cgroup data obtain.
>>
>> Signed-off-by: Yang Fei <yangfei85 at huawei.com>
>> ---
>>  src/util/vircgroup.c     | 29 ++---------------------------
>>  src/util/vircgrouppriv.h |  3 ---
>>  src/util/vircgroupv1.c   |  5 +++--
>>  src/util/vircgroupv2.c   |  5 +++--
>>  src/util/virutil.c       | 23 +++++++++++++++++++++++
>>  src/util/virutil.h       |  3 +++
>>  6 files changed, 34 insertions(+), 34 deletions(-)
> 
> I don't think this is necessary. We have whole family of functions that
> read a file and translate its contents into an integer. For instance
> virFileReadValueUllong().
> 
> BTW: make sure that 'ninja test' passes after each commit.
> 
> Michal
> 
> .
> 

Yes, virFileReadValueUllong() is also meets the requirement. I will drop this patch in next version.

Thanks for reminding me and I will be more careful afterwards.





More information about the libvir-list mailing list