Skip to contentSkip to conversation

Discard error messages of lsscsi

PATCH In review Masaki Kanno 1 participant 3 messages Mar 11, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Discard error messages of lsscsi

Hi,

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.

Best regards,
Kan

tools/python/xen/util/vscsi_util.py +2 -2
diff -r b249f3e979a5 tools/python/xen/util/vscsi_util.py
@@ -90,7 +90,7 @@ def _vscsi_get_scsidevices_by_lsscsi(opt
 
     devices = []
 
-    for scsiinfo in os.popen('lsscsi -g %s' % option).readlines():
+    for scsiinfo in os.popen('lsscsi -g %s 2>/dev/null' % option).readlines():
         s = scsiinfo.split()
         hctl = s[0][1:-1]
         try:
@@ -248,7 +248,7 @@ def get_all_scsi_devices():
             get_scsi_scsilevel(scsi_dev['physical_HCTL'])
 
         try:
-            lsscsi_info = os.popen('lsscsi ' + scsi_dev['physical_HCTL']).read().split()
+            lsscsi_info = os.popen('lsscsi %s 2>/dev/null' % scsi_dev['physical_HCTL']).read().split()
             scsi_dev['type'] = lsscsi_info[1]
         except:
             scsi_dev['type'] = None

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw

Sorry, please ignore the patch.
The patch includes mistake.

Best regards,
Kan

Quoted 23 lines · Masaki Kanno

Hi,

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.

Best regards,
Kan

-------------------------------text/plain-------------------------------
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#2 lore raw

Hi,

I send a new patch.
The patch fixes mistake of changeset 19310.

Best regards,
Kan

Quoted 33 lines · Masaki Kanno

Sorry, please ignore the patch.
The patch includes mistake.

Best regards,
Kan

Quoted 18 lines · Masaki Kanno

Hi,

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.

Best regards,
Kan

Quoted 5 lines

-------------------------------text/plain-------------------------------
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

Quoted 4 lines

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

tools/python/xen/util/vscsi_util.py +1 -1
diff -r 658b7ca5d4ed tools/python/xen/util/vscsi_util.py
@@ -90,7 +90,7 @@ def _vscsi_get_scsidevices_by_lsscsi(opt
 
     devices = []
 
-    for scsiinfo in os.popen('lsscsi -g %s 2>/dev/null' % option).readlines():
+    for scsiinfo in os.popen('{ lsscsi -g %s; } 2>/dev/null' % option).readlines():
         s = scsiinfo.split()
         hctl = s[0][1:-1]
         try:

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel