mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
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@bendigoit.com.au> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
This commit is contained in:
1 parent
090b27a6fa
commit
31960417a9
1 file changed
+2
@@ -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)
|
||||
|
||||