[EMAIL PROTECTED] wrote on 09/13/2007 12:35:37 PM:

> 
> I have a question regarding OH_RESOURCE_GET (Verifies that resource
exists)
> versus OH_RESOURCE_GET_CHECK (Verifies that resource exists and has not
> failed) macro usage in resource relative functions in src/sahpi.c: what is
> the unwritten rule saying that a given function should use one or the
other?
> 
> In my opinion, some functions currently use the wrong one - at least when
> applied to ATCA systems since ATCA resources are marked as failed when
it's
> not possible to communicate with them anymore.
> 
> Here is a list of the ones I think should use OH_RESOURCE_GET_CHECK
instead
> of OH_RESOURCE_GET (There might be others):
> 
> saHpiSensorEnableGet
> saHpiSensorEnableSet
> saHpiSensorEventEnableGet
> saHpiSensorEventEnableSet
> saHpiSensorEventMasksGet
> saHpiSensorEventMasksSet
> saHpiHotSwapStateGet
saHpiIdrInfoGet 
saHpiIdrAreaHeaderGet 
saHpiIdrAreaAdd 
saHpiIdrAreaAddById 
saHpiIdrAreaDelete 
saHpiIdrFieldAdd 
saHpiIdrFieldAddById 
saHpiIdrFieldSet 
saHpiIdrFieldDelete 
saHpiAnnunciatorGetNext 
saHpiAnnunciatorGet 
saHpiAnnunciatorAcknowledge 
saHpiAnnunciatorModeGet 
saHpiAutoExtractTimeoutGet 
saHpiAutoExtractTimeoutSet 
saHpiHotSwapPolicyCancel 

I agree and adding those above to the list. I'd say the unwritten rule is
that if the API can return without calling the plugin, OH_RESOURCE_GET
should be used, meaning that whether the resource is failed or not is
irrelevant for the purposes of fulfilling the request. If the API has to
call the plugin to fulfill the request, then it probably means that the
resource state has a say on whether the request can be completed. 

That's fine with me. Do you need me to open a bug ?

-------------------------------------------------------------------------
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/
_______________________________________________
Openhpi-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openhpi-devel

Reply via email to