diff -r 3ef0510e44d0 tools/python/xen/xm/create.py --- a/tools/python/xen/xm/create.py Tue May 08 10:21:23 2007 +0100 +++ b/tools/python/xen/xm/create.py Thu Jul 19 15:56:45 2007 +0800 @@ -1311,24 +1311,28 @@ def do_console(domain_name): def do_console(domain_name): cpid = os.fork() if cpid != 0: - for i in range(10): - # Catch failure of the create process - time.sleep(1) - (p, rv) = os.waitpid(cpid, os.WNOHANG) - if os.WIFEXITED(rv): - if os.WEXITSTATUS(rv) != 0: - sys.exit(os.WEXITSTATUS(rv)) - try: - # Acquire the console of the created dom - if serverType == SERVER_XEN_API: - domid = server.xenapi.VM.get_domid( - get_single_vm(domain_name)) - else: - dom = server.xend.domain(domain_name) - domid = int(sxp.child_value(dom, 'domid', '-1')) - console.execConsole(domid) - except: - pass + # Catch failure of the create process + time.sleep(1) + (p, rv) = os.waitpid(cpid, os.WNOHANG) + if os.WIFEXITED(rv): + if os.WEXITSTATUS(rv) != 0: + sys.exit(os.WEXITSTATUS(rv)) + try: + # Acquire the console of the created dom + if serverType == SERVER_XEN_API: + domid = server.xenapi.VM.get_domid( + get_single_vm(domain_name)) + else: + dom = server.xend.domain(domain_name) + domid = int(sxp.child_value(dom, 'domid', '-1')) + except: + print("can't get domain id. domain crashed?\n") + sys.exit(0) + + try: + console.execConsole(domid) + except: + pass print("Could not start console\n"); sys.exit(0)