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

[Xen-changelog] Fix usleep definition -- we would be sleeping 1000 times too long if the usleep



# HG changeset patch
# User emellor@xxxxxxxxxxxxxxxxxxxxxx
# Node ID ab300e9fe02b6a48cfd7fda9c50d878e11160297
# Parent  5f574f9cb4bd2b5eebd98ce6fc43ce0c33d7b1d4
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@xxxxxxxxxxxxx>

diff -r 5f574f9cb4bd -r ab300e9fe02b tools/examples/init.d/sysconfig.xendomains
--- a/tools/examples/init.d/sysconfig.xendomains        Wed Dec  7 11:57:26 2005
+++ b/tools/examples/init.d/sysconfig.xendomains        Wed Dec  7 15:41:41 2005
@@ -19,6 +19,17 @@
 # it to a relatively high value (1200000).
 #
 XENDOMAINS_USLEEP=100000
+
+## Type: integer
+## Default: 5000000
+#
+# When creating a guest domain, it is sensible to allow a little time for it
+# to get started before creating another domain or proceeding through the
+# boot process.  Without this, the booting guests will thrash the disk as they
+# start up.  This timeout (in microseconds) specifies the delay after guest
+# domain creation.
+#
+XENDOMAINS_CREATE_USLEEP=5000000
 
 ## Type: string
 ## Default: ""
diff -r 5f574f9cb4bd -r ab300e9fe02b tools/examples/init.d/xendomains
--- a/tools/examples/init.d/xendomains  Wed Dec  7 11:57:26 2005
+++ b/tools/examples/init.d/xendomains  Wed Dec  7 15:41:41 2005
@@ -127,7 +127,7 @@
   {
     if [ -n "$1" ]
     then
-      sleep $(( $1 / 1000 ))
+      sleep $(( $1 / 1000000 ))
     fi
   }
 fi
@@ -241,6 +241,8 @@
                if [ $? -ne 0 ]; then
                    rc_failed $?
                    echo -n '!'
+               else
+                   usleep $XENDOMAINS_CREATE_USLEEP
                fi
            fi
        done

_______________________________________________
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®.