Ack, code review only/Thanks HansN

-----Original Message-----
From: nagendr...@oracle.com [mailto:nagendr...@oracle.com] 
Sent: den 21 maj 2015 09:21
To: Hans Nordebäck; praveen.malv...@oracle.com
Cc: opensaf-devel@lists.sourceforge.net
Subject: [PATCH 1 of 1] amfd: ignore invalid modification of 
saAmfSGMaxActiveSIsperSU/saAmfSGMaxStandbySIsperSU [#1361]

 osaf/services/saf/amf/amfd/sg.cc |  31 +++++++++++++++++++++++++------
 1 files changed, 25 insertions(+), 6 deletions(-)


saAmfSGMaxActiveSIsperSU is valid for NPM, N_WAY and N_WAY_ACTIVE and invalid 
for Nored and 2N. So, modification of this attribute for  Nored and 2N 
redudancy models should be ignored.

saAmfSGMaxStandbySIsperSU is valid for NPM and N_WAY and invalid for Nored, 2N 
and NwayAct. So, modification of this attribute for Nored, 2N and NwayAct 
redudancy models should be ignored.

diff --git a/osaf/services/saf/amf/amfd/sg.cc b/osaf/services/saf/amf/amfd/sg.cc
--- a/osaf/services/saf/amf/amfd/sg.cc
+++ b/osaf/services/saf/amf/amfd/sg.cc
@@ -919,15 +919,34 @@ static void ccb_apply_modify_hdlr(CcbUti
                        } else if (!strcmp(attribute->attrName, 
"saAmfSGMaxActiveSIsperSU")) {
                                if (value_is_deleted)
                                        sg->saAmfSGMaxActiveSIsperSU = -1;
-                               else
-                                       sg->saAmfSGMaxActiveSIsperSU = 
*((SaUint32T *)value);
-                               TRACE("Modified saAmfSGMaxActiveSIsperSU is 
'%u'", sg->saAmfSGMaxActiveSIsperSU);
+                               else {
+                                       if ((sg->sg_redundancy_model == 
SA_AMF_NPM_REDUNDANCY_MODEL) ||
+                                                       
(sg->sg_redundancy_model == SA_AMF_N_WAY_REDUNDANCY_MODEL) ||
+                                                       
(sg->sg_redundancy_model == SA_AMF_N_WAY_ACTIVE_REDUNDANCY_MODEL)) {
+                                               sg->saAmfSGMaxActiveSIsperSU = 
*((SaUint32T *)value);
+                                               TRACE("Modified 
saAmfSGMaxActiveSIsperSU is '%u'",
+                                                               
sg->saAmfSGMaxActiveSIsperSU);
+                                       } else {
+                                               LOG_NO("'%s' attribute 
saAmfSGMaxActiveSIsperSU not modified,"
+                                                               " not valid for 
Nored/2N Redundancy models",
+                                                               sg->name.value);
+                                       }
+                               }
                        } else if (!strcmp(attribute->attrName, 
"saAmfSGMaxStandbySIsperSU")) {
                                if (value_is_deleted)
                                        sg->saAmfSGMaxStandbySIsperSU = -1;
-                               else
-                                       sg->saAmfSGMaxStandbySIsperSU = 
*((SaUint32T *)value);
-                               TRACE("Modified saAmfSGMaxStandbySIsperSU is 
'%u'", sg->saAmfSGMaxStandbySIsperSU);
+                               else {
+                                       if ((sg->sg_redundancy_model == 
SA_AMF_NPM_REDUNDANCY_MODEL) ||
+                                                       
(sg->sg_redundancy_model == SA_AMF_N_WAY_REDUNDANCY_MODEL)) {
+                                               sg->saAmfSGMaxStandbySIsperSU = 
*((SaUint32T *)value);
+                                               TRACE("Modified 
saAmfSGMaxStandbySIsperSU is '%u'",
+                                                               
sg->saAmfSGMaxStandbySIsperSU);
+                                       } else {
+                                               LOG_NO("'%s' attribute 
saAmfSGMaxStandbySIsperSU not modified,"
+                                                               " not valid for 
Nored/2N/NwayAct Redundancy models",
+                                                               sg->name.value);
+                                       }
+                               }
                        } else if (!strcmp(attribute->attrName, 
"saAmfSGAutoAdjustProb")) {
                                if (value_is_deleted)
                                        sg->saAmfSGAutoAdjustProb = 
sg_type->saAmfSgtDefAutoAdjustProb;

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to