Summary: amf: support for sc status change callback, non SAF V2 [#2475] Review request for Ticket(s): 2475 Peer Reviewer(s): Amf devs Pull request to: myself Affected branch(es): develop Development branch: ticket-2475 Base revision: 8a15fb881c238d4e3246d97d7e5201e5ae235af5 Personal repository: git://git.code.sf.net/u/praveenmalviya/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 n 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): --------------------------------------------- This is V2. Now API takes amfhandle as argument. Also added one more demo to demonstrate the usage. Also added test cases for the API. revision 65be22297698dd5ac6036449c01bd2157d8a4894 Author: Praveen <praveen.malv...@oracle.com> Date: Mon, 14 Aug 2017 12:38:07 +0530 amf: add api test cases for sc status change callback [#2475] revision 6811988f58a2344b0907cd03158a9e2bde60b993 Author: Praveen <praveen.malv...@oracle.com> Date: Mon, 14 Aug 2017 12:37:01 +0530 amf: add sample apps for SC status change callback [#2475] revision 12e1a52eef47156b9db5ad2cd6ec86fecf104842 Author: Praveen <praveen.malv...@oracle.com> Date: Mon, 14 Aug 2017 11:48:13 +0530 amf: support SC status change callback, non SAF [#2475] * A callback that will be invoked by AMFA whenever a SC joins cluster and both SCs leaves cluster if SC Absence feature is enabled. -Callback and its argument: void (*OsafAmfSCStatusChangeCallbackT)(OsafAmfSCStatusT state) where OsafAmfSCStatusT is defined as: typedef enum { OSAF_AMF_SC_PRESENT = 1, OSAF_AMF_SC_ABSENT = 2, } OsafAmfSCStatusT; This callback can be integrated with standard AMF component(even with legacy one also). -Return codes: SA_AIS_OK - The function returned successfully. SA_AIS_ERR_LIBRARY - An unexpected problem occurred in the library (such as corruption). The library cannot be used anymore. SA_AIS_ERR_BAD_HANDLE - The handle amfHandle is invalid, since it is corrupted, uninitialized, or has already been finalized. SA_AIS_ERR_INVALID_PARAM - A parameter is not set correctly (callback). * An API to register/install above callback function: void osafAmfInstallSCStatusChangeCallback(SaAmfHandleT amfHandle, void (*OsafAmfSCStatusChangeCallbackT)(OsafAmfSCStatusT status)); If 0 is passed as amfHandle, then callback will be invoked in the context of MDS thread. If a valid amfHandle is passed then callback will be invoked in the context of thread which is calling saAmfDispatch() with this handle. Note: OsafAmfSCStatusT and API is declared in saAmf.h revision 473ef442f9a2a595dbd85a0c2cc7e5aeaf985c8b Author: Praveen <praveen.malv...@oracle.com> Date: Mon, 14 Aug 2017 11:48:13 +0530 amf: update readme for SC status change callback [#2475] Added Files: ------------ samples/amf/api_demo/amf_sc_status_demo.c samples/amf/api_demo/amf_sc_status_dispatch_demo.c samples/amf/api_demo/Makefile.am samples/amf/api_demo/README src/amf/apitest/amftest.c src/amf/apitest/amftest.h src/amf/apitest/Makefile src/amf/apitest/test_osafAmfInstallSCStatusChangeCallback.c Complete diffstat: ------------------ samples/amf/Makefile.am | 3 +- samples/amf/api_demo/Makefile.am | 51 ++++++++ samples/amf/api_demo/README | 38 ++++++ samples/amf/api_demo/amf_sc_status_demo.c | 128 +++++++++++++++++++++ samples/amf/api_demo/amf_sc_status_dispatch_demo.c | 98 ++++++++++++++++ samples/configure.ac | 2 + src/ais/include/saAmf_B_04_02.h | 10 ++ src/ais/lib/libSaAmf.map | 1 + src/amf/Makefile.am | 20 ++++ src/amf/README_SC_ABSENCE | 42 +++++++ src/amf/agent/amf_agent.cc | 9 ++ src/amf/agent/ava_cb.h | 3 + src/amf/agent/ava_hdl.cc | 31 +++-- src/amf/agent/ava_init.cc | 2 + src/amf/agent/ava_mds.cc | 84 +++++++++++++- src/amf/agent/ava_mds.h | 9 +- src/amf/agent/ava_op.cc | 17 +++ src/amf/amfnd/avnd_mds.h | 3 +- src/amf/amfnd/di.cc | 39 ++++++- src/amf/amfnd/mds.cc | 5 +- src/amf/apitest/Makefile | 19 +++ src/amf/apitest/amftest.c | 39 +++++++ src/amf/apitest/amftest.h | 37 ++++++ .../test_osafAmfInstallSCStatusChangeCallback.c | 76 ++++++++++++ src/amf/common/amf_amfparam.h | 8 ++ src/amf/common/amf_n2avamsg.h | 2 + 26 files changed, 760 insertions(+), 16 deletions(-) Testing Commands: ----------------- run the demos and tests Testing, Expected Results: -------------------------- pass Conditions of Submission: ------------------------- ack from any reviewer. Arch Built Started Linux distro ------------------------------------------- mips n 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 ~/.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