[PATCH v2 07/14] vircgroup.c: add virCgroupSetupCpuShares()

Ján Tomko jtomko at redhat.com
Sun Feb 23 12:38:12 UTC 2020


On Mon, Feb 17, 2020 at 04:29:14PM -0500, Daniel Henrique Barboza wrote:
>The code that calls virCgroupSetCpuShares() and virCgroupGetCpuShares()
>is repeated in 4 different places. Let's put it in a new
>virCgroupSetupCpuShares() to avoid code repetition.
>
>There's a reason of why we execute a Get in the same value we
>just executed Set, explained in detail by commit 97814d8ab3.

Whoa, that was a long time ago.

>Let's add a gist of the reasoning behind it as a comment in
>this new function as well.
>
>Signed-off-by: Daniel Henrique Barboza <danielhb413 at gmail.com>
>---
> src/libvirt_private.syms |  1 +
> src/lxc/lxc_cgroup.c     |  5 +----
> src/lxc/lxc_driver.c     |  6 ++----
> src/qemu/qemu_cgroup.c   |  5 ++---
> src/qemu/qemu_driver.c   |  5 +----
> src/util/vircgroup.c     | 20 ++++++++++++++++++++
> src/util/vircgroup.h     |  2 ++
> 7 files changed, 29 insertions(+), 15 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/9171031d/attachment-0001.sig>


More information about the libvir-list mailing list