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

[Xen-devel] [PATCH] vscsi and symlinks


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • From: "James Harper" <james.harper@xxxxxxxxxxxxxxxx>
  • Date: Mon, 7 Feb 2011 12:24:31 +1100
  • Delivery-date: Sun, 06 Feb 2011 17:25:22 -0800
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: AcvGZcVfo8D1Q6P4TGiv9nP+JzFiEQ==
  • Thread-topic: [PATCH] vscsi and symlinks

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/

James

--- a/tools/python/xen/util/vscsi_util.py  2010-12-03 23:26:46.391655087
+1100
+++ b/tools/python/xen/util/vscsi_util.py  2011-02-07 12:20:37.599527204
+1100
@@ -158,6 +158,8 @@


 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-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

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