factor out pivot_root code
factor out pivot_root code

Clean up and factor a bit the pivot_root code.

Signed-off-by: Daniel Lezcano <3211518dd4d87cb3f7ee12cb52e14b7fb2bc0446@fr.ibm.com>

lisongmin/lxc,major/lxc,ecarrara/lxc,bostjan/lxc,jirislaby/lxc,bostjan/lxc,thmo/lxc,usc-isi/lxc,ioops/lxc,rldleblanc/lxc,LynxChaus/lxc,caglar10ur/lxc,regit/lxc,lazy404/lxc,bostjan/lxc,JohnPeacockMessageSystems/lxc,major/lxc,abstrakraft/lxc-android-lxc,DarknessBeforeDawn/lxc,weizhenwei/lxc,terceiro/lxc,cjwatson/lxc,Ponce/lxc,akshaykarle/lxc,tych0/lxc,potatosalad/lxc,bmoar/lxc,smoser/lxc,ecarrara/lxc,jirislaby/lxc,ioops/lxc,fwilson42/lxc,bmoar/lxc,inokappa/lxc,yubo/lxc,hallyn/lxc,Distrotech/lxc,tych0/lxc,JohnPeacockMessageSystems/lxc,LynxChaus/lxc,sapun/lxc,QingweiPeterLan/cs188-lxc,lisongmin/lxc,DarknessBeforeDawn/lxc,sapun/lxc,terceiro/lxc,yubo/lxc,GreatFruitOmsk/lxc,fwilson42/lxc,codebauss/lxc,glensc/lxc,aeris/lxc,ioops/lxc,DarknessBeforeDawn/lxc,fwilson42/lxc,rowhit/lxc,raspberrypython/lxc,ksperis/lxc,GreatFruitOmsk/lxc,QingweiPeterLan/cs188-lxc,ojkastl/lxc_Patches,jirislaby/lxc,glensc/lxc,szaszg/lxc,Pelagicore/lxc,hkjolhede/lxc,virajs/lxc,hallyn/lxc,lazy404/lxc,ecarrara/lxc,Distrotech/lxc,codebauss/lxc,coconutpilot/lxc-gentoo-new,virajs/lxc,smoser/lxc,christiaan/lxc,armcc/lxc,hfuCN/lxc,hfuCN/lxc,hkjolhede/lxc,hkjolhede/lxc,usc-isi/lxc,rowhit/lxc,ksperis/lxc,smoser/lxc,ostap/lxc,Pelagicore/lxc,kylef/lxc,szaszg/lxc,szaszg/lxc,inokappa/lxc,federicobriata/lxc,aeris/lxc,thmo/lxc,ysbnim/lxc,regit/lxc,terceiro/lxc,lazy404/lxc,potatosalad/lxc,akshaykarle/lxc,Ponce/lxc,caglar10ur/lxc,GreatFruitOmsk/lxc,JohnPeacockMessageSystems/lxc,weizhenwei/lxc,lisongmin/lxc,Ponce/lxc,caglar10ur/lxc,usc-isi/lxc,ojkastl/lxc_Patches,codebauss/lxc,rldleblanc/lxc,armcc/lxc,ss1h2a3tw/lxc,hfuCN/lxc,abstrakraft/lxc-android-lxc,thmo/lxc,cjwatson/lxc,federicobriata/lxc,ostap/lxc,virajs/lxc,federicobriata/lxc,smoser/lxc,rldleblanc/lxc,ss1h2a3tw/lxc,ojkastl/lxc_Patches,Distrotech/lxc,efiop/lxc,glensc/lxc,ksperis/lxc,regit/lxc,ysbnim/lxc,LynxChaus/lxc,bmoar/lxc,ss1h2a3tw/lxc,raspberrypython/lxc,aeris/lxc,raspberrypython/lxc,abstrakraft/lxc-android-lxc,armcc/lxc,kylef/lxc,ysbnim/lxc,yubo/lxc,cjwatson/lxc,Pelagicore/lxc,major/lxc,efiop/lxc,efiop/lxc,rowhit/lxc,ojkastl/lxc_Patches,coconutpilot/lxc-gentoo-new,sapun/lxc,hallyn/lxc,abstrakraft/lxc-android-lxc,christiaan/lxc,QingweiPeterLan/cs188-lxc,christiaan/lxc,weizhenwei/lxc,akshaykarle/lxc,tych0/lxc