Hey everyone,

I've encountered an obscure issue with the 'sensor list' command here at
Sun.  The behavior of 'sensor list' and 'sensor get' have changed
between 1.8.8 and 1.8.9 in a subtle way.  Now if a non-zero (CC_NORMAL)
completion code is returned by and of the IPMI sensor query commands,
the non-zero completion code is passed back to the user through the
ipmitool return code.

Sun products do not have dynamic SDRs... the list of sensors is fixed at
the time of manufacturing.  If a device is queried that doesn't exist on
the system b/c it is a removable part, then ipmitool receives a non-zero
completion code.  IMHO, this is the right thing to do.

However, this means that the 'sensor list' command returns failure when
there isn't actually anything wrong... its just that one or more sensors
that it listed are on removable parts, and the error code was passed
back.  Since every sun product has removable parts, and it is rare for
every removable part to be installed, 'sensor list' in 1.8.9 always
returns failure.

I've attached a patch that does two things:

1) It indicates to the user when the error code indicates that the
device is not present in the sensor list data.
2) It masks the error when 'sensor list' is run.

The 'sensor get' command is left unchanged.  If you query a specific
device that isn't present, you are notified it isn't present AND you
receive a non-zero return code.

Does anybody object if I check this into cvs?

best,
 -john.

Index: lib/ipmi_sensor.c
===================================================================
--- lib/ipmi_sensor.c	(revision 23455)
+++ lib/ipmi_sensor.c	(working copy)
@@ -154,8 +154,11 @@
 												      rsp->data[2],
 												      rsp->data[3]);
 				printf("\n");
-         }
-		}
+         } else {
+	   printf(" READ ERROR: Device Not Present\n\n");
+	 }
+	   
+	   }
 	}
 
 	return (validread ? 0 : -1 );
@@ -373,7 +376,7 @@
 						    (" Upper Non-Recoverable : na\n");
 				}
 			} else {
-				printf("Not Present\n");
+			  printf(" READ ERROR: Device Not Present\n\n");
 			}
 
 			ipmi_sdr_print_sensor_event_status(intf,
@@ -480,7 +483,10 @@
 												      rsp->data[2],
 												      rsp->data[3]);
             printf("\n");
-         }
+         } else {
+	   printf(" READ ERROR: Device Not Present\n\n");
+	 }
+
 		}
 	}
 
@@ -528,8 +534,9 @@
 		}
 		free(rec);
 
-		/* save any errors */
-		rc = (r == 0) ? rc : r;
+		/* fix for CR6604909: */
+		/* mask failure of individual reads in sensor list command */
+		/* rc = (r == 0) ? rc : r; */
 	}
 
 	ipmi_sdr_end(intf, itr);
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Ipmitool-devel mailing list
Ipmitool-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipmitool-devel

Reply via email to