ack, code review only/Thanks HansN On 08/26/2015 07:21 AM, nagendr...@oracle.com wrote: > osaf/libs/agents/saf/amfa/ava_api.c | 28 ++++++++++++++++++++++------ > 1 files changed, 22 insertions(+), 6 deletions(-) > > > Amf is returning SA_AIS_ERR_INVALID_PARAM for SA_AMF_PM_ABNORMAL_END and its > combination with other SaAmfPmErrorsT flags. This is incorrect behaviour > because SA_AMF_PM_ABNORMAL_END and its combination with other SaAmfPmErrorsT > flags are valid input to APIs saAmfPmStart and saAmfPmStop. > Since these combinations feature is not supported in Amf as of now, > so, Amf should return SA_AIS_ERR_NOT_SUPPORTED for such > combinations. > The fix provides the same. > > diff --git a/osaf/libs/agents/saf/amfa/ava_api.c > b/osaf/libs/agents/saf/amfa/ava_api.c > --- a/osaf/libs/agents/saf/amfa/ava_api.c > +++ b/osaf/libs/agents/saf/amfa/ava_api.c > @@ -953,9 +953,17 @@ SaAisErrorT saAmfPmStart(SaAmfHandleT hd > > /* input validation of pmError */ > if (pmErr != SA_AMF_PM_NON_ZERO_EXIT && pmErr != SA_AMF_PM_ZERO_EXIT && > - pmErr != (SA_AMF_PM_NON_ZERO_EXIT | SA_AMF_PM_ZERO_EXIT)) { > - TRACE_LEAVE2("Incorrect argument specified for SaAmfPmErrorsT > "); > - return SA_AIS_ERR_INVALID_PARAM; > + pmErr != (SA_AMF_PM_NON_ZERO_EXIT | > SA_AMF_PM_ZERO_EXIT)) { > + if ((pmErr == SA_AMF_PM_ABNORMAL_END) || > + (pmErr == (SA_AMF_PM_NON_ZERO_EXIT | > SA_AMF_PM_ABNORMAL_END)) || > + (pmErr == (SA_AMF_PM_ZERO_EXIT | > SA_AMF_PM_ABNORMAL_END)) || > + (pmErr == (SA_AMF_PM_ZERO_EXIT | > SA_AMF_PM_NON_ZERO_EXIT | SA_AMF_PM_ABNORMAL_END))) { > + TRACE_LEAVE2("Unsupported argument specified for > SaAmfPmErrorsT "); > + return SA_AIS_ERR_NOT_SUPPORTED; > + } else { > + TRACE_LEAVE2("Incorrect argument specified for > SaAmfPmErrorsT "); > + return SA_AIS_ERR_INVALID_PARAM; > + } > } > > /* input validation of Recomended recovery */ > @@ -1064,9 +1072,17 @@ SaAisErrorT saAmfPmStop(SaAmfHandleT hdl > > /* input validation of pmError */ > if (pmErr != SA_AMF_PM_NON_ZERO_EXIT && pmErr != SA_AMF_PM_ZERO_EXIT && > - pmErr != (SA_AMF_PM_NON_ZERO_EXIT | SA_AMF_PM_ZERO_EXIT)) { > - TRACE_LEAVE2("Incorrect argument specified for SaAmfPmErrorsT"); > - return SA_AIS_ERR_INVALID_PARAM; > + pmErr != (SA_AMF_PM_NON_ZERO_EXIT | > SA_AMF_PM_ZERO_EXIT)) { > + if ((pmErr == SA_AMF_PM_ABNORMAL_END) || > + (pmErr == (SA_AMF_PM_NON_ZERO_EXIT | > SA_AMF_PM_ABNORMAL_END)) || > + (pmErr == (SA_AMF_PM_ZERO_EXIT | > SA_AMF_PM_ABNORMAL_END)) || > + (pmErr == (SA_AMF_PM_ZERO_EXIT | > SA_AMF_PM_NON_ZERO_EXIT | SA_AMF_PM_ABNORMAL_END))) { > + TRACE_LEAVE2("Unsupported argument specified for > SaAmfPmErrorsT "); > + return SA_AIS_ERR_NOT_SUPPORTED; > + } else { > + TRACE_LEAVE2("Incorrect argument specified for > SaAmfPmErrorsT"); > + return SA_AIS_ERR_INVALID_PARAM; > + } > } > > /* input validation of Process ID */
------------------------------------------------------------------------------ _______________________________________________ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel