ia64/xen-unstable

changeset 16040:8426ac1a5df8

Fix external-device-migrate infinite loop.

For some (yet) unknown reason extern-device-migrate is called
twice, once with a missing domname argument.

The following invocation loops forever:
external-device-migrate -domname
because "shift 2" never shifts ($# < 2) and $# is always 1.

From: Pascal Bouchareine <pascal@gandi.net>
Signed-off-by: Keir Fraser <keir@xensource.com>
author Keir Fraser <keir@xensource.com>
date Tue Oct 02 09:56:53 2007 +0100 (2007-10-02)
parents 1ead02bab5c8
children 93b7f47407bc
files tools/examples/external-device-migrate
line diff
     1.1 --- a/tools/examples/external-device-migrate	Tue Oct 02 09:41:10 2007 +0100
     1.2 +++ b/tools/examples/external-device-migrate	Tue Oct 02 09:56:53 2007 +0100
     1.3 @@ -16,6 +16,7 @@
     1.4  # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
     1.5  #
     1.6  
     1.7 +set -x
     1.8  
     1.9  # This script is called by XenD for migration of external devices
    1.10  # It does not handle the migration of those devices itself, but
    1.11 @@ -57,11 +58,11 @@ function evaluate_params()
    1.12  	stype=""
    1.13  	while [ $# -ge 1 ]; do
    1.14  		case "$1" in
    1.15 -		-step)		step=$2; shift 2;;
    1.16 -		-host)		host=$2; shift 2;;
    1.17 -		-domname)	domname=$2; shift 2;;
    1.18 -		-type)		typ=$2; shift 2;;
    1.19 -		-subtype)	stype=$2; shift 2;;
    1.20 +		-step)		step=$2; shift; shift;;
    1.21 +		-host)		host=$2; shift; shift;;
    1.22 +		-domname)	domname=$2; shift; shift;;
    1.23 +		-type)		typ=$2; shift; shift;;
    1.24 +		-subtype)	stype=$2; shift; shift;;
    1.25  		-recover)	recover=1; shift;;
    1.26  		-help)		ext_dev_migrate_usage; exit 0;;
    1.27  		*)		break;;