WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] reports of xend not starting

To: yunhong.jiang@xxxxxxxxx
Subject: [Xen-devel] reports of xend not starting
From: Jim Fehlig <jfehlig@xxxxxxxxxx>
Date: Mon, 22 Mar 2010 17:07:09 -0600
Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Mon, 22 Mar 2010 16:08:00 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.18 (X11/20081112)
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 <jfehlig@xxxxxxxxxx>


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)
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>