[PATCH v2 08/14] vircgroup.c: add virCgroupSetupCpuPeriodQuota()
Ján Tomko
jtomko at redhat.com
Sun Feb 23 12:39:49 UTC 2020
On Mon, Feb 17, 2020 at 04:29:15PM -0500, Daniel Henrique Barboza wrote:
>qemuSetupCgroupVcpuBW() and lxcSetVcpuBWLive() shares the
>same code to set CPU CFS period and quota. This code can be
>moved to a new virCgroupSetupCpuPeriodQuota() helper to
>avoid code repetition.
>
>A similar code is also executed in virLXCCgroupSetupCpuTune(),
>but without the rollback on error. Use the new helper in this
>function as well since the 'period' rollback, if not a
>straight improvement for virLXCCgroupSetupCpuTune(), is
>benign. And we end up cutting more code repetition.
>
>Signed-off-by: Daniel Henrique Barboza <danielhb413 at gmail.com>
>---
> src/libvirt_private.syms | 1 +
> src/lxc/lxc_cgroup.c | 11 ++---------
> src/lxc/lxc_driver.c | 32 +-------------------------------
> src/qemu/qemu_cgroup.c | 31 +------------------------------
> src/util/vircgroup.c | 38 ++++++++++++++++++++++++++++++++++++++
> src/util/vircgroup.h | 2 ++
> 6 files changed, 45 insertions(+), 70 deletions(-)
>
Reviewed-by: Ján Tomko <jtomko at redhat.com>
Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20200223/5ce04aa6/attachment-0001.sig>
More information about the libvir-list
mailing list