ia64/xen-unstable

changeset 19315:57a67b02e448

xend: Discard error messages of lsscsi

In the case of a host OS without lsscsi command, the following
error message is recorded into xend-debug.log when xend is started.
The error message is recorded once certainly. If SCSI devices are
connected to the host OS, it is recorded to the number of SCSI
devices.

sh: lsscsi: command not found

This patch discards the error message to /dev/null.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Mar 11 10:14:33 2009 +0000 (2009-03-11)
parents 20a2e3f724d5
children 658b7ca5d4ed
files tools/python/xen/util/vscsi_util.py
line diff
     1.1 --- a/tools/python/xen/util/vscsi_util.py	Wed Mar 11 10:13:46 2009 +0000
     1.2 +++ b/tools/python/xen/util/vscsi_util.py	Wed Mar 11 10:14:33 2009 +0000
     1.3 @@ -90,7 +90,7 @@ def _vscsi_get_scsidevices_by_lsscsi(opt
     1.4  
     1.5      devices = []
     1.6  
     1.7 -    for scsiinfo in os.popen('lsscsi -g %s' % option).readlines():
     1.8 +    for scsiinfo in os.popen('lsscsi -g %s 2>/dev/null' % option).readlines():
     1.9          s = scsiinfo.split()
    1.10          hctl = s[0][1:-1]
    1.11          try:
    1.12 @@ -248,7 +248,7 @@ def get_all_scsi_devices():
    1.13              get_scsi_scsilevel(scsi_dev['physical_HCTL'])
    1.14  
    1.15          try:
    1.16 -            lsscsi_info = os.popen('lsscsi ' + scsi_dev['physical_HCTL']).read().split()
    1.17 +            lsscsi_info = os.popen('lsscsi %s 2>/dev/null' % scsi_dev['physical_HCTL']).read().split()
    1.18              scsi_dev['type'] = lsscsi_info[1]
    1.19          except:
    1.20              scsi_dev['type'] = None