[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] Better diagnosis of the failure when Xend crashes. Thanks to Hollis Blanchard



# HG changeset patch
# User emellor@xxxxxxxxxxxxxxxxxxxxxx
# Node ID 58a04bfedf6be8065e10d2c36acbf03a4fb66062
# Parent  b3dd6ceda9bc931be8424a4cf2ca1ab4a42c53c1
Better diagnosis of the failure when Xend crashes.  Thanks to Hollis Blanchard
for diagnosis.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>
---
 tools/python/xen/util/xmlrpclib2.py |    5 +++++
 tools/python/xen/xm/create.py       |    2 +-
 tools/python/xen/xm/main.py         |   10 ++++++++++
 3 files changed, 16 insertions(+), 1 deletion(-)

diff -r b3dd6ceda9bc -r 58a04bfedf6b tools/python/xen/util/xmlrpclib2.py
--- a/tools/python/xen/util/xmlrpclib2.py       Tue Aug 08 15:43:54 2006 +0100
+++ b/tools/python/xen/util/xmlrpclib2.py       Wed Aug 09 09:52:43 2006 +0100
@@ -138,6 +138,11 @@ class TCPXMLRPCServer(SocketServer.Threa
 
     def _marshaled_dispatch(self, data, dispatch_method = None):
         params, method = xmlrpclib.loads(data)
+        if False:
+            # Enable this block of code to exit immediately without sending
+            # a response.  This allows you to test client-side crash handling.
+            import sys
+            sys.exit(1)
         try:
             if dispatch_method is not None:
                 response = dispatch_method(method, params)
diff -r b3dd6ceda9bc -r 58a04bfedf6b tools/python/xen/xm/create.py
--- a/tools/python/xen/xm/create.py     Tue Aug 08 15:43:54 2006 +0100
+++ b/tools/python/xen/xm/create.py     Wed Aug 09 09:52:43 2006 +0100
@@ -972,7 +972,7 @@ def make_domain(opts, config):
         import signal
         if vncpid:
             os.kill(vncpid, signal.SIGKILL)
-        raise ex
+        raise
 
     dom = sxp.child_value(dominfo, 'name')
 
diff -r b3dd6ceda9bc -r 58a04bfedf6b tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py       Tue Aug 08 15:43:54 2006 +0100
+++ b/tools/python/xen/xm/main.py       Wed Aug 09 09:52:43 2006 +0100
@@ -1257,6 +1257,16 @@ def main(argv=sys.argv):
             else:
                 print  >>sys.stderr, "Error: %s" % ex.faultString
             sys.exit(1)
+        except xmlrpclib.ProtocolError, ex:
+            if ex.errcode == -1:
+                print  >>sys.stderr, (
+                    "Xend has probably crashed!  Invalid or missing HTTP "
+                    "status code.")
+            else:
+                print  >>sys.stderr, (
+                    "Xend has probably crashed!  ProtocolError(%d, %s)." %
+                    (ex.errcode, ex.errmsg))
+            sys.exit(1)
         except (ValueError, OverflowError):
             err("Invalid argument.")
             usage(argv[1])

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.