[libvirt] [PATCH 1 of 2] Add internal cgroup manipulation functions

Daniel Veillard veillard at redhat.com
Fri Oct 3 14:32:45 UTC 2008

On Wed, Oct 01, 2008 at 01:19:03PM -0700, Dan Smith wrote:
> This patch adds src/cgroup.{c,h} with support for creating and manipulating
> cgroups.
> All groups created with the internal API are forced under $mount/libvirt/
> to keep everything together.  The first time a group is created, the libvirt
> directory is also created, and the settings from the root are inherited.
> The code creates groups in all mounts requires to get memory and devices
> functionality.  When setting a value, the appropriate mount is determined
> and the value is set there.  I have tested this with all controllers mounted
> in a single location, as well as all of them mounted separately.
> Changes:
>  - Handle multiple mount points
>  - Add more abstract internal API, per recent discussion
>  - Consider absence of memory or devices controllers as "no cgroup support"

  Okay, the patch looks fine to me, things looks simple and without
risk. I have ony one stylistic issue, which is that I usually prefer to
have the comment about the funtions and its parameter in the C code
rather than on the header (keeping it closer to the code means one
more easilly update/fix it, and if you use something like ctags
to get to the function implementation you see the comment immediately
but it's cosmetic).

   +1 for me,


Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel at veillard.com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

More information about the libvir-list mailing list