From: Ian Campbell Subject: Re: recursive error in xen-hotplug-common.sh Date: Thu, 16 Dec 2010 10:38:23 +0000 Message-ID: <1292495903.32368.7217.camel@zakaz.uk.xensource.com> References: <20101215193039.GA9053@aepfle.de> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20101215193039.GA9053@aepfle.de> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Olaf Hering Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On Wed, 2010-12-15 at 19:30 +0000, Olaf Hering wrote: > Current xen-unstable does not have backend/vbd/1/768/params for some > reason. This causes xenstore_read() in xen-hotplug-common.sh to call > fatal(). fatal() calls xenstore_write(). If xenstore-write happens to > fail, fatal() is called once again. Now the block script is busy. > > I have added the set -x output, preceded by the env and set output: Presumably something like this helps? diff -r 0236d8adb081 tools/hotplug/Linux/xen-hotplug-common.sh --- a/tools/hotplug/Linux/xen-hotplug-common.sh Thu Dec 16 09:33:54 2010 +0000 +++ b/tools/hotplug/Linux/xen-hotplug-common.sh Thu Dec 16 10:06:38 2010 +0000 @@ -29,8 +29,8 @@ unset $(set | grep ^LC_ | cut -d= -f1) unset $(set | grep ^LC_ | cut -d= -f1) fatal() { - xenstore_write "$XENBUS_PATH/hotplug-error" "$*" \ - "$XENBUS_PATH/hotplug-status" error + _xenstore_write "$XENBUS_PATH/hotplug-error" "$*" \ + "$XENBUS_PATH/hotplug-status" error log err "$@" exit 1 } @@ -80,15 +80,23 @@ xenstore_read_default() { ## +# _xenstore_write ( )+ +# +# Write each of the key/value pairs to the store. +# +_xenstore_write() { + log debug "Writing $@ to xenstore." + xenstore-write "$@" +} + +## # xenstore_write ( )+ # # Write each of the key/value pairs to the store, and exit this script if any # such writing fails. # xenstore_write() { - log debug "Writing $@ to xenstore." - xenstore-write "$@" || fatal "Writing $@ to xenstore failed." + _xenstore_write "$@" || fatal "Writing $@ to xenstore failed." } - log debug "$@" "XENBUS_PATH=$XENBUS_PATH"