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

[Xen-changelog] [xen-unstable] xentrace: error handling on non-existent formats file



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1236870440 0
# Node ID 3e98bc2b6911572d240708917d41298c7a66e849
# Parent  a55a98b36a2a5e12c05bd9c6653725f4e8cbe50a
xentrace: error handling on non-existent formats file

Attached patch does proper error handling when specified
formats file doesn't exist.

Signed-off-by: Christoph Egger <Christoph.Egger@xxxxxxx>
---
 tools/xentrace/xentrace_format |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletion(-)

diff -r a55a98b36a2a -r 3e98bc2b6911 tools/xentrace/xentrace_format
--- a/tools/xentrace/xentrace_format    Thu Mar 12 11:33:35 2009 +0000
+++ b/tools/xentrace/xentrace_format    Thu Mar 12 15:07:20 2009 +0000
@@ -81,7 +81,11 @@ signal.signal(signal.SIGINT,  sighand)
 
 interrupted = 0
 
-defs = read_defs(arg[0])
+try:
+    defs = read_defs(arg[0])
+except IOError, exn:
+    print exn
+    sys.exit(1)
 
 # structure of trace record (as output by xentrace):
 # HDR(I) {TSC(Q)} D1(I) D2(I) D3(I) D4(I) D5(I) D6(I) D7(I)

_______________________________________________
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®.