From: Ian Jackson Subject: Re: [xen-unstable bisection] complete test-i386-xcpkern-i386-pv Date: Fri, 3 Jun 2011 15:05:14 +0100 Message-ID: <19944.59930.392840.140590@mariner.uk.xensource.com> References: <1307093013.775.328.camel@zakaz.uk.xensource.com> <19944.48204.474394.527965@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <19944.48204.474394.527965@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ian Campbell , "xen-devel@lists.xensource.com" , "keir@xen.org" , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org I wrote: > I think we need more diagnosis. I'll investigate. I was able to repro this trivially. Your analysis was nearly right. I have just pushed the fix below, which should sort it out I think. # HG changeset patch # User Ian Jackson # Date 1307109870 -3600 # Node ID 921dcd80f79120bd9938b4ee0fec7428b2da0f6e # Parent 0791661a32d8eba917c87feacf2c955b85521ad1 tools/hotplug: Fix hotplug hook script arrangements not to always fail The new feature introduced in 23401:a44b12ee2fd3 was broken; it in general always fails, at least if there are no hotplug scripts. If there are no hooks, call_hooks ends up running this: [ -x ".....*.hook" ] && . "..... *.hook" This does not directly trigger set -e and sigerr. However, it is the last command exected in call_hooks. So the return status of call_hooks is an error, and thus a sigerr happens when call_hooks returns. The bug affects xl and xm. However xl does not detect failure of the hotplug script. Change the script to use if...then rather than &&, as the latter has very confusing and undesirable semantics. Signed-off-by: Ian Jackson Committed-by: Ian Jackson diff -r 0791661a32d8 -r 921dcd80f791 tools/hotplug/Linux/xen-hotplug-common.sh --- a/tools/hotplug/Linux/xen-hotplug-common.sh Thu Jun 02 18:46:35 2011 +0100 +++ b/tools/hotplug/Linux/xen-hotplug-common.sh Fri Jun 03 15:04:30 2011 +0100 @@ -106,7 +106,7 @@ xenstore_write() { # call_hooks() { for f in /etc/xen/scripts/${1}-${2}.d/*.hook; do - [ -x "$f" ] && . "$f" + if [ -x "$f" ]; then . "$f"; fi done }