[libvirt] [PATCH 2/9] vircgroup: fix bug in virCgroupEnableMissingControllers

Pavel Hrdina posted 9 patches 5 years, 12 months ago
There is a newer version of this series
[libvirt] [PATCH 2/9] vircgroup: fix bug in virCgroupEnableMissingControllers
Posted by Pavel Hrdina 5 years, 12 months ago
If we are on host with systemd we need to build cgroup hierarchy
ourselves for controllers that are not managed by systemd.

As a starting parent we need need to force root group because
virCgroupMakeGroup() takes that parent in order to inherit values
for cpuset controller.

By default cpuset controller is managed by systemd so we will never
hit the issue but for v2 cgroups we need to use parent cgroup every
time.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
---
 src/util/vircgroup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
index 6aa30a82be..2328957818 100644
--- a/src/util/vircgroup.c
+++ b/src/util/vircgroup.c
@@ -1495,7 +1495,7 @@ virCgroupEnableMissingControllers(char *path,
     int ret = -1;
 
     if (virCgroupNew(pidleader,
-                     "",
+                     "/",
                      NULL,
                      controllers,
                      &parent) < 0)
-- 
2.17.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 2/9] vircgroup: fix bug in virCgroupEnableMissingControllers
Posted by Fabiano Fidêncio 5 years, 12 months ago
On Tue, Sep 18, 2018 at 2:17 PM, Pavel Hrdina <phrdina@redhat.com> wrote:

> If we are on host with systemd we need to build cgroup hierarchy
> ourselves for controllers that are not managed by systemd.
>
> As a starting parent we need need to force root group because
>

typo: need need -> need


> virCgroupMakeGroup() takes that parent in order to inherit values
> for cpuset controller.
>
> By default cpuset controller is managed by systemd so we will never
> hit the issue but for v2 cgroups we need to use parent cgroup every
> time.
>
> Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
>

Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>


> ---
>  src/util/vircgroup.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
> index 6aa30a82be..2328957818 100644
> --- a/src/util/vircgroup.c
> +++ b/src/util/vircgroup.c
> @@ -1495,7 +1495,7 @@ virCgroupEnableMissingControllers(char *path,
>      int ret = -1;
>
>      if (virCgroupNew(pidleader,
> -                     "",
> +                     "/",
>                       NULL,
>                       controllers,
>                       &parent) < 0)
> --
> 2.17.1
>
> --
> libvir-list mailing list
> libvir-list@redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list
>
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list