[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH RFC 01/18] xen/tools: Fix virtual disks helper scripts.



On Wed, May 18, 2016 at 07:32:24PM +0300, Andrii Anisov wrote:
> This patch makes virtual disks helper scripts be functional
> in busybox environment. Actually we call sh insteand of bash and
> rewrite loop with counter to be properly parsed by ash.
> 
> Signed-off-by: Andrii Anisov <andrii.anisov@xxxxxxxxxxxxxxx>
> Signed-off-by: Andrii Tseglytskyi <andrii.tseglytskyi@xxxxxxxxxxxxxxx>
> ---
>  tools/hotplug/Linux/block                    | 2 +-
>  tools/hotplug/Linux/locking.sh               | 9 +++++++--
>  tools/hotplug/Linux/xen-hotplug-common.sh.in | 2 +-
>  3 files changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/tools/hotplug/Linux/block b/tools/hotplug/Linux/block
> index 8d2ee9d..6a725db 100644
> --- a/tools/hotplug/Linux/block
> +++ b/tools/hotplug/Linux/block
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/bin/sh
>  
>  dir=$(dirname "$0")
>  . "$dir/block-common.sh"
> diff --git a/tools/hotplug/Linux/locking.sh b/tools/hotplug/Linux/locking.sh
> index c6a7e96..b8e9515 100644
> --- a/tools/hotplug/Linux/locking.sh
> +++ b/tools/hotplug/Linux/locking.sh
> @@ -23,9 +23,14 @@ LOCK_BASEDIR=/var/run/xen-hotplug
>  
>  _setlockfd()
>  {
> +    local lock_
>      local i
> -    for ((i = 0; i < ${#_lockdict}; i++))
> -    do [ -z "${_lockdict[$i]}" -o "${_lockdict[$i]}" = "$1" ] && break
> +    let i=0
> +
> +    for lock_ in _lockdict ;
> +    do
> +    [ -z "$lock_" -o "$lock_" = "$1" ] && break
> +    (( i++ ))
>      done
>      _lockdict[$i]="$1"
>      let _lockfd=200+i
> diff --git a/tools/hotplug/Linux/xen-hotplug-common.sh.in 
> b/tools/hotplug/Linux/xen-hotplug-common.sh.in
> index d5d0b69..42e46e3 100644
> --- a/tools/hotplug/Linux/xen-hotplug-common.sh.in
> +++ b/tools/hotplug/Linux/xen-hotplug-common.sh.in
> @@ -51,7 +51,7 @@ sigerr() {
>    fatal "$0 failed; error detected."
>  }
>  
> -trap sigerr ERR
> +#trap sigerr ERR

I know why you want to comment this out but you basically break the
error handling protocol. See the fatal function at the beginning of this
file.

So we can't take this patch. And you should probably fix your own
environment, too.

Wei.

>  
>  
>  ##
> -- 
> 2.8.2
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxx
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.