diff options
author | Ian Campbell <ian.campbell@citrix.com> | 2010-12-16 17:58:00 +0000 |
---|---|---|
committer | Ian Campbell <ian.campbell@citrix.com> | 2010-12-16 17:58:00 +0000 |
commit | e40c1e449e1aa3e1ab8779b83371198e6e2275c2 (patch) | |
tree | 1a9d3ed4c6f1530bcc1d15519d909d24ad2d9d8b /tools/hotplug | |
parent | 08d26f71bcb73e9f799515324539cb0348ce1c00 (diff) | |
download | xen-e40c1e449e1aa3e1ab8779b83371198e6e2275c2.tar.gz xen-e40c1e449e1aa3e1ab8779b83371198e6e2275c2.tar.bz2 xen-e40c1e449e1aa3e1ab8779b83371198e6e2275c2.zip |
tools/hotplug: Do not recursively invoke xenstore_write on error
This fixes a possible infinite recursion.
From: Ian Campbell <Ian.Campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/hotplug')
-rw-r--r-- | tools/hotplug/Linux/xen-hotplug-common.sh | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/tools/hotplug/Linux/xen-hotplug-common.sh b/tools/hotplug/Linux/xen-hotplug-common.sh index d63b7660c6..370f9ade2f 100644 --- a/tools/hotplug/Linux/xen-hotplug-common.sh +++ b/tools/hotplug/Linux/xen-hotplug-common.sh @@ -29,8 +29,8 @@ export LANG="POSIX" 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 (<path> <value>)+ +# +# Write each of the key/value pairs to the store. +# +_xenstore_write() { + log debug "Writing $@ to xenstore." + xenstore-write "$@" +} + +## # xenstore_write (<path> <value>)+ # # 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" |