mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
Better diagnosis of the failure when Xend crashes. Thanks to Hollis Blanchard
for diagnosis. Signed-off-by: Ewan Mellor <ewan@xensource.com>
This commit is contained in:
1 parent
a3a905683d
commit
03b3d1627f
3 files changed
+16
-1
No files matched your search
@@ -138,6 +138,11 @@ class TCPXMLRPCServer(SocketServer.ThreadingMixIn, SimpleXMLRPCServer):
|
||||
|
||||
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)
|
||||
|
||||
@@ -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')
|
||||
|
||||
|
||||
@@ -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])
|
||||
|
||||