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

[Xen-changelog] [xen-unstable] Fix external-device-migrate infinite loop.



# HG changeset patch
# User Keir Fraser <keir@xxxxxxxxxxxxx>
# Date 1191315413 -3600
# Node ID 8426ac1a5df8acd1996733dbc2ecb1d3a8f418c8
# Parent  1ead02bab5c81b362032768a21b6ca08a6b0b2e3
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@xxxxxxxxx>
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 tools/examples/external-device-migrate |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff -r 1ead02bab5c8 -r 8426ac1a5df8 tools/examples/external-device-migrate
--- a/tools/examples/external-device-migrate    Tue Oct 02 09:41:10 2007 +0100
+++ b/tools/examples/external-device-migrate    Tue Oct 02 09:56:53 2007 +0100
@@ -16,6 +16,7 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 #
 
+set -x
 
 # This script is called by XenD for migration of external devices
 # It does not handle the migration of those devices itself, but
@@ -57,11 +58,11 @@ function evaluate_params()
        stype=""
        while [ $# -ge 1 ]; do
                case "$1" in
-               -step)          step=$2; shift 2;;
-               -host)          host=$2; shift 2;;
-               -domname)       domname=$2; shift 2;;
-               -type)          typ=$2; shift 2;;
-               -subtype)       stype=$2; shift 2;;
+               -step)          step=$2; shift; shift;;
+               -host)          host=$2; shift; shift;;
+               -domname)       domname=$2; shift; shift;;
+               -type)          typ=$2; shift; shift;;
+               -subtype)       stype=$2; shift; shift;;
                -recover)       recover=1; shift;;
                -help)          ext_dev_migrate_usage; exit 0;;
                *)              break;;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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