提交 0bd4ad19 编写于 作者: P Pavel Hrdina

vircgroupv2: fix setting cpu.max period

When we set cpu.max period we need to parse the cpu.max file first as
it contains both quota and period values separated by space.  When only
a single number is written to that file it will set quota.  However,
in order to change period we need to write both values.

The code was prepared for that but mistakenly used new line to end the
string with the first value.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1749227Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
Reviewed-by: NErik Skultety <eskultet@redhat.com>
上级 0ca18eba
...@@ -1508,7 +1508,7 @@ virCgroupV2SetCpuCfsPeriod(virCgroupPtr group, ...@@ -1508,7 +1508,7 @@ virCgroupV2SetCpuCfsPeriod(virCgroupPtr group,
_("Invalid 'cpu.max' data.")); _("Invalid 'cpu.max' data."));
return -1; return -1;
} }
*tmp = '\n'; *tmp = '\0';
if (virAsprintf(&value, "%s %llu", str, cfs_period) < 0) if (virAsprintf(&value, "%s %llu", str, cfs_period) < 0)
return -1; return -1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册