Re: [devel] [PATCH 0/3] Review Request for ntf: Checkpoint and cold sync reader information [#2757]

2018-01-29 Thread Minh Hon Chau

Hi Srinivas,

Those symbols should be defined in libntf_common.so, which the 
libSaNtf.so depends on


One possible case I try to see your error, is that I remove the 
implementation of ntfsv_enc_read_finalize_msg in ntfsv_enc_dec.c, so I 
got your error:


make -C ../../.. bin/ntfread bin/ntfsend bin/ntfsubscribe
make[1]: Entering directory '/home/minhchau/osaftest/opensaf-code'
  CCLD bin/ntfread
lib/.libs/libSaNtf.so: undefined reference to `ntfsv_enc_read_finalize_msg'
collect2: error: ld returned 1 exit status
Makefile:8740: recipe for target 'bin/ntfread' failed
make[1]: *** [bin/ntfread] Error 1

But I suppose those functions should have been in ntfsv_enc_dec.c. Can 
you please try to build again with branch ticket-2757 in my review repo?


Thanks,

Minh


On 30/01/18 00:17, Srinivas Mangipudy wrote:
RE: [PATCH 0/3] Review Request for ntf: Checkpoint and cold sync 
reader information [#2757]


Hi Minh,

I got a build error. Below is the error;

*CCLD bin/ntfread*

*lib/.libs/libSaNtf.so: undefined reference to 
`ntfsv_enc_reader_initialize_2_msg'*


*lib/.libs/libSaNtf.so: undefined reference to `ntfsv_enc_read_next_msg'*

*lib/.libs/libSaNtf.so: undefined reference to 
`ntfsv_enc_read_finalize_msg'*


*collect2: error: ld returned 1 exit status*

*Makefile:8740: recipe for target 'bin/ntfread' failed*

All theabove symbols are undefined in thelibSaNtf.so.0.1.2shared library

*/opensaf-code124/lib/.libs# nm libSaNtf.so.0.1.2 | grep 
ntfsv_enc_reader_initialize_2_msg*


* U ntfsv_enc_reader_initialize_2_msg*

*opensaf-code124/lib/.libs# nm libSaNtf.so.0.1.2 | grep 
ntfsv_enc_read_next_msg*


* U ntfsv_enc_read_next_msg*

*/**opensaf-code124/lib/.libs# nm libSaNtf.so.0.1.2 | grep 
ntfsv_enc_read_finalize_msg*


* U ntfsv_enc_read_finalize_msg*

Thank you

Srinivas

-Original Message-
From: Minh Hon Chau [mailto:minh.c...@dektech.com.au]
Sent: Monday, January 29, 2018 9:31 AM
To: Lennart Lund ; Srinivas Mangipudy 
; Canh Van Truong 


Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [PATCH 0/3] Review Request for ntf: Checkpoint and cold 
sync reader information [#2757]


Hi all,

If the patch look ok to you, I would like to push it tomorrow.

I have updated the README and PR doc at the below links, if you have 
time please have a look.


https://urldefense.proofpoint.com/v2/url?u=https-3A__sourceforge.net_p_opensaf_tickets_-5Fdiscuss_thread_77619155_0a9b_attachment_2757-5FREADME.diff&d=DwICaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=rU6x356sikQZSi7Ttc2DuiqAgbc0QIeANg72N5AllVc&m=Il9ed4kUdHBl1sTtKy3I0G6rJMuUcnoSKhdIxIWTFfc&s=osczasl2Lxg-StyK-9Qs8XrvtTj1nnJlBEL2dDIxGEA&e=

https://urldefense.proofpoint.com/v2/url?u=https-3A__sourceforge.net_p_opensaf_tickets_-5Fdiscuss_thread_5671255e_16a4_attachment_OpenSAF-5FNTFSv-5FPR-5F2735.odt&d=DwICaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=rU6x356sikQZSi7Ttc2DuiqAgbc0QIeANg72N5AllVc&m=Il9ed4kUdHBl1sTtKy3I0G6rJMuUcnoSKhdIxIWTFfc&s=riEHgZ3x2z9W8UtUxMo2tiD03svlKxireGpdVHRegvw&e=

Thanks,

Minh


On 24/01/18 
12:49,minh.c...@dektech.com.auwrote:


> Hi Lennart,

>

> I tested the APIs between versions with/without the changes. I will

> send out for review the README and PR change after the code review is

> done. One limitation is that both active and standby require the patches to 
work.


>

> Thanks,

> Minh

>

>> Hi Minh

>>

>> Ack. I have not tested much

>>

>> Have you tested using the reader API while running old version on

>> standby and new version on active and vice versa (upgrade case)? 
Limitations?


>> PR documentation update?

>>

>> Thanks

>> Lennart

>>

>>> -Original Message-

>>> From: Minh Hon Chau

>>> Sent: den 22 januari 2018 05:19

>>> To: Lennart Lund 
mailto:lennart.l...@ericsson.com>>;


>>>srinivas.mangip...@oracle.com; 
Canh Van Truong


>>> mailto:canh.v.tru...@dektech.com.au>>

>>> 
Cc:opensaf-devel@lists.sourceforge.net; Minh 
Hon Chau

>>> mailto:minh.c...@dektech.com.au>>

>>> Subject: [PATCH 0/3] Review Request for ntf: Checkpoint and cold

>>> sync reader information [#2757]

>>>

>>> Summary: ntfd: Checkpoint reader to the standby when processes

>>> reader API requests [#2757] Review request for Ticket(s): 2757 Peer

>>> Reviewer(s): Lennart, Srinivas, Canh Pull request to: *** LIST THE

>>> PERSON WITH PUSH ACCESS HERE *** Affected branch(es): develop

>>> Development branch: ticket-2757 Base revision:

>>> ee105cb3bf44eee4e8785e3de7d24f907641e2ab

>>> Personal repository: git://git.code.sf.net/u/minh-chau/review

>>>

>>> 

>>> Impacted area   Impact y/n

>>> 

>>>  Docs    n

>>>  Build system    n

>>>  RPM/packaging   n

>>>  Configuration files n

>>>  Startup scripts n

>>>  SAF services    y

>>>  OpenSAF services  

[devel] [PATCH 1/1] fmd: indent to Google style guide [#2763]

2018-01-29 Thread Gary Lee
ran 'clang-format -style=Google' on fmd files
no other changes made
---
 src/fm/fmd/fm.h   |   50 +-
 src/fm/fmd/fm_amf.cc  |  457 
 src/fm/fmd/fm_amf.h   |2 +-
 src/fm/fmd/fm_cb.h|8 +-
 src/fm/fmd/fm_main.cc | 1388 +++
 src/fm/fmd/fm_mds.cc  | 1436 -
 src/fm/fmd/fm_rda.cc  |  115 ++--
 7 files changed, 1667 insertions(+), 1789 deletions(-)

diff --git a/src/fm/fmd/fm.h b/src/fm/fmd/fm.h
index ce71c4105..c69c96eb2 100644
--- a/src/fm/fmd/fm.h
+++ b/src/fm/fmd/fm.h
@@ -18,46 +18,46 @@
 #ifndef FM_FMD_FM_H_
 #define FM_FMD_FM_H_
 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
+#include 
 #include 
-#include 
+#include 
+#include 
 #include 
-#include 
-#include 
+#include 
+#include 
+#include 
+#include 
 #include 
-#include 
+#include 
 #include 
-#include 
+#include 
+#include 
+#include 
+#include 
 
 #include "base/ncs_main_papi.h"
-#include "base/ncsgl_defs.h"
 #include "base/ncs_osprm.h"
+#include "base/ncsgl_defs.h"
 
-#include "base/ncs_svd.h"
 #include "base/ncs_hdl_pub.h"
-#include "base/ncssysf_lck.h"
-#include "base/ncsusrbuf.h"
+#include "base/ncs_svd.h"
+#include "base/ncspatricia.h"
 #include "base/ncssysf_def.h"
-#include "base/ncssysfpool.h"
-#include "base/ncssysf_tmr.h"
-#include "base/ncssysf_mem.h"
 #include "base/ncssysf_ipc.h"
+#include "base/ncssysf_lck.h"
+#include "base/ncssysf_mem.h"
+#include "base/ncssysf_tmr.h"
 #include "base/ncssysf_tsk.h"
-#include "base/ncspatricia.h"
+#include "base/ncssysfpool.h"
+#include "base/ncsusrbuf.h"
 
 #include "base/ncs_queue.h"
 
-#include "base/ncs_lib.h"
+#include "base/logtrace.h"
 #include "base/ncs_edu_pub.h"
-#include "nid/agent/nid_api.h"
+#include "base/ncs_lib.h"
 #include "mds/mds_papi.h"
-#include "base/logtrace.h"
+#include "nid/agent/nid_api.h"
 #include "nid/agent/nid_start_util.h"
 /* SAF Include file. */
 #include 
@@ -68,9 +68,9 @@
 /* The below files are very specific to fm. */
 #include "fm_amf.h"
 #include "fm_cb.h"
-#include "fm_mem.h"
-#include "fm_mds.h"
 #include "fm_evt.h"
+#include "fm_mds.h"
+#include "fm_mem.h"
 
 extern void amfnd_down_callback(void);
 extern "C" void ava_install_amf_down_cb(void (*cb)(void));
diff --git a/src/fm/fmd/fm_amf.cc b/src/fm/fmd/fm_amf.cc
index 5be2bf201..e99f3ba7e 100644
--- a/src/fm/fmd/fm_amf.cc
+++ b/src/fm/fmd/fm_amf.cc
@@ -41,26 +41,27 @@ static uint32_t fm_amf_register(FM_AMF_CB *fm_amf_cb);
 static uint32_t fm_amf_healthcheck_start(FM_AMF_CB *fm_amf_cb);
 static FM_AMF_CB *fm_amf_take_hdl(void);
 static void fm_amf_give_hdl(void);
-static const char *ha_role_string[] = {"ACTIVE", "STANDBY", "QUIESCED", 
"QUIESCING"};
-
-void amfnd_down_callback(void)
-{
-   if (!fm_cb->control_tipc) {
-   /* OpenSAF is not controlling TIPC, Wait till OS terminates the
-* process Peer(STANDBY) FM will trigger failover only after it
-* receives FM down on this node.
-*/
-   LOG_AL(
-   "AMF Node Director is down, waiting for the OS to terminate 
this process");
-   while (1) {
-   m_NCS_TASK_SLEEP(0xfff0);
-   }
-   } else {
-   /* OpenSAF is controlling TIPC, peer(STANDBY) FM will
-* receive/act on NODE_DOWN */
-   LOG_AL("AMF Node Director is down, terminate this process");
-   raise(SIGTERM);
-   }
+static const char *ha_role_string[] = {"ACTIVE", "STANDBY", "QUIESCED",
+   "QUIESCING"};
+
+void amfnd_down_callback(void) {
+  if (!fm_cb->control_tipc) {
+/* OpenSAF is not controlling TIPC, Wait till OS terminates the
+ * process Peer(STANDBY) FM will trigger failover only after it
+ * receives FM down on this node.
+ */
+LOG_AL(
+"AMF Node Director is down, waiting for the OS to terminate this "
+"process");
+while (1) {
+  m_NCS_TASK_SLEEP(0xfff0);
+}
+  } else {
+/* OpenSAF is controlling TIPC, peer(STANDBY) FM will
+ * receive/act on NODE_DOWN */
+LOG_AL("AMF Node Director is down, terminate this process");
+raise(SIGTERM);
+  }
 }
 
 /
@@ -74,14 +75,13 @@ void amfnd_down_callback(void)
  *
  * Notes : None.
  */
-FM_AMF_CB *fm_amf_take_hdl(void)
-{
-   FM_CB *fm_cb = NULL;
+FM_AMF_CB *fm_amf_take_hdl(void) {
+  FM_CB *fm_cb = NULL;
 
-   /* Take handle */
-   fm_cb = static_cast(ncshm_take_hdl(NCS_SERVICE_ID_GFM, 
gl_fm_hdl));
+  /* Take handle */
+  fm_cb = static_cast(ncshm_take_hdl(NCS_SERVICE_ID_GFM, gl_fm_hdl));
 
-   return &fm_cb->fm_amf_cb;
+  return &fm_cb->fm_amf_cb;
 }
 
 /
@@ -95,12 

[devel] [PATCH 0/1] Review Request for fmd: indent to Google style guide [#2763]

2018-01-29 Thread Gary Lee
Summary: fmd: indent to Google style guide [#2763]
Review request for Ticket(s): 2763
Peer Reviewer(s): Anders, Ravi 
Pull request to:
Affected branch(es): develop
Development branch: ticket-2763
Base revision: 81ef74a531f84720fd905d25e3d06b1ff799f83d
Personal repository: git://git.code.sf.net/u/userid-2226215/review


Impacted area   Impact y/n

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


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

revision a00236279afaa39d041ad8c67ece0abaec2f4005
Author: Gary Lee 
Date:   Tue, 30 Jan 2018 09:30:51 +1100

fmd: indent to Google style guide [#2763]

ran 'clang-format -style=Google' on fmd files
no other changes made



Complete diffstat:
--
 src/fm/fmd/fm.h   |   50 +-
 src/fm/fmd/fm_amf.cc  |  457 
 src/fm/fmd/fm_amf.h   |2 +-
 src/fm/fmd/fm_cb.h|8 +-
 src/fm/fmd/fm_main.cc | 1388 +++
 src/fm/fmd/fm_mds.cc  | 1436 -
 src/fm/fmd/fm_rda.cc  |  115 ++--
 7 files changed, 1667 insertions(+), 1789 deletions(-)


Testing Commands:
-
*** LIST THE COMMAND LINE TOOLS/STEPS TO TEST YOUR CHANGES ***


Testing, Expected Results:
--
*** PASTE COMMAND OUTPUTS / TEST RESULTS ***


Conditions of Submission:
-
in 2 weeks, or ack from any review

Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  n
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 ~/.gitconfig file (i.e. user.name, user.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.


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 0/3] Review Request for ntf: Checkpoint and cold sync reader information [#2757]

2018-01-29 Thread Srinivas Mangipudy
Hi Minh,

I got a build error. Below is the error;

CCLD bin/ntfread
lib/.libs/libSaNtf.so: undefined reference to 
`ntfsv_enc_reader_initialize_2_msg'
lib/.libs/libSaNtf.so: undefined reference to `ntfsv_enc_read_next_msg'
lib/.libs/libSaNtf.so: undefined reference to `ntfsv_enc_read_finalize_msg'
collect2: error: ld returned 1 exit status
Makefile:8740: recipe for target 'bin/ntfread' failed

All the above symbols are undefined in the libSaNtf.so.0.1.2 shared library  

/opensaf-code124/lib/.libs# nm libSaNtf.so.0.1.2 | grep 
ntfsv_enc_reader_initialize_2_msg
 U ntfsv_enc_reader_initialize_2_msg
opensaf-code124/lib/.libs# nm libSaNtf.so.0.1.2 | grep ntfsv_enc_read_next_msg
 U ntfsv_enc_read_next_msg
/opensaf-code124/lib/.libs# nm libSaNtf.so.0.1.2 | grep 
ntfsv_enc_read_finalize_msg
 U ntfsv_enc_read_finalize_msg


Thank you
Srinivas


-Original Message-
From: Minh Hon Chau [mailto:minh.c...@dektech.com.au] 
Sent: Monday, January 29, 2018 9:31 AM
To: Lennart Lund ; Srinivas Mangipudy 
; Canh Van Truong 
Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [PATCH 0/3] Review Request for ntf: Checkpoint and cold sync 
reader information [#2757]

Hi all,

If the patch look ok to you, I would like to push it tomorrow.

I have updated the README and PR doc at the below links, if you have time 
please have a look.

https://urldefense.proofpoint.com/v2/url?u=https-3A__sourceforge.net_p_opensaf_tickets_-5Fdiscuss_thread_77619155_0a9b_attachment_2757-5FREADME.diff&d=DwICaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=rU6x356sikQZSi7Ttc2DuiqAgbc0QIeANg72N5AllVc&m=Il9ed4kUdHBl1sTtKy3I0G6rJMuUcnoSKhdIxIWTFfc&s=osczasl2Lxg-StyK-9Qs8XrvtTj1nnJlBEL2dDIxGEA&e=

https://urldefense.proofpoint.com/v2/url?u=https-3A__sourceforge.net_p_opensaf_tickets_-5Fdiscuss_thread_5671255e_16a4_attachment_OpenSAF-5FNTFSv-5FPR-5F2735.odt&d=DwICaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=rU6x356sikQZSi7Ttc2DuiqAgbc0QIeANg72N5AllVc&m=Il9ed4kUdHBl1sTtKy3I0G6rJMuUcnoSKhdIxIWTFfc&s=riEHgZ3x2z9W8UtUxMo2tiD03svlKxireGpdVHRegvw&e=

Thanks,

Minh


On 24/01/18 12:49,  HYPERLINK "mailto:minh.c...@dektech.com.au"; 
minh.c...@dektech.com.au wrote:
> Hi Lennart,
>
> I tested the APIs between versions with/without the changes. I will 
> send out for review the README and PR change after the code review is 
> done. One limitation is that both active and standby require the patches to 
> work.
>
> Thanks,
> Minh
>
>> Hi Minh
>>
>> Ack. I have not tested much
>>
>> Have you tested using the reader API while running old version on 
>> standby and new version on active and vice versa (upgrade case)? Limitations?
>> PR documentation update?
>>
>> Thanks
>> Lennart
>>
>>> -Original Message-
>>> From: Minh Hon Chau
>>> Sent: den 22 januari 2018 05:19
>>> To: Lennart Lund < HYPERLINK "mailto:lennart.l...@ericsson.com"; 
>>> lennart.l...@ericsson.com>; 
>>>  HYPERLINK "mailto:srinivas.mangip...@oracle.com"; 
>>> srinivas.mangip...@oracle.com; Canh Van Truong 
>>> < HYPERLINK "mailto:canh.v.tru...@dektech.com.au"; 
>>> canh.v.tru...@dektech.com.au>
>>> Cc:  HYPERLINK "mailto:opensaf-devel@lists.sourceforge.net"; 
>>> opensaf-devel@lists.sourceforge.net; Minh Hon Chau 
>>> < HYPERLINK "mailto:minh.c...@dektech.com.au"; minh.c...@dektech.com.au>
>>> Subject: [PATCH 0/3] Review Request for ntf: Checkpoint and cold 
>>> sync reader information [#2757]
>>>
>>> Summary: ntfd: Checkpoint reader to the standby when processes 
>>> reader API requests [#2757] Review request for Ticket(s): 2757 Peer 
>>> Reviewer(s): Lennart, Srinivas, Canh Pull request to: *** LIST THE 
>>> PERSON WITH PUSH ACCESS HERE *** Affected branch(es): develop 
>>> Development branch: ticket-2757 Base revision: 
>>> ee105cb3bf44eee4e8785e3de7d24f907641e2ab
>>> Personal repository: git://git.code.sf.net/u/minh-chau/review
>>>
>>> 
>>> 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
>>>
>>> NOTE: Patch(es) contain lines longer than 80 characers
>>>
>>> Comments (indicate scope for each "y" above):
>>> -
>>> *** EXPLAIN/COMMENT THE PATCH SERIES HERE ***
>>>
>>> revision 74da3370accfa44a34a7abf9830ceaeae3ab5d4f
>>> Author:Minh Chau < HYPERLINK "mailto:minh.c...@dektech.com.au"; 
>>> minh.c...@dektech.com.au> Date:Mon, 22 Jan 2018 
>>> 15:08:59 +1100
>>>
>>> ntftest: Add new test cases of suite 41 for cold sync and checkpoint 
>>> of reader APIs [#2757]
>>>
>>>
>>>
>>> revision ad38745b1c411bc52905725281c84c69e4147fef
>>> Author:Minh Chau < HYPERLINK "mailto:minh.c...@dektech.com.au"; 
>>> minh.c...@dektech.co

[devel] [PATCH 2/2] smf: Add capability to redo CCBs that fail [#1398]

2018-01-29 Thread Lennart Lund
Second increment:
Class SmfAdminOperation is refactored to use the
CCB handler instead of handling IMM inline
The class is also moved from SmfUpgradeStep.* to
new files SmfAdminState.*
---
 src/smf/Makefile.am|2 +
 src/smf/smfd/SmfAdminState.cc  | 1298 
 src/smf/smfd/SmfAdminState.h   |  141 +
 src/smf/smfd/SmfUpgradeStep.cc | 1162 +--
 src/smf/smfd/SmfUpgradeStep.h  |   94 ---
 5 files changed, 1471 insertions(+), 1226 deletions(-)
 create mode 100644 src/smf/smfd/SmfAdminState.cc
 create mode 100644 src/smf/smfd/SmfAdminState.h

diff --git a/src/smf/Makefile.am b/src/smf/Makefile.am
index 4c86094e8..3502f1546 100644
--- a/src/smf/Makefile.am
+++ b/src/smf/Makefile.am
@@ -80,6 +80,7 @@ noinst_HEADERS += \
src/smf/agent/smfa.h \
src/smf/common/smfsv_defs.h \
src/smf/common/smfsv_evt.h \
+   src/smf/smfd/SmfAdminState.h \
src/smf/smfd/SmfCallback.h \
src/smf/smfd/SmfCampState.h \
src/smf/smfd/SmfCampaign.h \
@@ -171,6 +172,7 @@ bin_osafsmfd_CPPFLAGS = \
$(AM_CPPFLAGS)
 
 bin_osafsmfd_SOURCES = \
+   src/smf/smfd/SmfAdminState.cc \
src/smf/smfd/SmfCallback.cc \
src/smf/smfd/SmfCampState.cc \
src/smf/smfd/SmfCampaign.cc \
diff --git a/src/smf/smfd/SmfAdminState.cc b/src/smf/smfd/SmfAdminState.cc
new file mode 100644
index 0..5ee1c748a
--- /dev/null
+++ b/src/smf/smfd/SmfAdminState.cc
@@ -0,0 +1,1298 @@
+/*  -*- OpenSAF  -*-
+ *
+ * (C) Copyright 2008 The OpenSAF Foundation
+ * Copyright Ericsson AB 2017 - All Rights Reserved.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. This file and program are licensed
+ * under the GNU Lesser General Public License Version 2.1, February 1999.
+ * The complete license can be accessed from the following location:
+ * http://opensource.org/licenses/lgpl-license.php
+ * See the Copying file included with the OpenSAF distribution for full
+ * licensing terms.
+ *
+ * Author(s): Ericsson AB
+ *
+ */
+
+#include 
+#include 
+
+#include 
+#include 
+
+#include "base/saf_error.h"
+#include "base/osaf_extended_name.h"
+#include "base/saf_error.h"
+#include "base/time.h"
+
+// TODO(Lennart) Needed to solve some dependencies.
+//   Should be refactored.
+#include "osaf/immutil/immutil.h"
+#include "smf/smfd/smfd.h"
+#include "smf/smfd/SmfUtils.h"
+// END TODO
+
+#include "smf/smfd/SmfAdminState.h"
+#include "smf/smfd/SmfUpgradeStep.h"
+
+#include "smf/smfd/imm_modify_config/immccb.h"
+
+//==
+// Class SmfAdminOperation methods
+//==
+
+#if 1
+// Make m_next_instance_number thread safe
+std::atomic SmfAdminStateHandler::next_instance_number_{1};
+
+SmfAdminStateHandler::SmfAdminStateHandler(std::list*
+   i_allUnits,
+   SaUint32T smfKeepDuState,
+   SaTimeT adminOpTimeout)
+: allUnits_(i_allUnits),
+  omHandle_(0),
+  ownerHandle_(0),
+  ccbHandle_(0),
+  accessorHandle_(0),
+  creation_fail_(false),
+  errno_(SA_AIS_OK),
+  smfKeepDuState_(0),
+  adminOpTimeout_(adminOpTimeout),
+  instance_number_(1)
+{
+  if (smfKeepDuState == 0) {
+smfKeepDuState_ = false;
+  } else {
+smfKeepDuState_ = true;
+  }
+
+  // Create an instance unique name for a node group IMM object
+  // using an instance number.
+  instance_number_ = next_instance_number_++;
+  instanceNodeGroupName_ =
+  "safAmfNodeGroup=smfLockAdmNg" + std::to_string(instance_number_);
+  admin_owner_name_ = "smfNgAdmOwnerName";
+  TRACE("%s m_instanceNodeGroupName '%s'", __FUNCTION__,
+instanceNodeGroupName_.c_str());
+  TRACE("%s m_NodeGroupAdminOwnerName '%s'", __FUNCTION__,
+admin_owner_name_.c_str());
+
+  // Become admin owner using above created name
+  bool rc = initImmOmAndSetAdminOwnerName();
+  if (rc == false ) {
+LOG_NO("%s: initAdminOwner() Fail", __FUNCTION__);
+creation_fail_ = true;
+  }
+}
+
+SmfAdminStateHandler::~SmfAdminStateHandler() { finalizeNodeGroupOm(); }
+
+///
+/// Operates on the i_allUnits list
+/// Using m_nodeList and m_suList
+/// - Save all units state before locking
+/// - Lock all units with admin state unlocked
+/// Return false if Fail
+///
+bool SmfAdminStateHandler::lock() {
+  TRACE_ENTER();
+  bool rc = false;
+
+  if (creation_fail_) {
+goto done;
+  }
+
+  rc = saveInitAndCurrentStateForAllUnits();
+
+  if (rc == false) {
+LOG_NO("%s: saveInitAndCurrentStateForAllUnits() Fail %s", __FUNCTION__,
+   saf_error(errno_));
+goto done;
+  }
+
+  createNodeAndSULockLists(SA_AMF_ADMIN

[devel] [PATCH 0/2] Review Request for smf: Add capability to redo CCBs that fail [#1398]

2018-01-29 Thread Lennart Lund
Summary: smf: Add capability to redo CCBs that fail [#1398]
Review request for Ticket(s): 1398
Peer Reviewer(s): Vijay Roy 
Pull request to: *** LIST THE PERSON WITH PUSH ACCESS HERE ***
Affected branch(es): develop
Development branch: ticket-1398
Base revision: 81ef74a531f84720fd905d25e3d06b1ff799f83d
Personal repository: git://git.code.sf.net/u/elunlen/review


Impacted area   Impact y/n

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

NOTE: Patch(es) contain lines longer than 80 characers

Comments (indicate scope for each "y" above):
-
*** EXPLAIN/COMMENT THE PATCH SERIES HERE ***

revision 2c77f3c292bf9f1d2b91114c1eccd58676efc58b
Author: Lennart Lund 
Date:   Mon, 29 Jan 2018 13:24:48 +0100

smf: Add capability to redo CCBs that fail [#1398]

Second increment:
Class SmfAdminOperation is refactored to use the
CCB handler instead of handling IMM inline
The class is also moved from SmfUpgradeStep.* to
new files SmfAdminState.*



revision f5c32522323c37ae04eb325379bf86860c750fea
Author: Lennart Lund 
Date:   Mon, 29 Jan 2018 13:20:33 +0100

smf: Add capability to redo CCBs that fail [#1398]

First increment:
A handler for modifying the IMM information model.
Implements the IMM Configuration Change part of the
IMM Object Manager. Handles all C API sequences
included in creating and applying a CCB including
possible recovery on temporary IMM failures.



Added Files:

 src/smf/config/democlass.xml
 src/smf/smfd/imm_modify_config/add_operation_to_ccb.cc
 src/smf/smfd/imm_modify_config/add_operation_to_ccb.h
 src/smf/smfd/imm_modify_config/attribute.cc
 src/smf/smfd/imm_modify_config/attribute.h
 src/smf/smfd/imm_modify_config/immccb.cc
 src/smf/smfd/imm_modify_config/immccb.h
 src/smf/smfd/imm_modify_config/README
 src/smf/smfd/imm_modify_demo/ccbdemo_create.cc
 src/smf/smfd/imm_modify_demo/ccbdemo_delete.cc
 src/smf/smfd/imm_modify_demo/ccbdemo_modify.cc
 src/smf/smfd/imm_modify_demo/ccbhdl_test.cc
 src/smf/smfd/imm_modify_demo/common.cc
 src/smf/smfd/imm_modify_demo/common.h
 src/smf/smfd/imm_modify_demo/democlass.xml
 src/smf/smfd/imm_modify_demo/Makefile
 src/smf/smfd/imm_modify_demo/README
 src/smf/smfd/imm_om_ccapi/common/common.cc
 src/smf/smfd/imm_om_ccapi/common/common.h
 src/smf/smfd/imm_om_ccapi/common/imm_attribute.cc
 src/smf/smfd/imm_om_ccapi/common/imm_attribute.h
 src/smf/smfd/imm_om_ccapi/om_admin_owner_clear.cc
 src/smf/smfd/imm_om_ccapi/om_admin_owner_clear.h
 src/smf/smfd/imm_om_ccapi/om_admin_owner_handle.cc
 src/smf/smfd/imm_om_ccapi/om_admin_owner_handle.h
 src/smf/smfd/imm_om_ccapi/om_admin_owner_set.cc
 src/smf/smfd/imm_om_ccapi/om_admin_owner_set.h
 src/smf/smfd/imm_om_ccapi/om_ccb_handle.cc
 src/smf/smfd/imm_om_ccapi/om_ccb_handle.h
 src/smf/smfd/imm_om_ccapi/om_ccb_object_create.cc
 src/smf/smfd/imm_om_ccapi/om_ccb_object_create.h
 src/smf/smfd/imm_om_ccapi/om_ccb_object_delete.cc
 src/smf/smfd/imm_om_ccapi/om_ccb_object_delete.h
 src/smf/smfd/imm_om_ccapi/om_ccb_object_modify.cc
 src/smf/smfd/imm_om_ccapi/om_ccb_object_modify.h
 src/smf/smfd/imm_om_ccapi/om_handle.cc
 src/smf/smfd/imm_om_ccapi/om_handle.h
 src/smf/smfd/SmfAdminState.cc
 src/smf/smfd/SmfAdminState.h


Complete diffstat:
--
 opensaf.spec.in|   10 +
 src/smf/Makefile.am|  201 ++-
 src/smf/config/democlass.xml   |   76 ++
 src/smf/smfd/SmfAdminState.cc  | 1298 
 src/smf/smfd/SmfAdminState.h   |  141 +++
 src/smf/smfd/SmfImmOperation.cc|2 +-
 src/smf/smfd/SmfUpgradeStep.cc | 1162 +-
 src/smf/smfd/SmfUpgradeStep.h  |   94 --
 src/smf/smfd/imm_modify_config/README  |  129 ++
 .../smfd/imm_modify_config/add_operation_to_ccb.cc |  258 
 .../smfd/imm_modify_config/add_operation_to_ccb.h  |   73 ++
 src/smf/smfd/imm_modify_config/attribute.cc|  630 ++
 src/smf/smfd/imm_modify_config/attribute.h |  275 +
 src/smf/smfd/imm_modify_config/immccb.cc   |  657 ++
 src/smf/smfd/imm_modify_config/immccb.h|  415 +++
 src/smf/smfd/imm_modify_demo/Makefile  |   19 +
 src/smf/smfd/imm_modify_demo/README|   68 +
 src/smf/smfd/imm_modify_demo/ccbdemo_create.cc |  445 +++
 src/smf/smfd/imm_modify_demo/ccbdemo_delete.cc |  179 +++
 src/smf/smfd/imm_modify_demo/ccbdemo_modify.cc |  281 +
 src/smf/smfd/imm_modify_demo/ccbhdl_test.cc|  386 ++
 src/smf/smfd/imm_modify_demo/common.cc |   66 +