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: domid = domain_name_to_domid(domain_name) console.execConsole(domid) except: pass print("Could not start console\n"); sys.exit(0)
if serverType == SERVER_XEN_API: from xen.xm.xenapi_create import xenapi_create xenapi_create_inst = xenapi_create() if opts.is_xml: vm_refs = xenapi_create_inst.create(filename = config, skipdtd = opts.vals.skipdtd) else: vm_refs = xenapi_create_inst.create(document = doc, skipdtd = opts.vals.skipdtd) map(lambda vm_ref: server.xenapi.VM.start(vm_ref, 0), vm_refs) elif not opts.is_xml: dom = make_domain(opts, config) if opts.vals.vncconsole: domid = domain_name_to_domid(sxp.child_value(config, 'name', -1)) vncviewer_autopass = getattr(opts.vals,'vncviewer-autopass', False) console.runVncViewer(domid, vncviewer_autopass, True) 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: domid = domain_name_to_domid(domain_name)