See my answers below.

Pierre

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:openhpi-devel-
> [EMAIL PROTECTED] On Behalf Of Serge Zhukov
> Sent: Friday, April 06, 2007 3:58 PM
> To: [email protected]
> Cc: 'Mark Overgaard'; 'Eugene Khoruzhenko'; 'Rich Vasse'
> Subject: [Openhpi-devel] Possible issue in saHpiSensorThresholdsSet
> 
> Hello OpenHPI developers!
> 
> We observe a possible problem in the function saHpiSensorThresholdsSet
> (OpenHPI version 2.8.0).
> 
> The HPI spec (SAF_HPI_B.01.01) says that:
> 
> "Thresholds are required to be set progressively in-order, so that Upper
> Critical >= Upper Major >= UpperMinor >= Lower Minor >= Lower Major >=
> Lower
> Critical."
> 
> This requirement is verified if multiple thresholds are set with a single
> call to saHpiSensorThresholdsSet.
> However, if multiple calls to saHpiSensorThresholdsSet are issued, and
> each
> call sets one specific threshold, this requirement is not verified. As a
> result, with multiple calls, it is possible to set thresholds out of
order,
> so that, for example a lower threshold will be greater than an upper
> threshold:
> 
> For a sensor that has the following thresholds:
> 
> Lower Minor Threshold    -56.000
> Lower Major Threshold    -56.000
> Lower Critical Threshold    -56.000
> Upper Minor Threshold     40.000
> Upper Major Threshold     50.000
> Upper Critical Threshold     65.000
> 
> We can use the following code to set just the Lower Minor Threshold:
> 
> memset( &thresholds, 0, sizeof(thresholds) );
> thresholds.LowMinor.IsSupported = SAHPI_TRUE;
> thresholds.LowMinor.Type = SAHPI_SENSOR_READING_TYPE_FLOAT64;
> thresholds.LowMinor.Value.SensorFloat64 = 120.0;
> saHpiSensorThresholdsSet( session, resId, sensor, &thresholds );
> 
> As a result we`ve got the following threshold values for this sensor:
> 
> Lower Minor Threshold    120.000
> Lower Major Threshold    -56.000
> Lower Critical Threshold    -56.000
> Upper Minor Threshold     40.000
> Upper Major Threshold     50.000
> Upper Critical Threshold     65.000
> 
> Do you think this is an issue in OpenHPI that needs to be fixed?

Yes

> 
> If so, the only fix we can propose is to read the current values of
> thresholds via saHpiThresholdsGet in every call to
> saHpiSensorThresholdsSet,
> and then merge the new and old thresholds together and verify the order.
> The
> proposed diff is attached. However we have some concerns about potential
> performance implications of this change.
> 
> What say?

Doing it this way allows the fix to be generic for all plugins which is
good. I don't think that thresholds are changed so often that it would have
such a huge impact on overall performance.

In other words, I have no problem with your fix.

> 
> Thanks and regards,
> Serge Zhukov
> Project manager
> Pigeon Point Systems



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Openhpi-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openhpi-devel

Reply via email to