cgroup: recursively delete cgroups when asked
cgroup: recursively delete cgroups when asked

Currently when a container is shut down, lxc walks the set of all
cgroup paths it created, in reverse order, and tries to remove them.
This doesn't suffice if the container has also created new cgroups.

It'd be impolite to recursively remove all the cgroup paths we created,
since this can include '/lxc' and thereunder all other containers
started since.

This patch changes container shutdown to only delete the container's own
path, but do so recursively.  Note that if we fail during startup,
the container won't have created any cgroup paths so it the old
way works fine.

Signed-off-by: Serge Hallyn <3df611b026e4639bee8aef7a4beb2e39fcebb313@ubuntu.com>
Acked-by: Stéphane Graber <089afc6d81f66f1168a9849e15660feae286e024@ubuntu.com>

thmo/lxc,ss1h2a3tw/lxc,major/lxc,yubo/lxc,lazy404/lxc,ojkastl/lxc_Patches,lazy404/lxc,Distrotech/lxc,hfuCN/lxc,armcc/lxc,codebauss/lxc,weizhenwei/lxc,jirislaby/lxc,Pelagicore/lxc,virajs/lxc,ecarrara/lxc,aeris/lxc,lazy404/lxc,hkjolhede/lxc,federicobriata/lxc,bmoar/lxc,lisongmin/lxc,cjwatson/lxc,DarknessBeforeDawn/lxc,bmoar/lxc,GreatFruitOmsk/lxc,fwilson42/lxc,ojkastl/lxc_Patches,cjwatson/lxc,terceiro/lxc,regit/lxc,JohnPeacockMessageSystems/lxc,GreatFruitOmsk/lxc,aeris/lxc,efiop/lxc,akshaykarle/lxc,weizhenwei/lxc,hfuCN/lxc,tych0/lxc,hallyn/lxc,akshaykarle/lxc,Ponce/lxc,DarknessBeforeDawn/lxc,fwilson42/lxc,sapun/lxc,yubo/lxc,regit/lxc,terceiro/lxc,LynxChaus/lxc,raspberrypython/lxc,bostjan/lxc,ioops/lxc,akshaykarle/lxc,ksperis/lxc,armcc/lxc,federicobriata/lxc,terceiro/lxc,DarknessBeforeDawn/lxc,ss1h2a3tw/lxc,caglar10ur/lxc,bmoar/lxc,ecarrara/lxc,JohnPeacockMessageSystems/lxc,rldleblanc/lxc,QingweiPeterLan/cs188-lxc,major/lxc,bostjan/lxc,Pelagicore/lxc,LynxChaus/lxc,tych0/lxc,federicobriata/lxc,christiaan/lxc,ysbnim/lxc,hkjolhede/lxc,tych0/lxc,codebauss/lxc,bostjan/lxc,lisongmin/lxc,ss1h2a3tw/lxc,Ponce/lxc,sapun/lxc,efiop/lxc,rowhit/lxc,thmo/lxc,virajs/lxc,cjwatson/lxc,JohnPeacockMessageSystems/lxc,LynxChaus/lxc,hallyn/lxc,Distrotech/lxc,weizhenwei/lxc,szaszg/lxc,fwilson42/lxc,ysbnim/lxc,ksperis/lxc,QingweiPeterLan/cs188-lxc,regit/lxc,yubo/lxc,codebauss/lxc,jirislaby/lxc,hkjolhede/lxc,christiaan/lxc,virajs/lxc,jirislaby/lxc,thmo/lxc,rldleblanc/lxc,ysbnim/lxc,ojkastl/lxc_Patches,aeris/lxc,ksperis/lxc,GreatFruitOmsk/lxc,rldleblanc/lxc,ecarrara/lxc,hfuCN/lxc,ioops/lxc,rowhit/lxc,caglar10ur/lxc,hallyn/lxc,ojkastl/lxc_Patches,christiaan/lxc,lisongmin/lxc,efiop/lxc,raspberrypython/lxc,raspberrypython/lxc,Ponce/lxc,szaszg/lxc,caglar10ur/lxc,major/lxc,QingweiPeterLan/cs188-lxc,Distrotech/lxc,sapun/lxc,ioops/lxc,armcc/lxc,rowhit/lxc,Pelagicore/lxc,szaszg/lxc