restore: Hoist handler to function level
restore: Hoist handler to function level

On Tue, Oct 07, 2014 at 07:33:07PM +0000, Tycho Andersen wrote:
> This commit is in preparation for the cgroups create work, since we will need
> the handler in both the parent and the child. This commit also re-works how
> errors are propagated to be less verbose.

Here is an updated version:

From 941623498a49551411ccf185146061f3f37d3a67 Mon Sep 17 00:00:00 2001
From: Tycho Andersen <10c18fcb898ee6b17d6575d444b125d10b3f4d6a@canonical.com>
Date: Tue, 7 Oct 2014 19:13:51 +0000
Subject: [PATCH 1/2] restore: Hoist handler to function level

This commit is in preparation for the cgroups create work, since we will need
the handler in both the parent and the child. This commit also re-works how
errors are propagated to be less verbose.

v2: rename error to has_error, handle it correctly, and remove some diff noise

Signed-off-by: Tycho Andersen <10c18fcb898ee6b17d6575d444b125d10b3f4d6a@canonical.com>
Acked-by: Serge E. Hallyn <3df611b026e4639bee8aef7a4beb2e39fcebb313@ubuntu.com>

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