Exception in xen/util/vscsi_util.py while starting xend
We have pscsi device with long scsi ids like 15:0:11:101.
In this case lsscsi prints no "blank" between id and type (see example),
so the following split of the string returns wrong output.
The field physical_HCTL is set to 15:0:11:101]dis.
The patch replaces char "]" by "] ", so split() will return the right
physical_HTCL.
[15:0:11:101]disk DGC RAID 10 0429 /dev/xsdmdr
Snippet from Xend.log:
[2010-07-21 12:35:03 14959] ERROR (SrvDaemon:349) Exception starting xend (invalid literal for int() with base 10: '215]dis')
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 1196, in instance
inst = XendNode()
File "/usr/lib64/python2.6/site-packages/xen/xend/XendNode.py", line 161, in __init__
self._init_PSCSIs()
File "/usr/lib64/python2.6/site-packages/xen/xend/XendNode.py", line 367, in _init_PSCSIs
XendPSCSI(pscsi_uuid, pscsi_record)
File "/usr/lib64/python2.6/site-packages/xen/xend/XendPSCSI.py", line 96, in __init__
self.physical_lun = int(p_hctl[3])
ValueError: invalid literal for int() with base 10: '215]dis'
Signed-off-by: Lutz Dube Lutz.Dube@xxxxxxxxxxxxxx
diff -r e8dbc1262f52 -r fac9d58d3c8a tools/python/xen/util/vscsi_util.py
--- a/tools/python/xen/util/vscsi_util.py Wed Jul 21 09:02:10 2010 +0100
+++ b/tools/python/xen/util/vscsi_util.py Wed Jul 21 13:15:33 2010 +0200
@@ -97,7 +97,7 @@
devices = []
for scsiinfo in os.popen('{ lsscsi -g %s; } 2>/dev/null' % option).readlines():
- s = scsiinfo.split()
+ s = scsiinfo.replace(']', '] ').split()
hctl = s[0][1:-1]
try:
devname = s[-2].split('/dev/')[1]
---
Best regards
Lutz Dube
Softwareentwickler
TSP ES&S SWE OS7
FUJITSU TECHNOLOGY SOLUTIONS GMBH
Domagkstr. 28
D-80807 München
Telefon: +49 (0)89 3222 2688
Telefax: +49 (0)89 3222 329 2688
Email: Lutz Dube@xxxxxxxxxxxxxx