direct-io.hg

changeset 10987:58a04bfedf6b

Better diagnosis of the failure when Xend crashes. Thanks to Hollis Blanchard
for diagnosis.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author emellor@leeni.uk.xensource.com
date Wed Aug 09 09:52:43 2006 +0100 (2006-08-09)
parents b3dd6ceda9bc
children 688012fc0e79
files tools/python/xen/util/xmlrpclib2.py tools/python/xen/xm/create.py tools/python/xen/xm/main.py
line diff
     1.1 --- a/tools/python/xen/util/xmlrpclib2.py	Tue Aug 08 15:43:54 2006 +0100
     1.2 +++ b/tools/python/xen/util/xmlrpclib2.py	Wed Aug 09 09:52:43 2006 +0100
     1.3 @@ -138,6 +138,11 @@ class TCPXMLRPCServer(SocketServer.Threa
     1.4  
     1.5      def _marshaled_dispatch(self, data, dispatch_method = None):
     1.6          params, method = xmlrpclib.loads(data)
     1.7 +        if False:
     1.8 +            # Enable this block of code to exit immediately without sending
     1.9 +            # a response.  This allows you to test client-side crash handling.
    1.10 +            import sys
    1.11 +            sys.exit(1)
    1.12          try:
    1.13              if dispatch_method is not None:
    1.14                  response = dispatch_method(method, params)
     2.1 --- a/tools/python/xen/xm/create.py	Tue Aug 08 15:43:54 2006 +0100
     2.2 +++ b/tools/python/xen/xm/create.py	Wed Aug 09 09:52:43 2006 +0100
     2.3 @@ -972,7 +972,7 @@ def make_domain(opts, config):
     2.4          import signal
     2.5          if vncpid:
     2.6              os.kill(vncpid, signal.SIGKILL)
     2.7 -        raise ex
     2.8 +        raise
     2.9  
    2.10      dom = sxp.child_value(dominfo, 'name')
    2.11  
     3.1 --- a/tools/python/xen/xm/main.py	Tue Aug 08 15:43:54 2006 +0100
     3.2 +++ b/tools/python/xen/xm/main.py	Wed Aug 09 09:52:43 2006 +0100
     3.3 @@ -1257,6 +1257,16 @@ def main(argv=sys.argv):
     3.4              else:
     3.5                  print  >>sys.stderr, "Error: %s" % ex.faultString
     3.6              sys.exit(1)
     3.7 +        except xmlrpclib.ProtocolError, ex:
     3.8 +            if ex.errcode == -1:
     3.9 +                print  >>sys.stderr, (
    3.10 +                    "Xend has probably crashed!  Invalid or missing HTTP "
    3.11 +                    "status code.")
    3.12 +            else:
    3.13 +                print  >>sys.stderr, (
    3.14 +                    "Xend has probably crashed!  ProtocolError(%d, %s)." %
    3.15 +                    (ex.errcode, ex.errmsg))
    3.16 +            sys.exit(1)
    3.17          except (ValueError, OverflowError):
    3.18              err("Invalid argument.")
    3.19              usage(argv[1])