WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Don't leave vncviewer processes running if xm create fai

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Don't leave vncviewer processes running if xm create fails
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 16 Aug 2005 02:58:14 -0400
Delivery-date: Tue, 16 Aug 2005 08:40:48 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User adsharma@xxxxxxxxxxxxxxxxxxxx
# Node ID a56b490fa41d402eb4777799bd065301e64f68f5
# Parent  f11a31ad22d5d6c594664966ef3a4fb3758478eb
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 f11a31ad22d5 -r a56b490fa41d tools/python/xen/xm/create.py
--- a/tools/python/xen/xm/create.py     Mon Aug 15 15:34:23 2005
+++ b/tools/python/xen/xm/create.py     Mon Aug 15 20:50:25 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

<Prev in Thread] Current Thread [Next in Thread>