osaf/libs/agents/saf/amfa/ava_api.c |  10 +++++++---
 osaf/services/saf/amf/amfnd/cpm.cc  |   5 +++++
 2 files changed, 12 insertions(+), 3 deletions(-)


The patch will return ERR_NOT_SUPPORTED in following cases:
-saAmfInitialize_4() with the saAmfContainedComponentCleanupCallback or 
saAmfContainedComponentInstantiateCallback member filled up in callback 
structure.
-saAmfPmStart_3() is called with recovery not supported by AMF.
-saAmfResponse_4() with the response code SA_AIS_ERR_NOT_READY.

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
@@ -959,7 +959,7 @@ SaAisErrorT saAmfPmStart(SaAmfHandleT hd
        }
 
        /* input validation of Recomended recovery */
-       if (rec_Recovery < SA_AMF_NO_RECOMMENDATION || rec_Recovery > 
SA_AMF_CLUSTER_RESET) {
+       if (rec_Recovery < SA_AMF_NO_RECOMMENDATION || rec_Recovery > 
SA_AMF_CONTAINER_RESTART) {
                TRACE_LEAVE2("Incorrect argument specified for 
SaAmfRecommendedRecoveryT");
                return SA_AIS_ERR_INVALID_PARAM;
        }
@@ -2005,8 +2005,8 @@ SaAisErrorT saAmfInitialize_4(SaAmfHandl
        if ((reg_cbks != NULL) &&
            ((reg_cbks->saAmfContainedComponentCleanupCallback != 0) ||
             (reg_cbks->saAmfContainedComponentInstantiateCallback != 0))) {
-               TRACE_4("SA_AIS_ERR_INVALID_PARAM: unsupported callbacks");
-               rc = SA_AIS_ERR_INVALID_PARAM;
+               TRACE_4("SA_AIS_ERR_NOT_SUPPORTED: unsupported callbacks");
+               rc = SA_AIS_ERR_NOT_SUPPORTED;
                goto done;
        }
 
@@ -2568,6 +2568,10 @@ SaAisErrorT saAmfResponse_4(SaAmfHandleT
                        rc = SA_AIS_ERR_NOT_SUPPORTED;
                        goto done;
                }
+               if (error == SA_AIS_ERR_NOT_READY) {
+                       rc = SA_AIS_ERR_NOT_SUPPORTED;
+                       goto done;
+               }
        }
 
        rc = saAmfResponse(hdl, inv, error);
diff --git a/osaf/services/saf/amf/amfnd/cpm.cc 
b/osaf/services/saf/amf/amfnd/cpm.cc
--- a/osaf/services/saf/amf/amfnd/cpm.cc
+++ b/osaf/services/saf/amf/amfnd/cpm.cc
@@ -557,6 +557,11 @@ void avnd_comp_pm_param_val(AVND_CB *cb,
                                *o_amf_rc = SA_AIS_ERR_NOT_EXIST;
                                return;
                        }
+                       if ((pm_start->rec_rcvr.saf_amf >= 
SA_AMF_CLUSTER_RESET) && 
+                                       (pm_start->rec_rcvr.saf_amf <= 
SA_AMF_CONTAINER_RESTART)) {
+                               *o_amf_rc = SA_AIS_ERR_NOT_SUPPORTED;
+                               return;
+                       }
                }
                break;
 

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to