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: SUBSYSTEM=xen-backend XENBUS_TYPE=vbd DEVPATH=/devices/xen-backend/vbd-1-768 ACTION=add PWD=/ UDEV_LOG=3 XENBUS_PATH=backend/vbd/1/768 UDEVD_EVENT=1 XENBUS_BASE_PATH=backend SHLVL=1 SEQNUM=1478 _=/usr/bin/env ACTION=add BASH=/bin/bash BASH_ARGC=([0]="1") BASH_ARGV=([0]="add") BASH_LINENO=([0]="0") BASH_SOURCE=([0]="/etc/xen/scripts/block") BASH_VERSINFO=([0]="3" [1]="2" [2]="51" [3]="1" [4]="release" [5]="x86_64-suse-linux-gnu") BASH_VERSION=''3.2.51(1)-release'' DEVPATH=/devices/xen-backend/vbd-1-768 DIRSTACK=() EUID=0 GROUPS=() HOSTNAME=stein-schneider HOSTTYPE=x86_64 IFS=$'' \t\n'' MACHTYPE=x86_64-suse-linux-gnu OPTERR=1 OPTIND=1 OSTYPE=linux-gnu PATH=/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:. PIPESTATUS=([0]="0") PPID=5717 PS4=''+ '' PWD=/ SEQNUM=1478 SHELL=/bin/bash SHELLOPTS=braceexpand:hashall:interactive-comments SHLVL=1 SUBSYSTEM=xen-backend TERM=dumb UDEVD_EVENT=1 UDEV_LOG=3 UID=0 XENBUS_BASE_PATH=backend XENBUS_PATH=backend/vbd/1/768 XENBUS_TYPE=vbd _=echo ++ dirname /etc/xen/scripts/block + dir=/etc/xen/scripts + . /etc/xen/scripts/block-common.sh +++ dirname /etc/xen/scripts/block ++ dir=/etc/xen/scripts ++ . /etc/xen/scripts/xen-hotplug-common.sh ++++ dirname /etc/xen/scripts/block +++ dir=/etc/xen/scripts +++ . /etc/xen/scripts/hotplugpath.sh ++++ SBINDIR=/usr/sbin ++++ BINDIR=/usr/bin ++++ LIBEXEC=/usr/lib/xen/bin ++++ LIBDIR=/usr/lib64 ++++ SHAREDIR=/usr/share ++++ PRIVATE_BINDIR=/usr/lib64/xen/bin ++++ XENFIRMWAREDIR=/usr/lib/xen/boot ++++ XEN_CONFIG_DIR=/etc/xen ++++ XEN_SCRIPT_DIR=/etc/xen/scripts ++++ XEN_LOCK_DIR=/var/lock +++ . /etc/xen/scripts/logging.sh +++ . /etc/xen/scripts/xen-script-common.sh ++++ set -e +++ . /etc/xen/scripts/locking.sh ++++ LOCK_SLEEPTIME=1 ++++ LOCK_SPINNING_RETRIES=5 ++++ LOCK_RETRIES=100 ++++ LOCK_BASEDIR=/var/run/xen-hotplug +++ export PATH=/usr/bin:/usr/sbin:/usr/lib/xen/bin:/usr/lib64/xen/bin:/sbin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:. +++ PATH=/usr/bin:/usr/sbin:/usr/lib/xen/bin:/usr/lib64/xen/bin:/sbin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:. +++ export LANG=POSIX +++ LANG=POSIX ++++ set ++++ grep ''^LC_'' ++++ cut -d= -f1 +++ unset +++ trap sigerr ERR +++ log debug add XENBUS_PATH=backend/vbd/1/768 +++ local level=debug +++ shift +++ logger -p daemon.debug -- /etc/xen/scripts/block: add XENBUS_PATH=backend/vbd/1/768 ++ findCommand add ++ for arg in ''"$@"'' ++ expr index add ++ command=add ++ return ++ ''['' add ''!='' add '']'' ++ XENBUS_PATH=backend/vbd/1/768 ++ xenstore_read_default backend/vbd/1/768/type MISSING ++ xenstore-read backend/vbd/1/768/type ++ echo MISSING + t=MISSING + case "$command" in ++ xenstore_read_default backend/vbd/1/768/physical-device MISSING ++ xenstore-read backend/vbd/1/768/physical-device ++ echo MISSING + phys=MISSING + ''['' MISSING ''!='' MISSING '']'' + ''['' -n MISSING '']'' ++ xenstore_read backend/vbd/1/768/params +++ xenstore-read backend/vbd/1/768/params xenstore-read: couldn''t read path backend/vbd/1/768/params +++ true ++ local v++ ''['' '''' ''!='' '''' '']'' ++ fatal ''xenstore-read backend/vbd/1/768/params failed.'' ++ xenstore_write backend/vbd/1/768/hotplug-error ''xenstore-read backend/vbd/1/768/params failed.'' backend/vbd/1/768/hotplug-status error ++ log debug ''Writing backend/vbd/1/768/hotplug-error'' ''xenstore-read backend/vbd/1/768/params failed.'' backend/vbd/1/768/hotplug-status ''error to xenstore.'' ++ local level=debug ++ shift ++ logger -p daemon.debug -- /etc/xen/scripts/block: ''Writing backend/vbd/1/768/hotplug-error'' ''xenstore-read backend/vbd/1/768/params failed.'' backend/vbd/1/768/hotplug-status ''error to xenstore.'' ++ xenstore-write backend/vbd/1/768/hotplug-error ''xenstore-read backend/vbd/1/768/params failed.'' backend/vbd/1/768/hotplug-status error xenstore-write: could not write path backend/vbd/1/768/hotplug-error ++ fatal ''Writing backend/vbd/1/768/hotplug-error'' ''xenstore-read backend/vbd/1/768/params failed.'' backend/vbd/1/768/hotplug-status ''error to xenstore failed.'' ++ xenstore_write backend/vbd/1/768/hotplug-error ''Writing backend/vbd/1/768/hotplug-error xenstore-read backend/vbd/1/768/params failed. backend/vbd/1/768/hotplug-status error to xenstore failed.'' backend/vbd/1/768/hotplug-status error ++ log debug ''Writing backend/vbd/1/768/hotplug-error'' ''Writing backend/vbd/1/768/hotplug-error xenstore-read backend/vbd/1/768/params failed. backend/vbd/1/768/hotplug-status error to xenstore failed.'' backend/vbd/1/768/hotplug-status ''error to xenstore.'' ++ local level=debug ++ shift ++ logger -p daemon.debug -- /etc/xen/scripts/block: ''Writing backend/vbd/1/768/hotplug-error'' ''Writing backend/vbd/1/768/hotplug-error xenstore-read backend/vbd/1/768/params failed. backend/vbd/1/768/hotplug-status error to xenstore failed.'' backend/vbd/1/768/hotplug-status ''error to xenstore.'' ++ xenstore-write backend/vbd/1/768/hotplug-error ''Writing backend/vbd/1/768/hotplug-error xenstore-read backend/vbd/1/768/params failed. backend/vbd/1/768/hotplug-status error to xenstore failed.'' backend/vbd/1/768/hotplug-status error xenstore-write: could not write path backend/vbd/1/768/hotplug-error ++ fatal ''Writing backend/vbd/1/768/hotplug-error'' ''Writing backend/vbd/1/768/hotplug-error xenstore-read backend/vbd/1/768/params failed. backend/vbd/1/768/hotplug-status error to xenstore failed.'' backend/vbd/1/768/hotplug-status ''error to xenstore failed.'' ++ xenstore_write backend/vbd/1/768/hotplug-error ''Writing backend/vbd/1/768/hotplug-error Writing backend/vbd/1/768/hotplug-error xenstore-read backend/vbd/1/768/params failed. backend/vbd/1/768/hotplug-status error to xenstore failed. backend/vbd/1/768/hotplug-status error to xenstore failed.'' backend/vbd/1/768/hotplug-status error ++ log debug ''Writing backend/vbd/1/768/hotplug-error'' ''Writing backend/vbd/1/768/hotplug-error Writing backend/vbd/1/768/hotplug-error xenstore-read backend/vbd/1/768/params failed. backend/vbd/1/768/hotplug-status error to xenstore failed. backend/vbd/1/768/hotplug-status error to xenstore failed.'' backend/vbd/1/768/hotplug-status ''error to xenstore.'' ++ local level=debug .... Olaf _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Campbell
2010-Dec-16 10:38 UTC
Re: [Xen-devel] recursive error in xen-hotplug-common.sh
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 (<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" _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Olaf Hering
2010-Dec-16 11:17 UTC
Re: [Xen-devel] recursive error in xen-hotplug-common.sh
On Thu, Dec 16, Ian Campbell wrote:> 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?Yes, this helps for the very long lines. Thanks. There is still some loop, I will debug it after lunch. The xenstore-ls output is attached for reference. Olaf ... xenstore-read: xenstore-read: couldn''t read path backend/vbd/1/832/params xenstore-read: couldn''t read path backend/vbd/1/5632/params couldn''t read path backend/vbd/1/768/params RTNETLINK answers: Operation not supported xenstore-write: could not write path backend/vbd/1/832/hotplug-error xenstore-write: could not write path backend/vbd/1/5632/hotplug-error xenstore-write: could not write path backend/vbd/1/768/hotplug-error xenstore-write: could not write path backend/vbd/1/832/hotplug-error xenstore-write: xenstore-write: could not write path backend/vbd/1/5632/hotplug-errorcould not write path backend/vbd/1/768/hotplug-error xenstore-write: could not write path backend/vbd/1/5632/hotplug-error xenstore-write: could not write path backend/vbd/1/832/hotplug-error xenstore-write: could not write path backend/vbd/1/768/hotplug-error xenstore-write: could not write path backend/vbd/1/832/hotplug-error xenstore-write: could not write path backend/vbd/1/5632/hotplug-error xenstore-write: could not write path backend/vbd/1/768/hotplug-error xenstore-write: could not write path backend/vbd/1/832/hotplug-error xenstore-write: could not write path backend/vbd/1/5632/hotplug-error xenstore-write: could not write path backend/vbd/1/768/hotplug-error xenstore-write: could not write path backend/vbd/1/832/hotplug-error xenstore-write: could not write path backend/vbd/1/5632/hotplug-error xenstore-write: could not write path backend/vbd/1/768/hotplug-error xenstore-write: could not write path backend/vbd/1/832/hotplug-error xenstore-write: xenstore-write: could not write path backend/vbd/1/5632/hotplug-error could not write path backend/vbd/1/768/hotplug-error xenstore-write: could not write path backend/vbd/1/832/hotplug-error xenstore-write: could not write path backend/vbd/1/5632/hotplug-error xenstore-write: could not write path backend/vbd/1/768/hotplug-error .... _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Jackson
2010-Dec-16 17:58 UTC
Re: [Xen-devel] recursive error in xen-hotplug-common.sh
Ian Campbell writes ("Re: [Xen-devel] recursive error in xen-hotplug-common.sh"):> Presumably something like this helps?This looked good so I applied it. Thanks to both of you. Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel