Ack

-Nagu

-----Original Message-----
From: Praveen Malviya 
Sent: 25 October 2013 16:30
To: [email protected]; Nagendra Kumar
Cc: [email protected]
Subject: [PATCH 1 of 1] amf : return ERR_NOT_SUPPORTED for unsupported feature 
in APIs [#170]

 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;
 

------------------------------------------------------------------------------
Sponsored by Intel(R) XDK 
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to