aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authoriap10@tetris.cl.cam.ac.uk <iap10@tetris.cl.cam.ac.uk>2005-06-17 21:44:11 +0000
committeriap10@tetris.cl.cam.ac.uk <iap10@tetris.cl.cam.ac.uk>2005-06-17 21:44:11 +0000
commit227aeb4d79e2f90bae5048a26ebd6dc040a7d9f2 (patch)
tree4c6efc63b5d443a5e6964711cf8cbb18b9960c1b /tools
parent86d6165ed3685109216376bb183ff829036d5b40 (diff)
downloadxen-227aeb4d79e2f90bae5048a26ebd6dc040a7d9f2.tar.gz
xen-227aeb4d79e2f90bae5048a26ebd6dc040a7d9f2.tar.bz2
xen-227aeb4d79e2f90bae5048a26ebd6dc040a7d9f2.zip
bitkeeper revision 1.1717 (42b3442b7kXKhXN5lvR9spIGT5LsYQ)
When xend starts, it fires off xcs. If you're running on a slow machine its possible that xcs started but xend didnt wait long enough to notice. The attached patch loops several times while waiting for xcs to come up. It seems to be working here while the original is not (slow machine here). From: Tim Newsham [newsham@lava.net] Signed-off-by: ian@xensource.com
Diffstat (limited to 'tools')
-rw-r--r--tools/misc/xend18
1 files changed, 10 insertions, 8 deletions
diff --git a/tools/misc/xend b/tools/misc/xend
index 768cd20f94..06f5e660ec 100644
--- a/tools/misc/xend
+++ b/tools/misc/xend
@@ -86,9 +86,7 @@ def xcs_running():
def start_xcs():
if (not xcs_running()):
- if os.fork():
- time.sleep(0.1) # let xcs start
- else:
+ if os.fork() == 0 :
if not os.path.isdir(os.path.dirname(XCS_PATH)):
os.makedirs(os.path.dirname(XCS_PATH))
try:
@@ -98,11 +96,15 @@ def start_xcs():
msg("Tried to start xcs, but failed. Is it installed?")
hline()
raise CheckError("couldn't start xcs")
- if (not xcs_running()):
- hline()
- msg("Failed to start the control interface switch.")
- hline()
- raise CheckError("xcs not running")
+ for n in range(10) :
+ if (xcs_running()):
+ break
+ time.sleep(0.1)
+ else :
+ hline()
+ msg("Failed to start the control interface switch.")
+ hline()
+ raise CheckError("xcs not running")
def stop_xcs():
try: