From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jim Fehlig Subject: reports of xend not starting Date: Mon, 22 Mar 2010 17:07:09 -0600 Message-ID: <4BA7F81D.9060901@novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------070006060504010105010602" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: yunhong.jiang@intel.com Cc: xen-devel List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------070006060504010105010602 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi, I received reports of xend not starting with following traceback: [2010-03-22 14:11:56 4943] ERROR (SrvDaemon:349) Exception starting xend (ord() expected a character, but string of length 0 found) Traceback (most recent call last): File "/usr/lib64/python2.6/site-packages/xen/xend/server/SrvDaemon.py", line 341, in run servers = SrvServer.create() File "/usr/lib64/python2.6/site-packages/xen/xend/server/SrvServer.py", line 261, in create root.putChild('xend', SrvRoot()) File "/usr/lib64/python2.6/site-packages/xen/xend/server/SrvRoot.py", line 40, in __init__ self.get(name) File "/usr/lib64/python2.6/site-packages/xen/web/SrvDir.py", line 84, in get val = val.getobj() File "/usr/lib64/python2.6/site-packages/xen/web/SrvDir.py", line 52, in getobj self.obj = klassobj() File "/usr/lib64/python2.6/site-packages/xen/xend/server/SrvNode.py", line 30, in __init__ self.xn = XendNode.instance() File "/usr/lib64/python2.6/site-packages/xen/xend/XendNode.py", line 1191, in instance inst = XendNode() File "/usr/lib64/python2.6/site-packages/xen/xend/XendNode.py", line 159, in __init__ self._init_PPCIs() File "/usr/lib64/python2.6/site-packages/xen/xend/XendNode.py", line 282, in _init_PPCIs for pci_dev in PciUtil.get_all_pci_devices(): File "/usr/lib64/python2.6/site-packages/xen/util/pci.py", line 469, in get_all_pci_devices return map(PciDevice, get_all_pci_dict()) File "/usr/lib64/python2.6/site-packages/xen/util/pci.py", line 693, in __init__ self.get_info_from_sysfs() File "/usr/lib64/python2.6/site-packages/xen/util/pci.py", line 1256, in get_info_from_sysfs self.find_capability(0x11) File "/usr/lib64/python2.6/site-packages/xen/util/pci.py", line 1229, in find_capability capa_pointer = ord(conf_file.read(1)) TypeError: ord() expected a character, but string of length 0 found [2010-03-22 14:11:56 4942] INFO (SrvDaemon:220) Xend exited with status 1. I won't pretend to know the code but looks like some protection against read() returning an empty string (EOF) is in order. Is the attached patch appropriate? Regards, Jim Signed-off-by: Jim Fehlig --------------070006060504010105010602 Content-Type: text/x-patch; name="xend-startup-fix.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="xend-startup-fix.patch" Index: xen-4.0.0-testing/tools/python/xen/util/pci.py =================================================================== --- xen-4.0.0-testing.orig/tools/python/xen/util/pci.py +++ xen-4.0.0-testing/tools/python/xen/util/pci.py @@ -1251,6 +1251,9 @@ class PciDevice: except IOError, (errno, strerr): raise PciDeviceParseError(('Failed to locate sysfs mount: %s: %s (%d)' % (PROC_PCI_PATH, strerr, errno))) + except TypeError, err: + log.debug("Caught TypeError '%s'" % err) + pass def get_info_from_sysfs(self): self.find_capability(0x11) --------------070006060504010105010602 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------070006060504010105010602--