ia64/xen-unstable

changeset 8268:ab300e9fe02b

Fix usleep definition -- we would be sleeping 1000 times too long if the usleep
command were not available elsewhere on the machine (on my Debian boxes, for
example).

Sleep for a configurable amount of time between xm create calls (by default,
5 seconds). This spaces out the booting of the new domains, meaning that they
should not thrash the disk so much.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author emellor@leeni.uk.xensource.com
date Wed Dec 07 15:41:41 2005 +0000 (2005-12-07)
parents 5f574f9cb4bd
children ac3ceb2d37d1
files tools/examples/init.d/sysconfig.xendomains tools/examples/init.d/xendomains
line diff
     1.1 --- a/tools/examples/init.d/sysconfig.xendomains	Wed Dec 07 11:57:26 2005 +0000
     1.2 +++ b/tools/examples/init.d/sysconfig.xendomains	Wed Dec 07 15:41:41 2005 +0000
     1.3 @@ -20,6 +20,17 @@ XENDOMAINS_SYSRQ=""
     1.4  #
     1.5  XENDOMAINS_USLEEP=100000
     1.6  
     1.7 +## Type: integer
     1.8 +## Default: 5000000
     1.9 +#
    1.10 +# When creating a guest domain, it is sensible to allow a little time for it
    1.11 +# to get started before creating another domain or proceeding through the
    1.12 +# boot process.  Without this, the booting guests will thrash the disk as they
    1.13 +# start up.  This timeout (in microseconds) specifies the delay after guest
    1.14 +# domain creation.
    1.15 +#
    1.16 +XENDOMAINS_CREATE_USLEEP=5000000
    1.17 +
    1.18  ## Type: string
    1.19  ## Default: ""
    1.20  #
     2.1 --- a/tools/examples/init.d/xendomains	Wed Dec 07 11:57:26 2005 +0000
     2.2 +++ b/tools/examples/init.d/xendomains	Wed Dec 07 15:41:41 2005 +0000
     2.3 @@ -127,7 +127,7 @@ then
     2.4    {
     2.5      if [ -n "$1" ]
     2.6      then
     2.7 -      sleep $(( $1 / 1000 ))
     2.8 +      sleep $(( $1 / 1000000 ))
     2.9      fi
    2.10    }
    2.11  fi
    2.12 @@ -241,6 +241,8 @@ start()
    2.13  		if [ $? -ne 0 ]; then
    2.14  		    rc_failed $?
    2.15  		    echo -n '!'
    2.16 +		else
    2.17 +		    usleep $XENDOMAINS_CREATE_USLEEP
    2.18  		fi
    2.19  	    fi
    2.20  	done