All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][VT]Don't leave vncviewer processes running if xm create fails
@ 2005-08-15 10:53 Zhai, Edwin
  0 siblings, 0 replies; only message in thread
From: Zhai, Edwin @ 2005-08-15 10:53 UTC (permalink / raw)
  To: Ian Pratt, Keir Fraser; +Cc: xen-devel

[-- Attachment #1: Type: text/plain, Size: 67 bytes --]

this patch kill the created vncviewer process if xm create fails.


[-- Attachment #2: vncviewer.patch --]
[-- Type: text/plain, Size: 1036 bytes --]

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>

--- 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')

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-08-15 10:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-15 10:53 [PATCH][VT]Don't leave vncviewer processes running if xm create fails Zhai, Edwin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.