[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] Don't leave vncviewer processes running if xm create fails
# HG changeset patch # User adsharma@xxxxxxxxxxxxxxxxxxxx # Node ID f90820349056d0c5b8442078187cf7abafeb9fd4 # Parent dc61689b4781882b886edad3591240bc3a813274 Don't leave vncviewer processes running if xm create fails Signed-off-by: Edwin Zhai <edwin.zhai@xxxxxxxxx> Signed-off-by: Arun Sharma <arun.sharma@xxxxxxxxx> diff -r dc61689b4781 -r f90820349056 tools/python/xen/xm/create.py --- a/tools/python/xen/xm/create.py Wed Aug 10 18:44:42 2005 +++ b/tools/python/xen/xm/create.py Thu Aug 11 18:44:59 2005 @@ -592,9 +592,14 @@ 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 @@ 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') _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |