ia64/xen-unstable

changeset 19357:f97e737373cd

xend: Fix xm scsi-attach for host OS without lsscsi

In the case of a host OS without lsscsi command, xm scsi-attach
command fails even if you specify existing SCSI device.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Mar 13 07:38:47 2009 +0000 (2009-03-13)
parents 3c1a88dc6fbe
children 0f7e2ba5d0e6
files tools/python/xen/util/vscsi_util.py
line diff
     1.1 --- a/tools/python/xen/util/vscsi_util.py	Fri Mar 13 07:38:05 2009 +0000
     1.2 +++ b/tools/python/xen/util/vscsi_util.py	Fri Mar 13 07:38:47 2009 +0000
     1.3 @@ -152,7 +152,9 @@ def vscsi_get_hctl_and_devname_by(target
     1.4          elif target.startswith('/dev/'): 
     1.5              scsi_devices = _vscsi_get_scsidevices_by_lsscsi("| grep %s" % target)
     1.6          else:
     1.7 -            scsi_devices = vscsi_get_scsidevices()
     1.8 +            scsi_devices = _vscsi_get_scsidevices_by_lsscsi("")
     1.9 +        if not scsi_devices:
    1.10 +            scsi_devices = _vscsi_get_scsidevices_by_sysfs()
    1.11  
    1.12      if len(target.split(':')) == 4:
    1.13          return _vscsi_get_devname_by(target, scsi_devices)