fbce2fe
--- xen-4.1.2/tools/python/xen/xend/image.py.orig	2011-10-20 18:05:44.000000000 +0100
fbce2fe
+++ xen-4.1.2/tools/python/xen/xend/image.py	2011-11-20 20:41:10.730905790 +0000
fbce2fe
@@ -43,7 +43,11 @@
fbce2fe
 from xen.util import utils
fbce2fe
 from xen.xend import osdep
fbce2fe
 
fbce2fe
-xc = xen.lowlevel.xc.xc()
fbce2fe
+try:
fbce2fe
+    xc = xen.lowlevel.xc.xc()
fbce2fe
+except Exception:
fbce2fe
+    print >>sys.stderr, ('xend/image.py: Error connecting to hypervisor')
fbce2fe
+    os._exit(1)
fbce2fe
 
fbce2fe
 MAX_GUEST_CMDLINE = 1024
fbce2fe
 
3792f02
--- xen-4.1.2/tools/python/xen/xend/XendLogging.py.orig	2011-10-20 18:05:44.000000000 +0100
3792f02
+++ xen-4.1.2/tools/python/xen/xend/XendLogging.py	2012-01-10 21:27:57.304916048 +0000
3792f02
@@ -132,7 +132,11 @@
3792f02
         fileHandler = openFileHandler(filename)
3792f02
         logfilename = filename
3792f02
     except IOError:
3792f02
-        logfilename = tempfile.mkstemp("-xend.log")[1]
3792f02
+        try:
3792f02
+            logfilename = tempfile.mkstemp("-xend.log")[1]
3792f02
+        except IOError:
3792f02
+            print >>sys.stderr, ('xend/XendLogging.py: Unable to open standard or temporary log file for xend')
3792f02
+            os._exit(1)
3792f02
         fileHandler = openFileHandler(logfilename)
3792f02
 
3792f02
     fileHandler.setFormatter(logging.Formatter(LOGFILE_FORMAT, DATE_FORMAT))