Don't leave vncviewer processes running if xm create fails

Signed-off-by: Edwin Zhai <edwin.zhai@intel.com>
Signed-off-by: Arun Sharma <arun.sharma@intel.com>
This commit is contained in:
adsharma@los-vmm.sc.intel.com committed 2005-08-15 12:50:25 -08:00
1 parent b594964728
commit 7e359b2621
1 file changed
+10 -2
+10 -2
View File
@@ -592,9 +592,14 @@ def choose_vnc_display():
return d
return None
vncpid = None
def spawn_vnc(display):
os.system("vncviewer -log *:stdout:0 -listen %d &" %
(VNC_BASE_PORT + display))
vncargs = (["vncviewer" + "-log", "*:stdout:0",
"-listen", "%d" % (VNC_BASE_PORT + display) ])
global vncpid
vncpid = os.spawnvp(os.P_NOWAIT, "vncviewer", vncargs)
return VNC_BASE_PORT + display
def preprocess_vnc(opts, vals):
@@ -639,6 +644,9 @@ def make_domain(opts, config):
else:
dominfo = server.xend_domain_create(config)
except XendError, ex:
import signal
if vncpid:
os.kill(vncpid, signal.SIGKILL)
opts.err(str(ex))
dom = sxp.child_value(dominfo, 'name')
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.