[devel] [PATCH 1 of 1] amfd: allow lock and unlock operation on NoRed MW SI. [#1834]

2016-06-23 Thread praveen . malviya
 osaf/services/saf/amf/amfd/si.cc |  20 +++-
 1 files changed, 19 insertions(+), 1 deletions(-)


In the reported issue, amfd crashes during deletion of MW NoRed SI while
standby SC is coming up.

Here requirement is to bring down a payload node and delete its related 
configuration
like node, MW SI, MW SU etc. As per AMF PR doc section 7.1.4 , SI must be 
locked before
deleting it. Also AMF allows deletion of SI in unlocked state if it is 
unassigned, but
it is not the recommended way. Since lock operation on NoRed MW SI is not 
allowed,
the only way to delete is when it is unassigned. This imposes another criterion 
to bring
down the node or lock NoRed SU so that its MW SI gets unassigned and its 
deletion can proceed.
Even in this case also, AMF can pick the same SI and assign it to some other 
unassigned node
or any node joining the cluster that time. Thus there is no gaurantee that SI 
will remain
unassigned.

Patch allows lock and unlock admin op on MW NoRed SI accept the one assigned on
active SC.

diff --git a/osaf/services/saf/amf/amfd/si.cc b/osaf/services/saf/amf/amfd/si.cc
--- a/osaf/services/saf/amf/amfd/si.cc
+++ b/osaf/services/saf/amf/amfd/si.cc
@@ -800,11 +800,29 @@ static void si_admin_op_cb(SaImmOiHandle
 
si = avd_si_get(objectName);

-   if ((operationId != SA_AMF_ADMIN_SI_SWAP) && (si->sg_of_si->sg_ncs_spec 
== true)) {
+   if ((operationId != SA_AMF_ADMIN_SI_SWAP) && (operationId != 
SA_AMF_ADMIN_LOCK) &&
+   (operationId != SA_AMF_ADMIN_UNLOCK) && 
(si->sg_of_si->sg_ncs_spec == true)) {
report_admin_op_error(immOiHandle, invocation, 
SA_AIS_ERR_NOT_SUPPORTED, nullptr,
"Admin operation %llu on MW SI is not allowed", 
operationId);
goto done;
}
+   if (((operationId == SA_AMF_ADMIN_LOCK) || (operationId == 
SA_AMF_ADMIN_UNLOCK)) &&
+   (si->sg_of_si->sg_ncs_spec == true)) { 
+   if (si->sg_of_si->sg_redundancy_model == 
SA_AMF_2N_REDUNDANCY_MODEL) {
+   report_admin_op_error(immOiHandle, invocation, 
+   SA_AIS_ERR_NOT_SUPPORTED, nullptr,
+   "Admin operation %llu on MW 2N SI is 
not allowed", operationId);
+   goto done;
+   } else if ((si->sg_of_si->sg_redundancy_model == 
SA_AMF_NO_REDUNDANCY_MODEL) &&
+   (si->list_of_sisu != nullptr) && (operationId 
== SA_AMF_ADMIN_LOCK) &&
+   (avd_cb->node_id_avd == 
si->list_of_sisu->su->su_on_node->node_info.nodeId)) {
+   //No specific reason, but conforming to existing 
notions for active SC.
+   report_admin_op_error(immOiHandle, invocation, 
+   SA_AIS_ERR_NOT_SUPPORTED, nullptr,
+   "Admin lock of MW SI assigned on Active SC is 
not allowed");
+   goto done;
+   }
+   }
/* if Tolerance timer is running for any SI's withing this SG, then 
return SA_AIS_ERR_TRY_AGAIN */
 if (sg_is_tolerance_timer_running_for_any_si(si->sg_of_si)) {
report_admin_op_error(immOiHandle, invocation, 
SA_AIS_ERR_TRY_AGAIN, nullptr,

--
Attend Shape: An AT Tech Expo July 15-16. Meet us at AT Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0 of 1] Review Request for amfd: allow lock and unlock operation on NoRed MW SI. [#1834]

2016-06-23 Thread praveen . malviya
Summary: amfd: allow lock and unlock operation on NoRed MW SI. [#1834] 
Review request for Trac Ticket(s): #1834 
Peer Reviewer(s): AMF devs 
Pull request to: <>
Affected branch(es): ALL 
Development branch: <>


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each "y" above):
-

changeset d8a2f7c2d507d852893d902b5408d7b8fad28b00
Author: praveen.malv...@oracle.com
Date:   Fri, 24 Jun 2016 11:02:00 +0530

amfd: allow lock and unlock operation on NoRed MW SI. [#1834]

In the reported issue, amfd crashes during deletion of MW NoRed SI while
standby SC is coming up.

Here requirement is to bring down a payload node and delete its related
configuration like node, MW SI, MW SU etc. As per AMF PR doc section 
7.1.4 ,
SI must be locked before deleting it. Also AMF allows deletion of SI in
unlocked state if it is unassigned, but it is not the recommended way. 
Since
lock operation on NoRed MW SI is not allowed, the only way to delete is 
when
it is unassigned. This imposes another criterion to bring down the node 
or
lock NoRed SU so that its MW SI gets unassigned and its deletion can
proceed. Even in this case also, AMF can pick the same SI and assign it 
to
some other unassigned node or any node joining the cluster that time. 
Thus
there is no gaurantee that SI will remain unassigned.

Patch allows lock and unlock admin op on MW NoRed SI accept the one 
assigned
on active SC.


Complete diffstat:
--
 osaf/services/saf/amf/amfd/si.cc |  20 +++-
 1 files changed, 19 insertions(+), 1 deletions(-)


Testing Commands:
-
Try to lock and unlock MW SI which is assigned on other than 
active controller when cluster is stable from AMF perspective.

Testing, Expected Results:
--
Lock and unlock operation successful.

Conditions of Submission:
-
Ack from any reviewer.

Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the 

Re: [devel] [PATCH 1 of 1] cpnd: To reject creating section which has id length longer than MAX_SEC_ID_LEN [#1667]

2016-06-23 Thread A V Mahesh
Hi Hoang,

Ok I will push , can you please re-base and provide "[PATCH 1 of 2] 
ckpt: To add a new test case to verify creating section with id lenght 
longer than MAX_SIZE(30) [#1667]"

this not getting applied directly , on current code base.

-AVM

On 6/23/2016 4:35 PM, Vo Minh Hoang wrote:
> Dear Mahesh,
>
> Thank you very much for your review.
>
> Would you please push this when you have time.
>
> I confirmed LONG DN requirement and its target seems only SaNameT objects.
> Section name does not use DN so it still stay at fix 50 limit.
>
> More information, when you are reviewing Long DN implementation in CKPT, I
> have just submit newest patch files of Long DN. Basically, they are patches
> that Nhat Pham already submitted. I just rebase them to current source base
> (merging with headless feature, etc..).
> I hope this could help your review work easier.
>
> Best regards,
> Hoang
>
> -Original Message-
> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
> Sent: Monday, June 20, 2016 10:58 AM
> To: Vo Minh Hoang 
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: Re: [PATCH 1 of 1] cpnd: To reject creating section which has id
> length longer than MAX_SEC_ID_LEN [#1667]
>
> Hi  Hoang,
>
> No issue , for now we can push this for to over come current bug that you
> are facing .
>
> We can address all the  LONG DN related issue including Section ID length.
>
> 
> 
> Object Class : Table 2 DN Formats for Objects of Checkpoint Service Classes
> (SAI-AIS-CKPT-B.02.02 spec)
>
> 1) SaCkptCheckpoint -- "safCkpt=...,* "
>
> 2) SaCkptReplica -- "safReplica=...,safCkpt=...,* "
>
> 
> 
>
> So ACK form me not tested.
>
> -AVM
>
>
> On 6/14/2016 2:40 PM, Vo Minh Hoang wrote:
>> Dear Mahesh,
>>
>> Thank you very much for your information.
>> It seem I have lack of information when receiving this ticket from
>> Nhat Pham.
>> We will consider more about this.
>>
>> Sincerely,
>> Hoang
>>
>> -Original Message-
>> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
>> Sent: Tuesday, June 14, 2016 3:55 PM
>> To: Hoang Vo 
>> Cc: opensaf-devel@lists.sourceforge.net
>> Subject: Re: [PATCH 1 of 1] cpnd: To reject creating section which has
>> id length longer than MAX_SEC_ID_LEN [#1667]
>>
>> Hi Hoang Vo,
>>
>> This patch is already published by Nhat Pham , and
>>
>> it is under review, I also provided few comments ( attached ) , please
>> check.
>>
>> -AVM
>>
>>
>> On 6/14/2016 1:48 PM, Hoang Vo wrote:
>>> osaf/services/saf/cpsv/cpnd/cpnd_evt.c |  11 +++
>>> 1 files changed, 11 insertions(+), 0 deletions(-)
>>>
>>>
>>> When a section with id size greater than MAX_SEC_ID_LEN [50], the
>>> cpnd
>> restarts with core dump.
>>> This fixing validates id size before creating section.
>>>
>>> diff --git a/osaf/services/saf/cpsv/cpnd/cpnd_evt.c
>>> b/osaf/services/saf/cpsv/cpnd/cpnd_evt.c
>>> --- a/osaf/services/saf/cpsv/cpnd/cpnd_evt.c
>>> +++ b/osaf/services/saf/cpsv/cpnd/cpnd_evt.c
>>> @@ -2167,6 +2167,7 @@ static uint32_t cpnd_evt_proc_ckpt_sect_
>>> CPSV_CKPT_DATA *ckpt_data = NULL;
>>> SaTimeT now, duration;
>>> int64_t time_stamp, giga_sec, result;
>>> +   uint16_t sec_id_len =
>>> +evt->info.sec_creatReq.sec_attri.sectionId->idLen;
>>> 
>>> TRACE_ENTER();
>>> memset(_evt, '\0', sizeof(CPSV_EVT)); @@ -2205,6 +2206,16 
>>> @@
>>> static uint32_t cpnd_evt_proc_ckpt_sect_
>>> TRACE_4("cpnd ckpt sect create failed for
>> ckpt_id:%llx,return value:%d",evt->info.sec_creatReq.ckpt_id,
>> SA_AIS_ERR_INVALID_PARAM);
>>> goto agent_rsp;
>>> }
>>> +
>>> +   if (sec_id_len >= MAX_SEC_ID_LEN) {
>>> +   send_evt.type = CPSV_EVT_TYPE_CPA;
>>> +   send_evt.info.cpa.type = CPA_EVT_ND2A_SEC_CREATE_RSP;
>>> +   send_evt.info.cpa.info.sec_creat_rsp.error =
>> SA_AIS_ERR_INVALID_PARAM;
>>> +   LOG_NO("cpnd ckpt sect create failed for ckpt_id:%llx,return
>> value:%d - sec_id_len:%d over supported limit %d",
>>> +   evt->info.sec_creatReq.ckpt_id,
>> SA_AIS_ERR_INVALID_PARAM, sec_id_len, MAX_SEC_ID_LEN);
>>> +   goto agent_rsp;
>>> +   }
>>> +
>>> if (evt->info.sec_creatReq.sec_attri.sectionId->id == NULL &&
>>> evt->info.sec_creatReq.sec_attri.sectionId->idLen == 0) {
>>> if (cp_node->create_attrib.maxSections > 1) {
>


--
Attend Shape: An AT Tech Expo July 15-16. Meet us at AT Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and 

[devel] [PATCH 1 of 1] amfd: avoid resetting alarm for duplicate node ups [#1893]

2016-06-23 Thread nagendra . k
 osaf/services/saf/amf/amfd/ndfsm.cc |  12 +++-
 1 files changed, 11 insertions(+), 1 deletions(-)


When Amfd receives duplicate node up messages from Act
amfnd, then it tries to reset alarm_sent for SI.
This happens when cluster is recovering from headless state.
And if that happens then when those SIs gets assigned,
then alarms are not reset.
This patch fixes this issue. It avoids resetting alarm_sent
when duplicate node ups are received.

diff --git a/osaf/services/saf/amf/amfd/ndfsm.cc 
b/osaf/services/saf/amf/amfd/ndfsm.cc
--- a/osaf/services/saf/amf/amfd/ndfsm.cc
+++ b/osaf/services/saf/amf/amfd/ndfsm.cc
@@ -51,11 +51,13 @@ void avd_process_state_info_queue(AVD_CL
uint32_t i;
const auto queue_size = cb->evt_queue.size();
AVD_EVT_QUEUE *queue_evt = nullptr;
+   /* Counter for Act Amfnd node up message.*/
+   static int act_amfnd_node_up_count = 0;
 
TRACE_ENTER();
 
TRACE("queue_size before processing: %lu", (unsigned long) queue_size);
-
+   act_amfnd_node_up_count ++;
// recover assignments from state info
for(i=0 ; ievt_queue.front();
@@ -91,6 +93,13 @@ void avd_process_state_info_queue(AVD_CL
}
}
 
+   /* Alarms shouldn't be reset in next subsequent node up message.
+  Because in the previous node up messages queue_size might have
+  been zero. In the subsequent node up messages, this might cause
+  alarm_sent to get reset and this may cause unassigned alarm to
+  exist even those SIs are assigned after some time.*/
+   if (act_amfnd_node_up_count > 1) goto done;
+
// Once active amfd looks up the state info from queue, that means node 
sync
// finishes. Therefore, if the queue is empty, this active amfd is 
coming
// from a cluster restart, the alarm state should be reset.
@@ -115,6 +124,7 @@ void avd_process_state_info_queue(AVD_CL
}
}
}
+done:
TRACE("queue_size after processing: %lu", (unsigned long) 
cb->evt_queue.size());
TRACE_LEAVE();
 }

--
Attend Shape: An AT Tech Expo July 15-16. Meet us at AT Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0 of 1] Review Request for amfd: avoid resetting alarm for duplicate node ups [#1893]

2016-06-23 Thread nagendra . k
Summary: amfd: avoid resetting alarm for duplicate node ups [#1893]
Review request for Trac Ticket(s): #1893
Peer Reviewer(s): Amf developers 
Pull request to: <>
Affected branch(es): 5.0 and default
Development branch: default


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each "y" above):
-
 <>

changeset 754ddba41f0ed11af2cf426677fe68dd69ec3b07
Author: Nagendra Kumar
Date:   Thu, 23 Jun 2016 16:13:30 +0530

amfd: avoid resetting alarm for duplicate node ups [#1893] When Amfd
receives duplicate node up messages from Act amfnd, then it tries to 
reset
alarm_sent for SI. This happens when cluster is recovering from headless
state. And if that happens then when those SIs gets assigned, then 
alarms
are not reset. This patch fixes this issue. It avoids resetting 
alarm_sent
when duplicate node ups are received.


Complete diffstat:
--
 osaf/services/saf/amf/amfd/ndfsm.cc |  12 +++-
 1 files changed, 11 insertions(+), 1 deletions(-)


Testing Commands:
-
Please refer the ticket.

Testing, Expected Results:
--
Please refer the ticket.


Conditions of Submission:
-
Ack from Amf Developers.

Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
Attend Shape: An AT Tech Expo July 15-16. Meet us at AT Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 0 of 1] Review Request for smf: Lock nodes in parallel [#1634]

2016-06-23 Thread Lennart Lund
More comments:

SmfAdminOperation should not abort if IMM error e.g. bad handle or timeout.
- Retry if timeout when obtaining handles (a limited numbers of times)
- If IMM fail in the constructor do not abort just log the problem.
- If IMM problem in a method do not abort, log the problem and fail

/Lennart

> -Original Message-
> From: Lennart Lund
> Sent: den 21 juni 2016 14:27
> To: reddy.neelaka...@oracle.com; Rafael Odzakow
> 
> Cc: opensaf-devel@lists.sourceforge.net; Lennart Lund
> 
> Subject: RE: [devel] [PATCH 0 of 1] Review Request for smf: Lock nodes in
> parallel [#1634]
> 
> The cluster name is actually read. It was a default value that was hard coded.
> No more patch will be added
> 
> My comments to be fixed before push:
> 1.
> Remove hard coded default for cluster name.
> Actually it is not the cluster name that is needed. What's needed is the
> parent DN needed when creating a node group. This is read from IMM (is the
> same as the cluster name)
> 2.
> Some renaming in order to make usage of variables and methods more clear
> 
> /Lennart
> 
> > -Original Message-
> > From: Lennart Lund
> > Sent: den 17 juni 2016 17:15
> > To: Lennart Lund ;
> > reddy.neelaka...@oracle.com; Rafael Odzakow
> > 
> > Cc: opensaf-devel@lists.sourceforge.net
> > Subject: RE: [devel] [PATCH 0 of 1] Review Request for smf: Lock nodes in
> > parallel [#1634]
> >
> > Hi
> >
> > In this patch cluster name is hard coded to "safAmfCluster=myAmfCluster".
> I
> > will add a patch that read the name instead
> >
> > Thanks
> > Lennart
> >
> > > -Original Message-
> > > From: Lennart Lund [mailto:lennart.l...@ericsson.com]
> > > Sent: den 17 juni 2016 17:08
> > > To: reddy.neelaka...@oracle.com; Rafael Odzakow
> > > 
> > > Cc: opensaf-devel@lists.sourceforge.net
> > > Subject: [devel] [PATCH 0 of 1] Review Request for smf: Lock nodes in
> > > parallel [#1634]
> > >
> > > Summary: smf: Lock nodes in parallel
> > > Review request for Trac Ticket(s): #1634
> > > Peer Reviewer(s): reddy.neelaka...@oracle.com,
> > > rafael.odza...@ericsson.com
> > > Pull request to: <>
> > > Affected branch(es): devel
> > > Development branch: <>
> > >
> > > 
> > > Impacted area   Impact y/n
> > > 
> > >  Docsn
> > >  Build systemn
> > >  RPM/packaging   n
> > >  Configuration files n
> > >  Startup scripts n
> > >  SAF servicesy
> > >  OpenSAF servicesn
> > >  Core libraries  n
> > >  Samples n
> > >  Tests   n
> > >  Other   n
> > >
> > >
> > > Comments (indicate scope for each "y" above):
> > > -
> > >
> > > changeset 155aaab4571280481cb1333d3e63cc8175a5f735
> > > Author:   Lennart Lund 
> > > Date: Fri, 17 Jun 2016 14:18:51 +0200
> > >
> > >   smf: Lock nodes in parallel [#1634]
> > >
> > >   A new SetAdminState class for handling admin operation on nodes,
> > > SUs and
> > >   components is created This class replaces the callAdminOperation()
> > > method in
> > >   the SmfUpgradeStep class It operates on the list of units created for
> > > the
> > >   step. Admin of SUs and components is handled serial as before but
> > > nodes are
> > >   handled in parallel via node groups
> > >
> > >
> > > Complete diffstat:
> > > --
> > >  osaf/services/saf/smfsv/smfd/SmfUpgradeStep.cc   |  991
> > >
> >
> ++
> > > +++--
> > >  osaf/services/saf/smfsv/smfd/SmfUpgradeStep.hh   |   96 +++-
> > >  osaf/services/saf/smfsv/smfd/SmfUtils.cc |2 +
> > >  osaf/services/saf/smfsv/smfd/smfd_campaign_oi.cc |2 +-
> > >  osaf/services/saf/smfsv/smfd/smfd_evt.c  |2 +-
> > >  5 files changed, 949 insertions(+), 144 deletions(-)
> > >
> > >
> > > Testing Commands:
> > > -
> > > For testing parallel lock, lock-in, unlock-in and unlock (nodes):
> > > Run a single step campaign with nodes as activation/deactivation units
> > >
> > > For testing above sequence with SUs (will be handled in series as before):
> > > Run a single step campaign with SUs as activation/deactivation units
> > >
> > > Suggest test of a mix of nodes and SUs. Nodes will be handled in parallel
> > and
> > > SUs in series:
> > > Run a single step campaign with nodes and SUs as activation/deactivation
> > > units
> > >
> > > For testing restart of components:
> > > Run a single steprolling campaign with components as
> > activation/deactivation
> > > units
> > >
> > > Steps:
> > > Build an UML cluster and install the demo app
> > > > build_uml
> > > > env APPCONFIG=AppConfig-nwayactive.xml ./build_uml
> install_testprog
> > >
> > > On node
> 

[devel] [PATCH 0 of 1] Review Request for libs/core: add support for long DN in sanamet encode & decode functions V2 [#1674]

2016-06-23 Thread Gary Lee
Summary: libs/core: add support for long DN in sanamet encode & decode 
functions V2 [#1674]
Review request for Trac Ticket(s): 1674 
Peer Reviewer(s): Ramesh, AMF devs 
Pull request to: <>
Affected branch(es): <>
Development branch: <>


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesn
 OpenSAF servicesn
 Core libraries  y 
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each "y" above):
-

Removed unused function declaration and #include from V1

changeset 1bb86038a1611d59b67721c0c87bffa5e4a72290
Author: Gary Lee 
Date:   Thu, 23 Jun 2016 17:47:49 +1000

libs/core: add support for long DN in sanamet encode & decode functions 
V2 [#1674]

Currently, ncs_edp_sanamet encodes a SaNameT by storing the length in 2
bytes, followed by a fixed char array of length SA_MAX_NAME_LENGTH.

This patch adds long DN support by:

1) if length < SA_MAX_NAME_LENGTH, encode as present
2) if length >= SA_MAX_NAME_LENGTH, encode as a variable string like 
ncs_edp_string


Complete diffstat:
--
 osaf/libs/core/common/saf_edu.c|   33 ++---
 osaf/libs/core/include/ncsencdec_pub.h |2 ++
 osaf/libs/core/leap/hj_enc.c   |  100 

 3 files changed, 100 insertions(+), 35 deletions(-)


Testing Commands:
-
 <>


Testing, Expected Results:
--
 <>


Conditions of Submission:
-
 <>


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y 
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
Attend Shape: An AT Tech Expo July 15-16. Meet us at AT Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
___
Opensaf-devel mailing list

[devel] [PATCH 1 of 1] libs/core: add support for long DN in sanamet encode & decode functions V2 [#1674]

2016-06-23 Thread Gary Lee
 osaf/libs/core/common/saf_edu.c|   33 +
 osaf/libs/core/include/ncsencdec_pub.h |2 +
 osaf/libs/core/leap/hj_enc.c   |  100 ++--
 3 files changed, 100 insertions(+), 35 deletions(-)


Currently, ncs_edp_sanamet encodes a SaNameT by storing the length in 2 bytes,
followed by a fixed char array of length SA_MAX_NAME_LENGTH.

This patch adds long DN support by:

1) if length < SA_MAX_NAME_LENGTH, encode as present
2) if length >= SA_MAX_NAME_LENGTH, encode as a variable string like 
ncs_edp_string

diff --git a/osaf/libs/core/common/saf_edu.c b/osaf/libs/core/common/saf_edu.c
--- a/osaf/libs/core/common/saf_edu.c
+++ b/osaf/libs/core/common/saf_edu.c
@@ -57,36 +57,15 @@
 uint32_t ncs_edp_sanamet(EDU_HDL *hdl, EDU_TKN *edu_tkn,
  NCSCONTEXT ptr, uint32_t *ptr_data_len, EDU_BUF_ENV 
*buf_env, EDP_OP_TYPE op, EDU_ERR *o_err)
 {
-   uint32_t rc = NCSCC_RC_SUCCESS;
-   SaNameT *struct_ptr = NULL, **d_ptr = NULL;
-
-   EDU_INST_SET saname_rules[] = {
-   {EDU_START, ncs_edp_sanamet, 0, 0, 0, sizeof(SaNameT), 0, NULL},
-   {EDU_EXEC, m_NCS_EDP_SAUINT16T, 0, 0, 0,
-(long)&((SaNameT *)0)->length, 0, NULL},
-   {EDU_EXEC, ncs_edp_uns8, EDQ_ARRAY, 0, 0,
-(long)&((SaNameT *)0)->value, SA_MAX_NAME_LENGTH, NULL},
-   {EDU_END, 0, 0, 0, 0, 0, 0, NULL},
-   };
-
if (op == EDP_OP_TYPE_ENC) {
-   struct_ptr = (SaNameT *)ptr;
+   const SaNameT *name = ptr;
+   osaf_encode_sanamet(buf_env->info.uba, name);
} else if (op == EDP_OP_TYPE_DEC) {
-   d_ptr = (SaNameT **)ptr;
-   if (*d_ptr == NULL) {
-   *d_ptr = m_MMGR_ALLOC_EDP_SANAMET;
-   if (*d_ptr == NULL) {
-   *o_err = EDU_ERR_MEM_FAIL;
-   return NCSCC_RC_FAILURE;
-   }
-   }
-   memset(*d_ptr, '\0', sizeof(SaNameT));
-   struct_ptr = *d_ptr;
-   } else {
-   struct_ptr = ptr;
+   SaNameT *name = *(SaNameT**)ptr;
+   osaf_decode_sanamet(buf_env->info.uba, name);
}
-   rc = m_NCS_EDU_RUN_RULES(hdl, edu_tkn, saname_rules, struct_ptr, 
ptr_data_len, buf_env, op, o_err);
-   return rc;
+   
+   return NCSCC_RC_SUCCESS;
 }
 
 /*
diff --git a/osaf/libs/core/include/ncsencdec_pub.h 
b/osaf/libs/core/include/ncsencdec_pub.h
--- a/osaf/libs/core/include/ncsencdec_pub.h
+++ b/osaf/libs/core/include/ncsencdec_pub.h
@@ -153,6 +153,8 @@ void osaf_encode_uint64(NCS_UBAID *ub, u
 void osaf_decode_uint64(NCS_UBAID *ub, uint64_t *to);
 void osaf_encode_sanamet(NCS_UBAID *ub, const SaNameT *name);
 void osaf_decode_sanamet(NCS_UBAID *ub, SaNameT *name);
+void osaf_encode_sanamet_o2(NCS_UBAID *ub, SaConstStringT name);
+void osaf_encode_saconststring(NCS_UBAID *ub, SaConstStringT str);
 void osaf_encode_satimet(NCS_UBAID *ub, SaTimeT time);
 void osaf_decode_satimet(NCS_UBAID *ub, SaTimeT *time);
 void osaf_encode_bool(NCS_UBAID *ub, bool value);
diff --git a/osaf/libs/core/leap/hj_enc.c b/osaf/libs/core/leap/hj_enc.c
--- a/osaf/libs/core/leap/hj_enc.c
+++ b/osaf/libs/core/leap/hj_enc.c
@@ -42,6 +42,9 @@
 
 ***
 */
+#ifndef SA_EXTENDED_NAME_SOURCE
+#define SA_EXTENDED_NAME_SOURCE
+#endif
 
 #include 
 #include "ncs_osprm.h"
@@ -49,6 +52,7 @@
 #include "ncssysf_def.h"
 #include "ncssysf_mem.h"
 #include "ncs_svd.h"
+#include "osaf_extended_name.h"
 
 /** A NULL os implies "count" number of zeros...
  **/
@@ -374,18 +378,49 @@ void osaf_decode_uint64(NCS_UBAID *ub, u
 
 void osaf_encode_sanamet(NCS_UBAID *ub, const SaNameT *name)
 {
-   int i;
-   osaf_encode_uint16(ub, name->length);
-   for (i = 0; i < SA_MAX_NAME_LENGTH; i++)
-   osaf_encode_uint8(ub, name->value[i]);
+   TRACE_ENTER();
+
+   SaConstStringT str = osaf_extended_name_borrow(name);
+   TRACE("str %s (%zu)", str, osaf_extended_name_length(name));
+   osaf_encode_sanamet_o2(ub, str);
+
+   TRACE_LEAVE();
 }
 
 void osaf_decode_sanamet(NCS_UBAID *ub, SaNameT *name)
 {
-   int i;
-   osaf_decode_uint16(ub, >length);
-   for (i = 0; i < SA_MAX_NAME_LENGTH; i++)
-   osaf_decode_uint8(ub, >value[i]);
+   TRACE_ENTER();
+
+   SaStringT str;
+   uint16_t len;
+
+   // get the length of the SaNameT
+   osaf_decode_uint16(ub, );
+   osafassert(len < 65535);
+   
+   if (len < SA_MAX_UNEXTENDED_NAME_LENGTH) {
+   // string is encoded as a fixed 256 char array
+   str = (SaStringT)malloc(SA_MAX_UNEXTENDED_NAME_LENGTH * 
sizeof(char));
+   osafassert(str != NULL);
+
+   uint8_t *p8 = 

[devel] [PATCH 1 of 1] libs/core: add support for long DN in sanamet encode & decode functions [#1674]

2016-06-23 Thread Gary Lee
 osaf/libs/core/common/saf_edu.c|   34 ++
 osaf/libs/core/include/ncsencdec_pub.h |3 +
 osaf/libs/core/leap/hj_enc.c   |  100 ++--
 3 files changed, 102 insertions(+), 35 deletions(-)


Currently, ncs_edp_sanamet encodes a SaNameT by storing the length in 2 bytes,
followed by a fixed char array of length SA_MAX_NAME_LENGTH.

This patch adds long DN supoprt by:

if length < SA_MAX_NAME_LENGTH, encode as present
if length >= SA_MAX_NAME_LENGTH, encode as a variable string like ncs_edp_string

diff --git a/osaf/libs/core/common/saf_edu.c b/osaf/libs/core/common/saf_edu.c
--- a/osaf/libs/core/common/saf_edu.c
+++ b/osaf/libs/core/common/saf_edu.c
@@ -42,6 +42,7 @@
 #include "saf_mem.h"
 #include "ncs_edu_pub.h"
 #include "ncs_saf_edu.h"
+#include "osaf_extended_name.h"
 
 /*
 
@@ -57,36 +58,15 @@
 uint32_t ncs_edp_sanamet(EDU_HDL *hdl, EDU_TKN *edu_tkn,
  NCSCONTEXT ptr, uint32_t *ptr_data_len, EDU_BUF_ENV 
*buf_env, EDP_OP_TYPE op, EDU_ERR *o_err)
 {
-   uint32_t rc = NCSCC_RC_SUCCESS;
-   SaNameT *struct_ptr = NULL, **d_ptr = NULL;
-
-   EDU_INST_SET saname_rules[] = {
-   {EDU_START, ncs_edp_sanamet, 0, 0, 0, sizeof(SaNameT), 0, NULL},
-   {EDU_EXEC, m_NCS_EDP_SAUINT16T, 0, 0, 0,
-(long)&((SaNameT *)0)->length, 0, NULL},
-   {EDU_EXEC, ncs_edp_uns8, EDQ_ARRAY, 0, 0,
-(long)&((SaNameT *)0)->value, SA_MAX_NAME_LENGTH, NULL},
-   {EDU_END, 0, 0, 0, 0, 0, 0, NULL},
-   };
-
if (op == EDP_OP_TYPE_ENC) {
-   struct_ptr = (SaNameT *)ptr;
+   const SaNameT *name = ptr;
+   osaf_encode_sanamet(buf_env->info.uba, name);
} else if (op == EDP_OP_TYPE_DEC) {
-   d_ptr = (SaNameT **)ptr;
-   if (*d_ptr == NULL) {
-   *d_ptr = m_MMGR_ALLOC_EDP_SANAMET;
-   if (*d_ptr == NULL) {
-   *o_err = EDU_ERR_MEM_FAIL;
-   return NCSCC_RC_FAILURE;
-   }
-   }
-   memset(*d_ptr, '\0', sizeof(SaNameT));
-   struct_ptr = *d_ptr;
-   } else {
-   struct_ptr = ptr;
+   SaNameT *name = *(SaNameT**)ptr;
+   osaf_decode_sanamet(buf_env->info.uba, name);
}
-   rc = m_NCS_EDU_RUN_RULES(hdl, edu_tkn, saname_rules, struct_ptr, 
ptr_data_len, buf_env, op, o_err);
-   return rc;
+   
+   return NCSCC_RC_SUCCESS;
 }
 
 /*
diff --git a/osaf/libs/core/include/ncsencdec_pub.h 
b/osaf/libs/core/include/ncsencdec_pub.h
--- a/osaf/libs/core/include/ncsencdec_pub.h
+++ b/osaf/libs/core/include/ncsencdec_pub.h
@@ -153,6 +153,9 @@ void osaf_encode_uint64(NCS_UBAID *ub, u
 void osaf_decode_uint64(NCS_UBAID *ub, uint64_t *to);
 void osaf_encode_sanamet(NCS_UBAID *ub, const SaNameT *name);
 void osaf_decode_sanamet(NCS_UBAID *ub, SaNameT *name);
+void osaf_encode_sanamet_o2(NCS_UBAID *ub, SaConstStringT name);
+void osaf_encode_saconststring(NCS_UBAID *ub, SaConstStringT str);
+void osaf_decode_sastring(NCS_UBAID *ub, SaStringT* str);
 void osaf_encode_satimet(NCS_UBAID *ub, SaTimeT time);
 void osaf_decode_satimet(NCS_UBAID *ub, SaTimeT *time);
 void osaf_encode_bool(NCS_UBAID *ub, bool value);
diff --git a/osaf/libs/core/leap/hj_enc.c b/osaf/libs/core/leap/hj_enc.c
--- a/osaf/libs/core/leap/hj_enc.c
+++ b/osaf/libs/core/leap/hj_enc.c
@@ -42,6 +42,9 @@
 
 ***
 */
+#ifndef SA_EXTENDED_NAME_SOURCE
+#define SA_EXTENDED_NAME_SOURCE
+#endif
 
 #include 
 #include "ncs_osprm.h"
@@ -49,6 +52,7 @@
 #include "ncssysf_def.h"
 #include "ncssysf_mem.h"
 #include "ncs_svd.h"
+#include "osaf_extended_name.h"
 
 /** A NULL os implies "count" number of zeros...
  **/
@@ -374,18 +378,49 @@ void osaf_decode_uint64(NCS_UBAID *ub, u
 
 void osaf_encode_sanamet(NCS_UBAID *ub, const SaNameT *name)
 {
-   int i;
-   osaf_encode_uint16(ub, name->length);
-   for (i = 0; i < SA_MAX_NAME_LENGTH; i++)
-   osaf_encode_uint8(ub, name->value[i]);
+   TRACE_ENTER();
+
+   SaConstStringT str = osaf_extended_name_borrow(name);
+   TRACE("str %s (%zu)", str, osaf_extended_name_length(name));
+   osaf_encode_sanamet_o2(ub, str);
+
+   TRACE_LEAVE();
 }
 
 void osaf_decode_sanamet(NCS_UBAID *ub, SaNameT *name)
 {
-   int i;
-   osaf_decode_uint16(ub, >length);
-   for (i = 0; i < SA_MAX_NAME_LENGTH; i++)
-   osaf_decode_uint8(ub, >value[i]);
+   TRACE_ENTER();
+
+   SaStringT str;
+   uint16_t len;
+
+   // get the length of the SaNameT
+   osaf_decode_uint16(ub, );
+   osafassert(len < 65535);
+   
+   if (len < 

[devel] [PATCH 0 of 1] Review Request for libs: add support for long DN in sanamet encode & decode functions [#1674]

2016-06-23 Thread Gary Lee
Summary: libs: add support for long DN in sanamet encode & decode functions 
[#1674] 
Review request for Trac Ticket(s): 1674 
Peer Reviewer(s): AMF devs, Ramesh 
Pull request to: <>
Affected branch(es): <>
Development branch: <>


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesn
 OpenSAF servicesn
 Core libraries  y 
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each "y" above):
-
 <>

changeset fc9d1fc9f6a4000ca63fa713d1fdd8f62db54931
Author: Gary Lee 
Date:   Thu, 23 Jun 2016 15:37:32 +1000

libs/core: add support for long DN in sanamet encode & decode functions
[#1674]

Currently, ncs_edp_sanamet encodes a SaNameT by storing the length in 2
bytes, followed by a fixed char array of length SA_MAX_NAME_LENGTH.

This patch adds long DN supoprt by:

if length < SA_MAX_NAME_LENGTH, encode as present if length >=
SA_MAX_NAME_LENGTH, encode as a variable string like ncs_edp_string


Complete diffstat:
--
 osaf/libs/core/common/saf_edu.c|   34 
+++---
 osaf/libs/core/include/ncsencdec_pub.h |3 +++
 osaf/libs/core/leap/hj_enc.c   |  100 

 3 files changed, 102 insertions(+), 35 deletions(-)


Testing Commands:
-
 <>


Testing, Expected Results:
--
 <>


Conditions of Submission:
-
ack from a reviewer, or by 7 Jul

Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y 
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
Attend Shape: An AT Tech Expo July 15-16. Meet us at AT Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net