]> xenbits.xensource.com Git - libvirt.git/commit
cgroup: Change virCgroupRemove to remove all descendant groups at first
authorRyota Ozaki <ozaki.ryota@gmail.com>
Wed, 23 Jun 2010 16:00:55 +0000 (01:00 +0900)
committerEric Blake <eblake@redhat.com>
Wed, 23 Jun 2010 20:30:19 +0000 (14:30 -0600)
commit842b51ff5d3f4d98bb518295aaff28c9ac4bbfa6
tree6cd93dbdc2a285d8a7b87501e5554457ea70cd0f
parent4cc2b6d6765393ce4a372e706eb1ba5543cc817c
cgroup: Change virCgroupRemove to remove all descendant groups at first

As same as normal directories, a cgroup cannot be removed if it
contains sub groups. This patch changes virCgroupRemove to remove
all descendant groups (subdirectories) of a target group before
removing the target group.

The handling is required when we run lxc with ns subsystem of cgroup.
Ns subsystem automatically creates child cgroups on every process
forks, but unfortunately the groups are not removed on process exits,
so we have to remove them by ourselves.

With this patch, such child (and descendant) groups are surely removed
at lxc shutdown, i.e., lxcVmCleanup which calls virCgroupRemove.
src/util/cgroup.c