[xen] Avoid crashes with weird PCI cards and a backtrace if xend can't open a log file

myoung myoung at fedoraproject.org
Wed Jan 11 22:09:05 UTC 2012


commit 3792f02c481ed9425162bb4dc4a72b791e2679ec
Author: Michael Young <m.a.young at durham.ac.uk>
Date:   Wed Jan 11 22:04:01 2012 +0000

    Avoid crashes with weird PCI cards and a backtrace if xend can't open a log file

 xen.spec            |    9 ++++++++-
 xend-pci-loop.patch |   19 +++++++++++++++++++
 xend.catchbt.patch  |   15 +++++++++++++++
 3 files changed, 42 insertions(+), 1 deletions(-)
---
diff --git a/xen.spec b/xen.spec
index d925d12..3301dd8 100644
--- a/xen.spec
+++ b/xen.spec
@@ -6,7 +6,7 @@
 Summary: Xen is a virtual machine monitor
 Name:    xen
 Version: 4.1.2
-Release: 2%{?dist}
+Release: 3%{?dist}
 Group:   Development/Libraries
 License: GPLv2+ and LGPLv2+ and BSD
 URL:     http://xen.org/
@@ -50,6 +50,7 @@ Patch31: pygrubfix2.patch
 Patch32: xen-4.1-testing.23190.patch
 Patch33: xend.empty.xml.patch
 Patch34: xend.catchbt.patch
+Patch35: xend-pci-loop.patch
 
 Patch100: xen-configure-xend.patch
 
@@ -394,6 +395,7 @@ rm -rf %{buildroot}
 # Autostart of guests
 %config(noreplace) %{_sysconfdir}/sysconfig/xendomains
 
+
 # Persistent state for XenD
 %dir %{_localstatedir}/lib/%{name}/xend-db/
 %dir %{_localstatedir}/lib/%{name}/xend-db/domain
@@ -560,6 +562,11 @@ rm -rf %{buildroot}
 %doc licensedir/*
 
 %changelog
+* Wed Jan 11 2012 Michael Young <m.a.young at durham.ac.uk> - 4.1.2-3
+- Add xend-pci-loop.patch to stop xend crashing with weird PCI cards (#767742)
+- avoid a backtrace if xend can't log to the standard file or a 
+  temporary directory (part of #741042)
+
 * Mon Nov 21 2011 Michael Young <m.a.young at durham.ac.uk> - 4.1.2-2
 - Fix lost interrupts on emulated devices
 - stop xend crashing if its state files are empty at start up
diff --git a/xend-pci-loop.patch b/xend-pci-loop.patch
new file mode 100644
index 0000000..5c4118a
--- /dev/null
+++ b/xend-pci-loop.patch
@@ -0,0 +1,19 @@
+# Don't crash due to weird PCI cards (Bug 767742)
+
+diff -r fb8dd4c67778 tools/python/xen/util/pci.py
+--- a/tools/python/xen/util/pci.py	Tue Dec 13 14:16:20 2011 -0500
++++ b/tools/python/xen/util/pci.py	Wed Dec 14 15:46:56 2011 -0500
+@@ -1268,7 +1268,12 @@ class PciDevice:
+             pass
+ 
+     def get_info_from_sysfs(self):
+-        self.find_capability(0x11)
++        try:
++            self.find_capability(0x11)
++        except PciDeviceParseError, err:
++            log.error("Caught '%s'" % err)
++            return False
++
+         sysfs_mnt = find_sysfs_mnt()
+         if sysfs_mnt == None:
+             return False
diff --git a/xend.catchbt.patch b/xend.catchbt.patch
index 8215839..95eac54 100644
--- a/xend.catchbt.patch
+++ b/xend.catchbt.patch
@@ -13,3 +13,18 @@
  
  MAX_GUEST_CMDLINE = 1024
  
+--- xen-4.1.2/tools/python/xen/xend/XendLogging.py.orig	2011-10-20 18:05:44.000000000 +0100
++++ xen-4.1.2/tools/python/xen/xend/XendLogging.py	2012-01-10 21:27:57.304916048 +0000
+@@ -132,7 +132,11 @@
+         fileHandler = openFileHandler(filename)
+         logfilename = filename
+     except IOError:
+-        logfilename = tempfile.mkstemp("-xend.log")[1]
++        try:
++            logfilename = tempfile.mkstemp("-xend.log")[1]
++        except IOError:
++            print >>sys.stderr, ('xend/XendLogging.py: Unable to open standard or temporary log file for xend')
++            os._exit(1)
+         fileHandler = openFileHandler(logfilename)
+ 
+     fileHandler.setFormatter(logging.Formatter(LOGFILE_FORMAT, DATE_FORMAT))


More information about the scm-commits mailing list