Re: [devel] [PATCH 1 of 1] smf:balanced upgrade, no activation/deactivation done [#2126]

2016-11-02 Thread Lennart Lund
Ack

/Lennart

> -Original Message-
> From: Rafael Odzakow
> Sent: den 28 oktober 2016 14:24
> To: reddy.neelaka...@oracle.com; Lennart Lund
> 
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: [PATCH 1 of 1] smf:balanced upgrade, no activation/deactivation
> done [#2126]
> 
>  osaf/services/saf/smfsv/smfd/SmfExecControl.cc |  21 +++
> --
>  1 files changed, 11 insertions(+), 10 deletions(-)
> 
> 
> Add the deactivation list to the balanced procedure, it was declared but not
> used.
> 
> diff --git a/osaf/services/saf/smfsv/smfd/SmfExecControl.cc
> b/osaf/services/saf/smfsv/smfd/SmfExecControl.cc
> --- a/osaf/services/saf/smfsv/smfd/SmfExecControl.cc
> +++ b/osaf/services/saf/smfsv/smfd/SmfExecControl.cc
> @@ -35,8 +35,8 @@ static std::vector getS
>  static SmfUpgradeStep* mergeStep(SmfUpgradeProcedure* procedure,
>   const std::vector& steps);
> 
> -static bool removeDuplicateActivationUnits(SmfUpgradeProcedure *
> i_newproc,
> -   SmfUpgradeStep *newStep);
> +static bool removeDuplicateActivationUnits(SmfUpgradeProcedure *
> i_newproc, SmfUpgradeStep *newStep,
> +   const 
> std::list& deact);
> 
> 
>  static bool isNodeInGroup(const std::string& node,
> @@ -104,14 +104,18 @@ bool createStepForBalancedProc(SmfUpgrad
>SmfUpgradeCampaign* ucamp = camp->getUpgradeCampaign();
> 
>auto steps = getStepsMatchingBalancedGroup(procedure, ucamp);
> +  std::list  deact;
>for (auto step : steps) {
>  SmfUpgradeProcedure* oproc = step->getProcedure();
>  // copy callbacks to the new procedure
>  procedure->getCallbackList(oproc->getUpgradeMethod());
> +deact.insert(deact.end(),
> + step->getDeactivationUnitList().begin(),
> + step->getDeactivationUnitList().end());
>}
>if (!steps.empty()) {
>  SmfUpgradeStep* newstep = mergeStep(procedure, steps);
> -removeDuplicateActivationUnits(procedure, newstep);
> +removeDuplicateActivationUnits(procedure, newstep, deact);
>  procedure->addProcStep(newstep);
>}
>const std::vector& allprocs = ucamp-
> >getProcedures();
> @@ -201,15 +205,11 @@ SmfUpgradeStep* mergeStep(SmfUpgradeProc
>newstep->setDn(newstep->getRdn() + "," + procedure->getDn());
>newstep->setMaxRetry(0);
>newstep->setRestartOption(0);
> -  std::list  deact;
>for (auto step : steps) {
>  if (isNodeInGroup(step->getSwNode(), procedure->getBalancedGroup()))
> {
> -  TRACE("adding modifications, deact and bundle ref from node:%s",
> +  TRACE("adding modifications and bundle ref from node:%s",
>  step->getSwNode().c_str());
>newstep->addModifications(step->getModifications());
> -  deact.insert(deact.end(),
> -   step->getDeactivationUnitList().begin(),
> -   step->getDeactivationUnitList().end());
>procedure->mergeBundleRefRollingToSingleStep(newstep, step);
>  }
>}
> @@ -217,13 +217,14 @@ SmfUpgradeStep* mergeStep(SmfUpgradeProc
>return newstep;
>  }
> 
> -bool removeDuplicateActivationUnits(SmfUpgradeProcedure * i_newproc,
> -SmfUpgradeStep *newStep) {
> +bool removeDuplicateActivationUnits(SmfUpgradeProcedure * i_newproc,
> SmfUpgradeStep *newStep,
> +const std::list& 
> deact) {
>// Remove any (de)activation unit duplicates and add them to the step.
>// Activation and deactivation units are the same because rolling and
>// formodify is symetric.
>TRACE_ENTER();
>std::list < unitNameAndState > tmpDU;
> +  tmpDU.insert(tmpDU.begin(), deact.begin(), deact.end());
>std::multimap objInstances;
>if (i_newproc->getImmComponentInfo(objInstances) == false) {
>  TRACE("Config info from IMM could not be read");

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 1 of 1] smf:balanced upgrade, no activation/deactivation done [#2126]

2016-10-28 Thread Rafael Odzakow
 osaf/services/saf/smfsv/smfd/SmfExecControl.cc |  21 +++--
 1 files changed, 11 insertions(+), 10 deletions(-)


Add the deactivation list to the balanced procedure, it was declared but not
used.

diff --git a/osaf/services/saf/smfsv/smfd/SmfExecControl.cc 
b/osaf/services/saf/smfsv/smfd/SmfExecControl.cc
--- a/osaf/services/saf/smfsv/smfd/SmfExecControl.cc
+++ b/osaf/services/saf/smfsv/smfd/SmfExecControl.cc
@@ -35,8 +35,8 @@ static std::vector getS
 static SmfUpgradeStep* mergeStep(SmfUpgradeProcedure* procedure,
  const std::vector& steps);
 
-static bool removeDuplicateActivationUnits(SmfUpgradeProcedure * i_newproc,
-   SmfUpgradeStep *newStep);
+static bool removeDuplicateActivationUnits(SmfUpgradeProcedure * i_newproc, 
SmfUpgradeStep *newStep,
+   const std::list& 
deact);
 
 
 static bool isNodeInGroup(const std::string& node,
@@ -104,14 +104,18 @@ bool createStepForBalancedProc(SmfUpgrad
   SmfUpgradeCampaign* ucamp = camp->getUpgradeCampaign();
 
   auto steps = getStepsMatchingBalancedGroup(procedure, ucamp);
+  std::list  deact;
   for (auto step : steps) {
 SmfUpgradeProcedure* oproc = step->getProcedure();
 // copy callbacks to the new procedure
 procedure->getCallbackList(oproc->getUpgradeMethod());
+deact.insert(deact.end(),
+ step->getDeactivationUnitList().begin(),
+ step->getDeactivationUnitList().end());
   }
   if (!steps.empty()) {
 SmfUpgradeStep* newstep = mergeStep(procedure, steps);
-removeDuplicateActivationUnits(procedure, newstep);
+removeDuplicateActivationUnits(procedure, newstep, deact);
 procedure->addProcStep(newstep);
   }
   const std::vector& allprocs = ucamp->getProcedures();
@@ -201,15 +205,11 @@ SmfUpgradeStep* mergeStep(SmfUpgradeProc
   newstep->setDn(newstep->getRdn() + "," + procedure->getDn());
   newstep->setMaxRetry(0);
   newstep->setRestartOption(0);
-  std::list  deact;
   for (auto step : steps) {
 if (isNodeInGroup(step->getSwNode(), procedure->getBalancedGroup())) {
-  TRACE("adding modifications, deact and bundle ref from node:%s",
+  TRACE("adding modifications and bundle ref from node:%s",
 step->getSwNode().c_str());
   newstep->addModifications(step->getModifications());
-  deact.insert(deact.end(),
-   step->getDeactivationUnitList().begin(),
-   step->getDeactivationUnitList().end());
   procedure->mergeBundleRefRollingToSingleStep(newstep, step);
 }
   }
@@ -217,13 +217,14 @@ SmfUpgradeStep* mergeStep(SmfUpgradeProc
   return newstep;
 }
 
-bool removeDuplicateActivationUnits(SmfUpgradeProcedure * i_newproc,
-SmfUpgradeStep *newStep) {
+bool removeDuplicateActivationUnits(SmfUpgradeProcedure * i_newproc, 
SmfUpgradeStep *newStep,
+const std::list& deact) {
   // Remove any (de)activation unit duplicates and add them to the step.
   // Activation and deactivation units are the same because rolling and
   // formodify is symetric.
   TRACE_ENTER();
   std::list < unitNameAndState > tmpDU;
+  tmpDU.insert(tmpDU.begin(), deact.begin(), deact.end());
   std::multimap objInstances;
   if (i_newproc->getImmComponentInfo(objInstances) == false) {
 TRACE("Config info from IMM could not be read");

--
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel