Skip to contentSkip to conversation

xm: handle error in auxbin gracefully

PATCH New Christoph Egger 1 participant 1 message Apr 7, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xm: handle error in auxbin gracefully

Hi,

attached patch handles failure in auxbin.
If it execution fails, print the error message
and exit.

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/python/xen/util/auxbin.py +5 -1
diff -r accf139b2eb9 tools/python/xen/util/auxbin.py
@@ -35,7 +35,11 @@ def execute(exe, args = None):
     a = [ exepath ]
     if args:
         a.extend(args)
-    os.execv(exepath, a)
+    try:
+        os.execv(exepath, a)
+    except OSError, exn:
+        print exepath, ": ", exn
+        sys.exit(1)
 
 
 def pathTo(exe):

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel