Skip to contentSkip to conversation

xentrace: error handling

PATCH New Christoph Egger 1 participant 1 message Mar 12, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xentrace: error handling

Hi,

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

Signature · 6 lines
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen
Geschaeftsfuehrer: Jochen Polster, Thomas M. McCoy, Giuliano Meroni
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
tools/xentrace/xentrace_format +5 -1
diff -r a55a98b36a2a tools/xentrace/xentrace_format
@@ -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-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel