[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] xend: canonicalise symlinks found in /dev for vbds (helps vscsi)



# HG changeset patch
# User James Harper <james.harper@xxxxxxxxxxxxxxxx>
# Date 1297182935 0
# Node ID aeda4adecaf85618918dc674855721e3fc9eb33d
# Parent  9e463cb156586bfd50b8123664f1c290ca9f1f98
xend: canonicalise symlinks found in /dev for vbds (helps vscsi)

By default, vscsi expects to be passed the final device name (eg
/dev/st3) instead of one of the various udev symlinks (eg
/dev/tape/by-path/pci-0000:01:08.0-scsi-0:0:2:0-st). The following patch
resolves the path to the real path if the name starts with /dev/

Signed-off-by: James Harper <james.harper@xxxxxxxxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 tools/python/xen/util/vscsi_util.py |    2 ++
 1 files changed, 2 insertions(+)

diff -r 9e463cb15658 -r aeda4adecaf8 tools/python/xen/util/vscsi_util.py
--- a/tools/python/xen/util/vscsi_util.py       Mon Feb 07 17:02:46 2011 +0000
+++ b/tools/python/xen/util/vscsi_util.py       Tue Feb 08 16:35:35 2011 +0000
@@ -159,6 +159,8 @@ def vscsi_get_scsidevices(mask=""):
 
 
 def vscsi_get_hctl_and_devname_by(target, scsi_devices = None):
+    if target.startswith('/dev/'):
+        target = os.path.realpath(target)
     if scsi_devices is None:
         if len(target.split(':')) == 4:
             scsi_devices = _vscsi_get_scsidevices_by_lsscsi(target)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.