Re: [PATCH] Fix cgroups when all are mounted on /sys/fs/cgroup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09/10/2013 07:35 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
> 
> Some users in Ubuntu/Debian seem to have a setup where all the
> cgroup controllers are mounted on /sys/fs/cgroup rather than
> any /sys/fs/cgroup/<controller> name. In the loop which detects
> which controllers are present for a mount point we were modifying
> 'mnt_dir' field in the 'struct mntent' var, but not always restoring
> the original value. This caused detection to break in the all-in-one
> mount setup.
> 
> Fix that logic bug and add test case coverage for this mount
> setup.
> 
> Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
> ---
>  src/util/vircgroup.c  |  3 ++-
>  tests/vircgroupmock.c | 42 ++++++++++++++++++++++++++++++++++++---
>  tests/vircgrouptest.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 96 insertions(+), 4 deletions(-)
> 

> @@ -398,7 +431,10 @@ FILE *fopen(const char *path, const char *mode)
>      }
>      if (STREQ(path, "/proc/self/cgroup")) {
>          if (STREQ(mode, "r")) {
> -            return fmemopen((void *)procselfcgroups, strlen(procselfcgroups), mode);
> +            if (allinone)
> +                return fmemopen((void *)procselfcgroupsallinone, strlen(procselfcgroupsallinone), mode);

Maybe worth wrapping to avoid long lines; but that's trivial.

ACK.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]