direct-io.hg

changeset 5496:fbf3bae97a88

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
author iap10@tetris.cl.cam.ac.uk
date Fri Jun 17 21:44:11 2005 +0000 (2005-06-17)
parents 999293916aa7
children 30735e9ca179
files tools/misc/xend
line diff
     1.1 --- a/tools/misc/xend	Fri Jun 17 20:47:52 2005 +0000
     1.2 +++ b/tools/misc/xend	Fri Jun 17 21:44:11 2005 +0000
     1.3 @@ -86,9 +86,7 @@ def xcs_running():
     1.4      
     1.5  def start_xcs():
     1.6      if (not xcs_running()):
     1.7 -        if os.fork():
     1.8 -            time.sleep(0.1) # let xcs start
     1.9 -        else:
    1.10 +        if os.fork() == 0 :
    1.11              if not os.path.isdir(os.path.dirname(XCS_PATH)):
    1.12                  os.makedirs(os.path.dirname(XCS_PATH))
    1.13              try:
    1.14 @@ -98,11 +96,15 @@ def start_xcs():
    1.15                  msg("Tried to start xcs, but failed. Is it installed?")
    1.16                  hline()
    1.17                  raise CheckError("couldn't start xcs")
    1.18 -        if (not xcs_running()):
    1.19 -            hline()
    1.20 -            msg("Failed to start the control interface switch.")
    1.21 -            hline()
    1.22 -            raise CheckError("xcs not running")
    1.23 +        for n in range(10) :
    1.24 +            if (xcs_running()):
    1.25 +                break
    1.26 +            time.sleep(0.1)
    1.27 +        else :
    1.28 +                hline()
    1.29 +                msg("Failed to start the control interface switch.")
    1.30 +                hline()
    1.31 +                raise CheckError("xcs not running")
    1.32              
    1.33  def stop_xcs():
    1.34      try: