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] Temporary workaround to xend start problem.

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Temporary workaround to xend start problem.
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 21 Oct 2005 18:54:37 +0000
Delivery-date: Fri, 21 Oct 2005 18:54:56 +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 jrb44@xxxxxxxxxxxxxxxxx
# Node ID 17a9f111fa93b38b28bc8679ee8d35b45b7627bc
# Parent  2d5b92e7c79a714640397b6c7d797a56aa230f8b
Temporary workaround to xend start problem.

Signed-off-by: James Bulpin <james@xxxxxxxxxxxxx>

diff -r 2d5b92e7c79a -r 17a9f111fa93 tools/python/xen/xend/Vifctl.py
--- a/tools/python/xen/xend/Vifctl.py   Fri Oct 21 17:29:26 2005
+++ b/tools/python/xen/xend/Vifctl.py   Fri Oct 21 17:51:42 2005
@@ -20,8 +20,8 @@
 """
 import os
 
+import xen.util.process
 import XendRoot
-
 
 def network(op):
     """Call a network control script.
@@ -32,4 +32,6 @@
         raise ValueError('Invalid operation: ' + op)
     script = XendRoot.instance().get_network_script()
     if script:
-        os.spawnl(os.P_WAIT, script, script, op)
+        xen.util.process.runscript(script + " " + op)
+        #os.spawnl(os.P_WAIT, script, script, op)
+
diff -r 2d5b92e7c79a -r 17a9f111fa93 tools/python/xen/util/process.py
--- /dev/null   Fri Oct 21 17:29:26 2005
+++ b/tools/python/xen/util/process.py  Fri Oct 21 17:51:42 2005
@@ -0,0 +1,39 @@
+# Copyright (C) 2005 Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>
+
+# os.system() replacement which outputs through the logger
+
+import popen2
+import select
+import string
+
+from xen.xend.XendLogging import log
+
+def runscript(cmd):
+    # split after first space, then grab last component of path
+    cmdname = "[%s] " % cmd.split()[0].split('/')[-1]
+    # run command and grab stdin, stdout and stderr
+    cout, cin, cerr = popen2.popen3(cmd)
+    # close stdin to get command to terminate if it waits for input
+    cin.close()
+    # wait for output and process
+    p = select.poll()
+    p.register(cout)
+    p.register(cerr)
+    stdout = ""
+    while True:
+        r = p.poll()
+        for (fd, event) in r:
+            if event == select.POLLHUP:
+                cout.close()
+                cerr.close()
+                return stdout
+            if fd == cout.fileno():
+                stdout = stdout + cout.readline()
+            if fd == cerr.fileno():
+                l = cerr.readline()
+                if l[0] == '-':
+                    log.debug(cmdname + l[1:].rstrip())
+                elif l[0] == '*':
+                    log.info(cmdname + l[1:].rstrip())
+                else:
+                    log.error(cmdname + l.rstrip())

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Temporary workaround to xend start problem., Xen patchbot -unstable <=