You can subscribe to this list here.
2013 |
Jan
|
Feb
|
Mar
(2) |
Apr
(442) |
May
(1532) |
Jun
(148) |
Jul
(178) |
Aug
(165) |
Sep
(196) |
Oct
(265) |
Nov
(230) |
Dec
(312) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2014 |
Jan
(328) |
Feb
(254) |
Mar
(141) |
Apr
(378) |
May
(441) |
Jun
(374) |
Jul
(235) |
Aug
(349) |
Sep
(396) |
Oct
(238) |
Nov
(138) |
Dec
(109) |
2015 |
Jan
(86) |
Feb
(81) |
Mar
(250) |
Apr
(180) |
May
(159) |
Jun
(106) |
Jul
(211) |
Aug
(248) |
Sep
(516) |
Oct
(297) |
Nov
(194) |
Dec
(196) |
2016 |
Jan
(232) |
Feb
(328) |
Mar
(422) |
Apr
(244) |
May
(281) |
Jun
(210) |
Jul
(211) |
Aug
(563) |
Sep
(440) |
Oct
(317) |
Nov
(405) |
Dec
(224) |
2017 |
Jan
(207) |
Feb
(399) |
Mar
(373) |
Apr
(206) |
May
(213) |
Jun
(215) |
Jul
(81) |
Aug
(151) |
Sep
(126) |
Oct
(336) |
Nov
(179) |
Dec
(149) |
2018 |
Jan
(194) |
Feb
(118) |
Mar
(234) |
Apr
(190) |
May
(103) |
Jun
(100) |
Jul
(162) |
Aug
(139) |
Sep
(140) |
Oct
(140) |
Nov
(181) |
Dec
(54) |
2019 |
Jan
(94) |
Feb
(76) |
Mar
(49) |
Apr
(46) |
May
(52) |
Jun
(79) |
Jul
(43) |
Aug
(97) |
Sep
(88) |
Oct
(138) |
Nov
(104) |
Dec
(66) |
2020 |
Jan
(85) |
Feb
(107) |
Mar
(68) |
Apr
(61) |
May
(52) |
Jun
(23) |
Jul
(118) |
Aug
(67) |
Sep
(27) |
Oct
(33) |
Nov
(41) |
Dec
(24) |
2021 |
Jan
(19) |
Feb
(11) |
Mar
(47) |
Apr
(39) |
May
(51) |
Jun
(18) |
Jul
(19) |
Aug
(16) |
Sep
(35) |
Oct
(15) |
Nov
(10) |
Dec
(21) |
2022 |
Jan
(12) |
Feb
(11) |
Mar
(30) |
Apr
(6) |
May
(10) |
Jun
(12) |
Jul
(13) |
Aug
(10) |
Sep
(3) |
Oct
(4) |
Nov
(24) |
Dec
(25) |
2023 |
Jan
(3) |
Feb
(3) |
Mar
(11) |
Apr
(8) |
May
(2) |
Jun
|
Jul
(4) |
Aug
(5) |
Sep
(2) |
Oct
|
Nov
|
Dec
(2) |
2024 |
Jan
(9) |
Feb
(1) |
Mar
(2) |
Apr
(8) |
May
(8) |
Jun
(5) |
Jul
(6) |
Aug
(3) |
Sep
(3) |
Oct
(3) |
Nov
|
Dec
|
From: Carl J. <car...@er...> - 2013-04-02 13:52:30
|
Summary: Test: Extend saflogtest test command (#3102) Review request for Trac Ticket(s): <<IF ANY LIST THE #>> Peer Reviewer(s): Lennart L, Mathi Pull request to: <<LIST THE PERSON WITH PUSH ACCESS HERE>> Affected branch(es): 4.3 Development branch: <<IF ANY GIVE THE REPO URL>> -------------------------------- Impacted area Impact y/n -------------------------------- Docs n Build system n RPM/packaging n Configuration files n Startup scripts n SAF services n OpenSAF services n Core libraries n Samples n Tests y Other n Comments (indicate scope for each "y" above): --------------------------------------------- changeset a11ba1f36795162df0707dad181ac0b220f57928 Author: Carl Johannesson <car...@er...> Date: Tue, 02 Apr 2013 15:36:00 +0200 Test: Extend saflogtest test command (#3102) saflogtest test command should support writing log data to a configurable application stream Complete diffstat: ------------------ tests/logsv/saflogtest.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) Testing Commands: ----------------- create a configurable application stream. <immcfg -c SaLogStreamConfig safLgStrCfg=strA,safApp=safLogService -a saLogStreamFileName=strAfn -a saLogStreamPathName=strAdir write to stream. <saflogtest --capplication=strA <saflogtest -b strA Testing, Expected Results: -------------------------- log data should be stored in log file (strAfn). Conditions of Submission: ------------------------- - Arch Built Started Linux distro ------------------------------------------- mips n n mips64 n n x86 n n x86_64 n 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 ~/.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. |
From: OpenSAF T. <tr...@de...> - 2013-04-02 13:17:55
|
#3103: Log Server trace is default On shall be default Off closed defect --------------------------------------------------------------------- Reporter: elunlen Owner: elunlen Priority: major Milestone: 4.3.GA Component: saf/logsv Version: 4.3.M0 --------------------------------------------------------------------- Changes (by elunlen): * Status from 'accepted' to 'closed' * Resolution from 'None' to 'fixed' --------------------------------------------------------------------- Comment: changeset: 4145:9eef14c4f02f tag: tip parent: 4143:3cf6822101aa user: Lennart Lund <len...@er...> date: Tue Apr 02 15:09:51 2013 +0200 summary: logsv: Logserver trace is set to default Off changeset: 4144:b3563c4589fd branch: opensaf-4.3.x parent: 4141:fc185ca61c0f user: Lennart Lund <len...@er...> date: Tue Apr 02 15:09:51 2013 +0200 summary: logsv: Logserver trace is set to default Off rev: 9eef14c4f02f4c4305f0f143fd7db017a014cd3d rev: b3563c4589fd21da9154eb1febdb58231d3c8b3d -- Ticket URL: <URL:http://devel.opensaf.org/ticket/3103> OpenSAF <URL:http://devel.opensaf.org/> Open Source High Availability Middleware Based on the SA Forum Specifications |
From: OpenSAF T. <tr...@de...> - 2013-04-02 13:03:59
|
#3103: Log Server trace is default On shall be default Off accepted defect --------------------------------------------------------------------- Reporter: elunlen Owner: elunlen Priority: major Milestone: 4.3.GA Component: saf/logsv Version: 4.3.M0 --------------------------------------------------------------------- Changes (by elunlen): * Status from 'new' to 'accepted' -- Ticket URL: <URL:http://devel.opensaf.org/ticket/3103> OpenSAF <URL:http://devel.opensaf.org/> Open Source High Availability Middleware Based on the SA Forum Specifications |
From: OpenSAF T. <tr...@de...> - 2013-04-02 13:03:42
|
#3103: Log Server trace is default On shall be default Off new defect --------------------------------------------------------------------- Reporter: elunlen Owner: elunlen Priority: major Milestone: 4.3.GA Component: saf/logsv Version: 4.3.M0 --------------------------------------------------------------------- The logd.conf file has been incorrectly changed so that TRACE is always on -- Ticket URL: <URL:http://devel.opensaf.org/ticket/3103> OpenSAF <URL:http://devel.opensaf.org/> Open Source High Availability Middleware Based on the SA Forum Specifications |
From: OpenSAF T. <tr...@de...> - 2013-04-02 12:50:12
|
#3102: Extend saflogtest test command new enhancement --------------------------------------------------------------------- Reporter: uabcajn Owner: uabcajn Priority: minor Milestone: future_releases Component: opensaf/tests Version: 4.4.M0 --------------------------------------------------------------------- 'saflogtest' test command needs to support configurable application streams by adding a new command switch. -- Ticket URL: <URL:http://devel.opensaf.org/ticket/3102> OpenSAF <URL:http://devel.opensaf.org/> Open Source High Availability Middleware Based on the SA Forum Specifications |
From: OpenSAF T. <tr...@de...> - 2013-04-02 12:42:14
|
#3083: CSI Set Quiesced comp errs disable SU oper state and prematurely ends admin op accepted defect --------------------------------------------------------------------- Reporter: hafe Owner: hafe Priority: major Milestone: 4.2.3 Component: saf/avsv Version: 4.2.2 --------------------------------------------------------------------- Comment (by praveenmalviya): Replying to [comment:10 hafe]: > Replying to [comment:9 nagendra]: > > Some interesting stuff from Specs section : 9.4.3 SA_AMF_ADMIN_LOCK : > > > > SA_AIS_ERR_REPAIR_PENDING - If during the execution of this operation, certain > > erroneous components do not cooperate with the Availability Management Framework > > in carrying out the administrative operation, the Availability Management Framework > > tries to terminate them as part of the recovery operation before returning from > > the operation. If the Availability Management Framework cannot terminate these > > erroneous components, it will put them in the termination-failed presence state. However, > > the Availability Management Framework will continue the administrative operation, > > but will return from the call with this error value, before initiating the required > > repair operations for such components. The caller of the administrative operation is > > responsible for discovering such erroneous components and tracking the completion > > of the subsequent repair operations. > > > > > > Point is "However, the Availability Management Framework will continue the administrative operation, but will return from the call with this error value" > > > > No component enters termination-failed presence state failed thus the above is not relevant. In Termination-Failed state AMF will not perform any repair operations. See the decription "However, the Availability Management Framework will continue the administrative operation,but will return from the call with this error value, before initiating the required repair operations for such components". Here "such components" means "certain erroneous components do not cooperate with the AMF". This can include componets in any faulted state. So the sequence is : 1. If a component does not respond or respond with error for csi assignments then AMF will terminate them. 2. AMF will try to terminate. (Amfnd is trying to terminate the component). 3. Then the call will return. 4. Now, whether the component will get instantiated or not is AMF decision based on configurations(AutoRepair). -- Ticket URL: <URL:http://devel.opensaf.org/ticket/3083> OpenSAF <URL:http://devel.opensaf.org/> Open Source High Availability Middleware Based on the SA Forum Specifications |
From: OpenSAF T. <tr...@de...> - 2013-04-02 11:38:23
|
#3024: Logd crashed on active controller when saLogStreamLogFullHaltThreshold value is changed to invalid for configured application streams assigned defect --------------------------------------------------------------------- Reporter: chandra Owner: uabcajn Priority: major Milestone: future_releases Component: saf/logsv Version: 4.3.M0 --------------------------------------------------------------------- Comment (by uabcajn): I can't reproduce the fault, despite assigning saLogStreamLogFullHaltThreshold attribute to a number of out of range values. Can you really reproduce this crash??? -- Ticket URL: <URL:http://devel.opensaf.org/ticket/3024> OpenSAF <URL:http://devel.opensaf.org/> Open Source High Availability Middleware Based on the SA Forum Specifications |
From: OpenSAF T. <tr...@de...> - 2013-04-02 11:34:57
|
#3083: CSI Set Quiesced comp errs disable SU oper state and prematurely ends admin op accepted defect --------------------------------------------------------------------- Reporter: hafe Owner: hafe Priority: major Milestone: 4.2.3 Component: saf/avsv Version: 4.2.2 --------------------------------------------------------------------- Comment (by hafe): Replying to [comment:9 nagendra]: > Some interesting stuff from Specs section : 9.4.3 SA_AMF_ADMIN_LOCK : > > SA_AIS_ERR_REPAIR_PENDING - If during the execution of this operation, certain > erroneous components do not cooperate with the Availability Management Framework > in carrying out the administrative operation, the Availability Management Framework > tries to terminate them as part of the recovery operation before returning from > the operation. If the Availability Management Framework cannot terminate these > erroneous components, it will put them in the termination-failed presence state. However, > the Availability Management Framework will continue the administrative operation, > but will return from the call with this error value, before initiating the required > repair operations for such components. The caller of the administrative operation is > responsible for discovering such erroneous components and tracking the completion > of the subsequent repair operations. > > > Point is "However, the Availability Management Framework will continue the administrative operation, but will return from the call with this error value" > No component enters termination-failed presence state failed thus the above is not relevant. -- Ticket URL: <URL:http://devel.opensaf.org/ticket/3083> OpenSAF <URL:http://devel.opensaf.org/> Open Source High Availability Middleware Based on the SA Forum Specifications |
From: OpenSAF T. <tr...@de...> - 2013-04-02 11:30:05
|
#2277: logsvc's format_token @Cb<fs> is not appending extra spaces in the log when the buf_message size is less than the <fs> accepted defect --------------------------------------------------------------------- Reporter: chandra Owner: uabcajn Priority: minor Milestone: 4.3.GA Component: saf/logsv Version: 4.2.0 --------------------------------------------------------------------- Changes (by elunlen): * Patch_waiting from 'no' to 'yes' -- Ticket URL: <URL:http://devel.opensaf.org/ticket/2277> OpenSAF <URL:http://devel.opensaf.org/> Open Source High Availability Middleware Based on the SA Forum Specifications |
From: OpenSAF T. <tr...@de...> - 2013-04-02 08:50:08
|
#3101: AMF: refactoring new enhancement --------------------------------------------------------------------- Reporter: hafe Owner: ravisekhar Priority: major Milestone: future_releases Component: saf/avsv Version: 4.3.0 --------------------------------------------------------------------- Placeholder for AMF refactoring in 4.4 that falls outside http://devel.opensaf.org/ticket/2631 or as a preparation for 2631. -- Ticket URL: <URL:http://devel.opensaf.org/ticket/3101> OpenSAF <URL:http://devel.opensaf.org/> Open Source High Availability Middleware Based on the SA Forum Specifications |
From: Hans F. <han...@er...> - 2013-04-02 08:25:06
|
Ack. You could use the following commit message: "avsv: skip processing of ccb completed cbk at standby amfd (#3009)" Thanks, Hans On 03/29/2013 12:26 PM, pra...@or... wrote: > osaf/services/saf/avsv/avd/avd_imm.c | 3 +++ > 1 files changed, 3 insertions(+), 0 deletions(-) > > > diff --git a/osaf/services/saf/avsv/avd/avd_imm.c b/osaf/services/saf/avsv/avd/avd_imm.c > --- a/osaf/services/saf/avsv/avd/avd_imm.c > +++ b/osaf/services/saf/avsv/avd/avd_imm.c > @@ -688,6 +688,9 @@ static SaAisErrorT ccb_completed_cb(SaIm > > TRACE_ENTER2("CCB ID %llu", ccb_id); > > + if (avd_cb->avail_state_avd != SA_AMF_HA_ACTIVE) > + goto done; > + > /* "check that the sequence of change requests contained in the CCB is > valid and that no errors will be generated when these changes > are applied." */ > _______________________________________________ > devel mailing list > de...@li... > http://list.opensaf.org/maillist/listinfo/devel > > |
From: Anders B. <and...@er...> - 2013-04-02 08:22:30
|
I am still reviewing enhancement #3008. I think there is a bit too much code duplication from immnd_evt_proc_search_next in the new immnd_evt_proc_accessor_get. I would like to rewrite immnd_evt_proc_accessor_get so that it basically does: 1) initialize the accessor search-op. 2) invokes immnd_evt_proc_search_next. 3) finalize the search_op. Immnd_evt_proc_search_next may need only some slight adjustment to pick up That it is an accessor search op so that it labels the reply message with the Correct reply type. If I produce a patch for this it will go on top of Zorans patches and I will send out this Additional patch in a new review request. /AndersBj -----Original Message----- From: Neelakanta Reddy [mailto:red...@or...] Sent: den 1 april 2013 18:08 To: Zoran Milinkovic Cc: ope...@li... Subject: Re: [devel] [PATCH 1 of 1] immsv: redesign of object access functions (#3008) Hi Zoran, Reviewed and tested the patch. Ack. Neel. On Wednesday 27 March 2013 03:53 PM, Zoran Milinkovic wrote: > osaf/libs/agents/saf/imma/imma_om_api.c | 340 +++++++++++++++++----- > osaf/libs/common/immsv/immsv_evt.c | 93 ++++++ > osaf/libs/common/immsv/include/immsv_evt.h | 5 + > osaf/libs/common/immsv/include/immsv_evt_model.h | 10 + > osaf/services/saf/immsv/immnd/ImmModel.cc | 14 +- > osaf/services/saf/immsv/immnd/ImmSearchOp.cc | 1 + > osaf/services/saf/immsv/immnd/ImmSearchOp.hh | 3 + > osaf/services/saf/immsv/immnd/immnd_evt.c | 350 ++++++++++++++++++++++- > osaf/services/saf/immsv/immnd/immnd_init.h | 4 +- > 9 files changed, 734 insertions(+), 86 deletions(-) > > > The redesign of object access functions increases the preformance of saImmOmAccessorGet and reduce the number of calls from client side to server side. > > diff --git a/osaf/libs/agents/saf/imma/imma_om_api.c > b/osaf/libs/agents/saf/imma/imma_om_api.c > --- a/osaf/libs/agents/saf/imma/imma_om_api.c > +++ b/osaf/libs/agents/saf/imma/imma_om_api.c > @@ -5069,6 +5069,7 @@ SaAisErrorT saImmOmAccessorInitialize(Sa > > search_node->search_hdl = (SaImmSearchHandleT)m_NCS_GET_TIME_NS; > search_node->mImmHandle = immHandle; > + search_node->mSearchId = 0xffffffff; /* 0xffffffff for accessorGet */ > /*This is the external handle that the application uses. > Internally we use the searchId provided by the Node Director. */ > > @@ -5110,6 +5111,7 @@ SaAisErrorT saImmOmAccessorFinalize(SaIm > IMMA_SEARCH_NODE *search_node = NULL; > IMMA_CLIENT_NODE *cl_node = NULL; > uint32_t proc_rc = NCSCC_RC_SUCCESS; > + SaImmHandleT immHandle; > TRACE_ENTER(); > > if (cb->sv_id == 0) { > @@ -5128,37 +5130,33 @@ SaAisErrorT saImmOmAccessorFinalize(SaIm > > imma_search_node_get(&cb->search_tree, &accessorHandle, > &search_node); > > - if (!search_node) { > + if (!search_node || search_node->mSearchId != 0xffffffff) { > TRACE_2("ERR_BAD_HANDLE: Search node is missing"); > rc = SA_AIS_ERR_BAD_HANDLE; > goto release_lock; > } > > - if (search_node->mSearchId) { > - /*Finalize as a searchHandle */ > - m_NCS_UNLOCK(&cb->cb_lock, NCS_LOCK_WRITE); > - locked = false; > - /*NOTE: We return directly in the next statement. */ > - return saImmOmSearchFinalize((SaImmSearchHandleT)accessorHandle); > - > + if (search_node->mLastAttributes) { > + imma_freeSearchAttrs((SaImmAttrValuesT_2 **)search_node->mLastAttributes); > + search_node->mLastAttributes = NULL; > + } > + > + immHandle = search_node->mImmHandle; > + /*Search handle was apparently never used, just remove the node. */ > + proc_rc = imma_search_node_delete(cb, search_node); > + search_node = NULL; > + if (proc_rc != NCSCC_RC_SUCCESS) { > + TRACE_4("ERR_LIBRARY: Could not delete search node"); > + rc = SA_AIS_ERR_LIBRARY; > } else { > - SaImmHandleT immHandle = search_node->mImmHandle; > - /*Search handle was apparently never used, just remove the node. */ > - proc_rc = imma_search_node_delete(cb, search_node); > - search_node = NULL; > - if (proc_rc != NCSCC_RC_SUCCESS) { > - TRACE_4("ERR_LIBRARY: Could not delete search node"); > + /* Decrease number of search handles per IMM handle */ > + imma_client_node_get(&cb->client_tree, &immHandle, &cl_node); > + if (cl_node && cl_node->isOm) { /* TODO: Is osafassert(cl_node && cl_node->isOm) better solution */ > + osafassert(cl_node->searchHandleSize); > + cl_node->searchHandleSize--; > + } else { > + TRACE_2("ERR_LIBRARY: Invalid SaImmHandleT related to search > +handle"); > rc = SA_AIS_ERR_LIBRARY; > - } else { > - /* Decrease number of search handles per IMM handle */ > - imma_client_node_get(&cb->client_tree, &immHandle, &cl_node); > - if (cl_node && cl_node->isOm) { /* TODO: Is osafassert(cl_node && cl_node->isOm) better solution */ > - osafassert(cl_node->searchHandleSize); > - cl_node->searchHandleSize--; > - } else { > - TRACE_2("ERR_LIBRARY: Invalid SaImmHandleT related to search handle"); > - rc = SA_AIS_ERR_LIBRARY; > - } > } > } > > @@ -5177,25 +5175,40 @@ SaAisErrorT saImmOmAccessorGet_2(SaImmAc > const SaImmAttrNameT *attributeNames, SaImmAttrValuesT_2 ***attributes) > { > SaAisErrorT rc = SA_AIS_OK; > + uint32_t proc_rc; > bool locked = true; > IMMA_CB *cb = &imma_cb; > + IMMA_CLIENT_NODE *cl_node = NULL; > IMMA_SEARCH_NODE *search_node = NULL; > - SaNameT redundantName; > - SaImmAttrValuesT_2 **attributeList = NULL; > + IMMSV_EVT evt; > + IMMSV_EVT *out_evt = NULL; > + SaUint32T timeout; > + SaImmSearchHandleT tmpSearchHandle; > + > + TRACE_ENTER(); > > if (cb->sv_id == 0) { > TRACE_2("ERR_BAD_HANDLE: No initialized handle exists!"); > + TRACE_LEAVE(); > return SA_AIS_ERR_BAD_HANDLE; > } > > + if (cb->is_immnd_up == false) { > + TRACE_3("ERR_TRY_AGAIN: IMMND is DOWN"); > + TRACE_LEAVE(); > + return SA_AIS_ERR_TRY_AGAIN; > + } > + > if ((objectName == NULL) || (objectName->length == 0) || (objectName->length >= SA_MAX_NAME_LENGTH)) { > TRACE_2("ERR_INVALID_PARAM: Incorrect parameter contents: > objectName"); > + TRACE_LEAVE(); > return SA_AIS_ERR_INVALID_PARAM; > } > > /* Skip the case when attributeNames[0] == NULL and attributes == NULL (#2166) */ > if (!attributes && (!attributeNames || attributeNames[0])) { > TRACE_2("ERR_INVALID_PARAM: attributes is NULL"); > + TRACE_LEAVE(); > return SA_AIS_ERR_INVALID_PARAM; > } > > @@ -5215,74 +5228,245 @@ SaAisErrorT saImmOmAccessorGet_2(SaImmAc > goto release_lock; > } > > + if(search_node->mSearchId != 0xffffffff) { > + rc = SA_AIS_ERR_BAD_HANDLE; > + TRACE_4("ERR_BAD_HANDLE: Search handle is not accessory object handle"); > + goto release_lock; > + } > + > SaImmHandleT immHandle = search_node->mImmHandle; > > - /* Stale check etc done in searchInit & searchNext below. */ > - > - /* Release locks and cb for normal cases as it uses SearchInit & > + imma_client_node_get(&cb->client_tree, &immHandle, &cl_node); > + if (!(cl_node && cl_node->isOm)) { > + TRACE_2("ERR_BAD_HANDLE: Client node is missing"); > + rc = SA_AIS_ERR_BAD_HANDLE; > + goto release_lock; > + } > + > + if (cl_node->stale) { > + TRACE_1("IMM Handle %llx is stale", immHandle); > + bool resurrected = imma_om_resurrect(cb, cl_node, &locked); > + cl_node = NULL; > + > + if (!locked && m_NCS_LOCK(&cb->cb_lock, NCS_LOCK_WRITE) != NCSCC_RC_SUCCESS) { > + TRACE_4("ERR_LIBRARY: Lock failed"); > + rc = SA_AIS_ERR_LIBRARY; > + goto release_cb; > + } > + locked = true; > + > + imma_client_node_get(&cb->client_tree, &immHandle, &cl_node); > + > + if (!resurrected || !cl_node || !(cl_node->isOm) || cl_node->stale) { > + TRACE_3("ERR_BAD_HANDLE: Reactive ressurect of handle %llx failed", immHandle); > + if (cl_node && cl_node->stale) {cl_node->exposed = true;} > + rc = SA_AIS_ERR_BAD_HANDLE; > + goto release_lock; > + } > + > + TRACE_1("Reactive resurrect of handle %llx succeeded", immHandle); > + } > + > + if((rc = imma_proc_increment_pending_reply(cl_node, true)) != SA_AIS_OK) { > + TRACE_4("ERR_LIBRARY: Overlapping use of IMM handle by multiple threads"); > + goto release_lock; > + } > + > + memset(&evt, 0, sizeof(IMMSV_EVT)); > + evt.type = IMMSV_EVT_TYPE_IMMND; > + evt.info.immnd.type = IMMND_EVT_A2ND_ACCESSOR_GET; > + IMMSV_OM_ACCESSOR_GET *req = &(evt.info.immnd.info.accessorGet); > + req->client_hdl = immHandle; > + req->objectName.size = strlen((char *)objectName->value) + 1; > + if(objectName->length + 1 < req->objectName.size) > + req->objectName.size = objectName->length + 1; > + req->objectName.buf = malloc(req->objectName.size); /* alloc-1 */ > + strncpy(req->objectName.buf, (char *)objectName->value, (size_t)req->objectName.size); > + req->objectName.buf[req->objectName.size - 1] = 0; > + > + req->attributeNames = NULL; > + if(attributeNames) { > + const SaImmAttrNameT *namev; > + for (namev = attributeNames; *namev; namev++) { > + IMMSV_ATTR_NAME_LIST *p = (IMMSV_ATTR_NAME_LIST *) > + malloc(sizeof(IMMSV_ATTR_NAME_LIST)); /* alloc-2 */ > + p->name.size = strlen(*namev) + 1; > + p->name.buf = malloc(p->name.size); /* alloc-3 */ > + strncpy(p->name.buf, *namev, p->name.size); > + p->name.buf[p->name.size - 1] = 0; > + > + p->next = req->attributeNames; /*NULL in first iteration */ > + req->attributeNames = p; > + } > + } > + > + tmpSearchHandle = search_node->search_hdl; > + timeout = cl_node->syncr_timeout; > + > + /* Release locks and cb for normal cases as it uses SearchInit & > SearchNext. > */ > m_NCS_UNLOCK(&cb->cb_lock, NCS_LOCK_WRITE); > locked = false; > > - /*The accessorHandle is actually just a searchhandle in this > - implementation. > - SaImmSearchHandleT searchHandle = (SaImmSearchHandleT) accessorHandle; > - */ > - > - if (search_node->mSearchId) { /* TODO: Use of search_node not safe (unlocked) */ > - TRACE("Closing previous allocation :%u\n", search_node->mSearchId); > - > - /*Perform a search-next, simply to discard any previous allocation. */ > - /*Cant do a searchFinalize since that will discard the node. */ > - > - redundantName.length = 0; > - m_IMMSV_SET_SANAMET((&redundantName)); > - > - rc = saImmOmSearchNext_2(accessorHandle, &redundantName, &attributeList); > - > - if (rc != SA_AIS_ERR_NOT_EXIST && rc != SA_AIS_ERR_BAD_HANDLE) { > - TRACE_4("ERR_LIBRARY: Unexpected return code from internal searchNext: %u", rc); > - return SA_AIS_ERR_LIBRARY; /*No handles to close here. */ > - } > - > - /* Close the previous search id. > - Cant use saImmOmSearchfinalize, because this will also close the > - search handle and deallocate the search_node. > - */ > - > - /* NOTE/TODO: Should Send a ImmOmSearchFinalize message to IMMND !! > - This to discard the search on the server side. See searchFinalize. */ > - search_node->mSearchId = 0; > - } > - > - rc = saImmOmSearchInitialize_2(immHandle, objectName, /*root == object */ > - SA_IMM_ONE, /* Normally illegal in search */ > - 0, NULL, attributeNames, &accessorHandle); > - > - if (rc != SA_AIS_OK) { > - search_node->mSearchId = 0; > - return rc; > - } > - > - redundantName.length = 0; > - m_IMMSV_SET_SANAMET((&redundantName)); > - rc = saImmOmSearchNext_2(accessorHandle, &redundantName, &attributeList); > - if(attributes) > - *attributes = attributeList; > - return rc; > + /* IMMND GOES DOWN */ > + if (cb->is_immnd_up == false) { > + rc = SA_AIS_ERR_TRY_AGAIN; > + TRACE_3("ERR_TRY_AGAIN: IMMND is DOWN"); > + goto mds_send_fail; > + } > + > + /* send the request to the IMMND */ > + proc_rc = imma_mds_msg_sync_send(cb->imma_mds_hdl, > +&cb->immnd_mds_dest, &evt, &out_evt, timeout); > + > + switch(proc_rc) { > + case NCSCC_RC_SUCCESS: > + break; > + > + case NCSCC_RC_REQ_TIMOUT: > + rc = imma_proc_check_stale(cb, immHandle, SA_AIS_ERR_TIMEOUT); > + goto mds_send_fail; > + > + default: > + rc = SA_AIS_ERR_LIBRARY; > + TRACE_4("ERR_LIBRARY: MDS returned unexpected error code %u", proc_rc); > + goto mds_send_fail; > + } > + > + if (search_node->mLastAttributes) { > + imma_freeSearchAttrs((SaImmAttrValuesT_2 **)search_node->mLastAttributes); > + search_node->mLastAttributes = NULL; > + } > + > + if(out_evt) { > + osafassert(out_evt->type == IMMSV_EVT_TYPE_IMMA); > + if (out_evt->info.imma.type == IMMA_EVT_ND2A_IMM_ERROR) { > + rc = out_evt->info.imma.info.errRsp.error; > + osafassert(rc && (rc != SA_AIS_OK)); > + free(out_evt); /*BUGFIX (leak) 090506 */ > + out_evt = NULL; > + goto mds_send_fail; > + } > + > + osafassert(out_evt->info.imma.type == > +IMMA_EVT_ND2A_ACCESSOR_GET_RSP); > + > + if(attributes) { > + int noOfAttributes = 0; > + int i = 0; > + IMMSV_ATTR_VALUES_LIST *p; > + IMMSV_ATTR_VALUES_LIST *attrValueList; > + SaImmAttrValuesT_2 **attr; > + > + attrValueList = > +out_evt->info.imma.info.accessorGetRsp.attrValuesList; > + > + p = attrValueList; > + while(p) { > + noOfAttributes++; > + p = p->next; > + } > + > + p = attrValueList; > + attr = calloc(noOfAttributes + 1, sizeof(SaImmAttrValuesT_2 *)); /* alloc-1 */ > + for(i=0; i<noOfAttributes; i++, p = p->next) { > + IMMSV_ATTR_VALUES *q = &(p->n); > + attr[i] = calloc(1, sizeof(SaImmAttrValuesT_2)); /* alloc-2 */ > + attr[i]->attrName = malloc(q->attrName.size + 1); /* alloc-3 */ > + strncpy(attr[i]->attrName, (const char *)q->attrName.buf, q->attrName.size + 1); > + attr[i]->attrName[q->attrName.size] = 0; /*redundant. */ > + attr[i]->attrValuesNumber = q->attrValuesNumber; > + attr[i]->attrValueType = (SaImmValueTypeT)q->attrValueType; > + > + if (q->attrValuesNumber) { > + attr[i]->attrValues = calloc(1, q->attrValuesNumber * sizeof(SaImmAttrValueT)); /*alloc-4 */ > + /*alloc-5 */ > + attr[i]->attrValues[0] = imma_copyAttrValue3(q->attrValueType, > +&(q->attrValue)); > + > + if (q->attrValuesNumber > 1) { > + int ix; > + IMMSV_EDU_ATTR_VAL_LIST *r = q->attrMoreValues; > + for (ix = 1; ix < q->attrValuesNumber; ++ix) { > + osafassert(r); > + attr[i]->attrValues[ix] = imma_copyAttrValue3(q->attrValueType, &(r->n)); /*alloc-5 */ > + r = r->next; > + } > + } > + } > + } > + *attributes = attr; > + search_node->mLastAttributes = attr; > + } > + } else { > + TRACE_4("ERR_LIBRARY: Empty return message from IMMND"); > + rc = SA_AIS_ERR_LIBRARY; > + } > + > +mds_send_fail: > + > + if(req->objectName.buf) { > + free(req->objectName.buf); /* free-1 */ > + req->objectName.buf = NULL; > + req->objectName.size = 0; > + } > + if (req->attributeNames) { > + immsv_evt_free_attrNames(req->attributeNames); /* free-2 and free-3 */ > + req->attributeNames = NULL; > + } > + > + if (m_NCS_LOCK(&cb->cb_lock, NCS_LOCK_WRITE) != NCSCC_RC_SUCCESS) { > + rc = SA_AIS_ERR_LIBRARY; > + TRACE_4("ERR_LIBRARY: Lock error"); > + goto release_cb; > + } > + locked = true; > + > + imma_client_node_get(&cb->client_tree, &immHandle, &cl_node); > + if (!(cl_node && cl_node->isOm)) { > + TRACE_3("ERR_BAD_HANDLE: Client node is gone after down call"); > + rc = SA_AIS_ERR_BAD_HANDLE; > + goto release_lock; > + } > + > + imma_proc_decrement_pending_reply(cl_node, true); > + > + imma_search_node_get(&cb->search_tree, &tmpSearchHandle, &search_node); > + if ((!search_node) || (search_node->mImmHandle != immHandle)) { > + TRACE_3("ERR_BAD_HANDLE: Search node is missing after down call"); > + rc = SA_AIS_ERR_BAD_HANDLE; > + goto release_lock; > + } > + > + if (cl_node->stale) { > + if (isExposed(cb, cl_node)) { > + TRACE_2("ERR_BAD_HANDLE: client is stale after down call and exposed"); > + rc = SA_AIS_ERR_BAD_HANDLE; > + } else { > + TRACE_2("ERR_TRY_AGAIN: Handle %llx is stale after down call but " > + "possible to resurrect", immHandle); > + /* Can override BAD_HANDLE/TIMEOUT set in check_stale */ > + rc = SA_AIS_ERR_TRY_AGAIN; > + } > + } > > /*error cases only */ > - release_lock: > +release_lock: > if (locked) { > m_NCS_UNLOCK(&cb->cb_lock, NCS_LOCK_WRITE); > } > > - release_cb: > - > + if(out_evt) { > + if(out_evt->info.imma.info.accessorGetRsp.attrValuesList) { > + immsv_free_attrvalues_list(out_evt->info.imma.info.accessorGetRsp.attrValuesList); > + } > + > + free(out_evt); > + } > + > +release_cb: > + TRACE_LEAVE(); > return rc; > } > > + > static unsigned int get_att_val_size(IMMSV_EDU_ATTR_VAL *p, SaImmValueTypeT t) > { > switch (t) { > diff --git a/osaf/libs/common/immsv/immsv_evt.c > b/osaf/libs/common/immsv/immsv_evt.c > --- a/osaf/libs/common/immsv/immsv_evt.c > +++ b/osaf/libs/common/immsv/immsv_evt.c > @@ -168,6 +168,7 @@ static const char *immnd_evt_names[] = { > "IMMND_EVT_A2ND_OI_CCB_AUG_INIT", > "IMMND_EVT_A2ND_AUG_ADMO", > "IMMND_EVT_A2ND_CL_TIMEOUT", > + "IMMND_EVT_A2ND_ACCESSOR_GET", > "undefined (high)" > }; > > @@ -1379,6 +1380,28 @@ static uint32_t immsv_evt_enc_sublevels( > else > { No attrValues } > */ > + } else if (i_evt->info.imma.type == IMMA_EVT_ND2A_ACCESSOR_GET_RSP) { > + uint8_t *p8; > + int depth = 0; > + /*Encode searchNext response */ > + IMMSV_OM_RSP_ACCESSOR_GET *ag = > +&(i_evt->info.imma.info.accessorGetRsp); > + > + IMMSV_RSRV_SPACE_ASSERT(p8, o_ub, 1); > + ncs_encode_8bit(&p8, (ag->attrValuesList) ? 1 : 0); > + ncs_enc_claim_space(o_ub, 1); > + > + if (ag->attrValuesList) { > + IMMSV_ATTR_VALUES_LIST *al = ag->attrValuesList; > + do { > + immsv_evt_enc_attribute(o_ub, al); > + al = al->next; > + ++depth; > + } while (al && (depth < IMMSV_MAX_ATTRIBUTES)); > + if (depth >= IMMSV_MAX_ATTRIBUTES) { > + LOG_ER("Search next: TOO MANY ATTR DEFS line:%u", __LINE__); > + return NCSCC_RC_OUT_OF_MEM; > + } > + } > } else if (i_evt->info.imma.type == IMMA_EVT_ND2A_OI_OBJ_CREATE_UC) { > int depth = 0; > /*Encode the className */ > @@ -1858,6 +1881,25 @@ static uint32_t immsv_evt_enc_sublevels( > return NCSCC_RC_OUT_OF_MEM; > } > > + } else if (i_evt->info.immnd.type == IMMND_EVT_A2ND_ACCESSOR_GET) { > + int depth = 0; > + > + IMMSV_OCTET_STRING *objectName = &(i_evt->info.immnd.info.accessorGet.objectName); > + if (!immsv_evt_enc_inline_text(__LINE__, o_ub, objectName)) { > + return NCSCC_RC_OUT_OF_MEM; > + } > + > + IMMSV_ATTR_NAME_LIST *attr = i_evt->info.immnd.info.accessorGet.attributeNames; > + while(attr && (depth < IMMSV_MAX_ATTRIBUTES)) { > + immsv_evt_enc_attrName(o_ub, attr); > + attr = attr->next; > + ++depth; > + } > + > + if (depth >= IMMSV_MAX_ATTRIBUTES) { > + LOG_ER("TOO MANY attribute names line:%u", __LINE__); > + return NCSCC_RC_OUT_OF_MEM; > + } > } else if (i_evt->info.immnd.type == IMMND_EVT_A2ND_RT_ATT_UPPD_RSP) { > int depth = 0; > /*Encode the objectName */ > @@ -2042,6 +2084,25 @@ static uint32_t immsv_evt_dec_sublevels( > } else { > o_evt->info.imma.info.searchNextRsp->attrValuesList = NULL; > } > + } else if (o_evt->info.imma.type == IMMA_EVT_ND2A_ACCESSOR_GET_RSP) { > + uint8_t *p8; > + uint8_t c8; > + uint8_t local_data[8]; > + > + /*Decode accessorGet Response */ > + IMMSV_OM_RSP_ACCESSOR_GET *ag = > +&(o_evt->info.imma.info.accessorGetRsp); > + > + IMMSV_FLTN_SPACE_ASSERT(p8, local_data, i_ub, 1); > + c8 = ncs_decode_8bit(&p8); > + ncs_dec_skip_space(i_ub, 1); > + if (c8) { > + /*Decode the list of attributes */ > + IMMSV_ATTR_VALUES_LIST *p = NULL; > + immsv_evt_dec_attributes(i_ub, &p); > + ag->attrValuesList = p; > + } else { > + ag->attrValuesList = NULL; > + } > } else if (o_evt->info.imma.type == IMMA_EVT_ND2A_OI_OBJ_CREATE_UC) { > /*Decode the className */ > IMMSV_OCTET_STRING *os = > &(o_evt->info.imma.info.objCreate.className); > @@ -2373,6 +2434,18 @@ static uint32_t immsv_evt_dec_sublevels( > immsv_evt_dec_attrNames(i_ub, &p); > o_evt->info.immnd.info.searchInit.attributeNames = p; > } > + } else if (o_evt->info.immnd.type == IMMND_EVT_A2ND_ACCESSOR_GET) { > + IMMSV_OCTET_STRING *os = &(o_evt->info.immnd.info.accessorGet.objectName); > + if (os->size) { > + immsv_evt_dec_inline_string(i_ub, os); > + } else > + os->buf = NULL; > + > + IMMSV_ATTR_NAME_LIST *p = o_evt->info.immnd.info.accessorGet.attributeNames; > + if (p) { > + immsv_evt_dec_attrNames(i_ub, &p); > + o_evt->info.immnd.info.accessorGet.attributeNames = p; > + } > } else if (o_evt->info.immnd.type == IMMND_EVT_A2ND_RT_ATT_UPPD_RSP) { > /*Decode the objectName */ > IMMSV_OCTET_STRING *os = > &(o_evt->info.immnd.info.rtAttUpdRpl.sr.objectName); > @@ -2639,6 +2712,10 @@ static uint32_t immsv_evt_enc_toplevel(I > /*Totaly encoded in sublevel. */ > break; > > + case IMMA_EVT_ND2A_ACCESSOR_GET_RSP: //Response from for AccessorGet > + /*Totaly encoded in sublevel. */ > + break; > + > case IMMA_EVT_ND2A_SEARCH_REMOTE: //Fetch pure runtime attributes. > IMMSV_RSRV_SPACE_ASSERT(p8, o_ub, 8); > ncs_encode_64bit(&p8, immaevt->info.searchRemote.client_hdl); > @@ -3125,6 +3202,12 @@ static uint32_t immsv_evt_enc_toplevel(I > case IMMND_EVT_A2ND_SEARCH_REMOTE: > */ > > + case IMMND_EVT_A2ND_ACCESSOR_GET: /* AccessorGet */ > + IMMSV_RSRV_SPACE_ASSERT(p8, o_ub, 8); > + ncs_encode_64bit(&p8, immndevt->info.accessorGet.client_hdl); > + ncs_enc_claim_space(o_ub, 8); > + break; > + > case IMMND_EVT_A2ND_RT_ATT_UPPD_RSP: /* reply for fetch of rt attr vals */ > IMMSV_RSRV_SPACE_ASSERT(p8, o_ub, 8); > ncs_encode_64bit(&p8, immndevt->info.rtAttUpdRpl.sr.client_hdl); > @@ -3896,6 +3979,10 @@ static uint32_t immsv_evt_dec_toplevel(N > /*Totaly decoded in sublevel. */ > break; > > + case IMMA_EVT_ND2A_ACCESSOR_GET_RSP: //Response from for AccessorGet > + /*Totaly decoded in sublevel. */ > + break; > + > case IMMA_EVT_ND2A_SEARCH_REMOTE: //Fetch pure runtime attributes. > IMMSV_FLTN_SPACE_ASSERT(p8, local_data, i_ub, 8); > immaevt->info.searchRemote.client_hdl = ncs_decode_64bit(&p8); @@ > -4399,6 +4486,12 @@ static uint32_t immsv_evt_dec_toplevel(N > case IMMND_EVT_A2ND_SEARCH_REMOTE: > */ > > + case IMMND_EVT_A2ND_ACCESSOR_GET: /* AccessorGet */ > + IMMSV_FLTN_SPACE_ASSERT(p8, local_data, i_ub, 8); > + immndevt->info.accessorGet.client_hdl = ncs_decode_64bit(&p8); > + ncs_dec_skip_space(i_ub, 8); > + break; > + > case IMMND_EVT_A2ND_RT_ATT_UPPD_RSP: /* reply for fetch of rt attr vals */ > IMMSV_FLTN_SPACE_ASSERT(p8, local_data, i_ub, 8); > immndevt->info.rtAttUpdRpl.sr.client_hdl = ncs_decode_64bit(&p8); > diff --git a/osaf/libs/common/immsv/include/immsv_evt.h > b/osaf/libs/common/immsv/include/immsv_evt.h > --- a/osaf/libs/common/immsv/include/immsv_evt.h > +++ b/osaf/libs/common/immsv/include/immsv_evt.h > @@ -89,6 +89,7 @@ typedef enum imma_evt_type { > IMMA_EVT_ND2A_CCB_AUG_INIT_RSP = 28, /* Response on > IMMND_EVT_A2ND_OI_CCB_AUG_INIT */ > > IMMA_EVT_ND2A_SEARCHBUNDLENEXT_RSP = 29, /*Response from SearchNext with more results */ > + IMMA_EVT_ND2A_ACCESSOR_GET_RSP = 30, /* Response from accessorGet */ > > IMMA_EVT_MAX > } IMMA_EVT_TYPE; > @@ -202,6 +203,8 @@ typedef enum immnd_evt_type { > IMMND_EVT_A2ND_AUG_ADMO = 92, /* Inform IMMNDs of extra admo for augment ccb */ > IMMND_EVT_A2ND_CL_TIMEOUT = 93, /* Inform local IMMND of a library > timeout. */ > > + IMMND_EVT_A2ND_ACCESSOR_GET = 94, /* saImmOmAccessorGet_2 */ > + > IMMND_EVT_MAX > } IMMND_EVT_TYPE; > /* Make sure the string array in immsv_evt.c matches the > IMMND_EVT_TYPE enum. */ @@ -432,6 +435,7 @@ typedef struct imma_evt { > IMMSV_OM_RSP_SEARCH_NEXT *searchNextRsp; > IMMSV_OM_RSP_SEARCH_BUNDLE_NEXT *searchBundleNextRsp; > IMMSV_OM_SEARCH_REMOTE searchRemote; > + IMMSV_OM_RSP_ACCESSOR_GET accessorGetRsp; > IMMSV_OM_ADMIN_OP_INVOKE admOpReq; //For the OI callback. > IMMSV_OI_ADMIN_OP_RSP admOpRsp; > IMMSV_OM_CCB_OBJECT_CREATE objCreate; //callback > @@ -488,6 +492,7 @@ typedef struct immnd_evt { > IMMSV_OI_SEARCH_REMOTE_RSP rtAttUpdRpl; > IMMSV_OM_SEARCH_REMOTE searchRemote; > IMMSV_OM_RSP_SEARCH_REMOTE rspSrchRmte; > + IMMSV_OM_ACCESSOR_GET accessorGet; > > /* IMMD --> IMMND */ > IMMSV_D2ND_CONTROL ctrl; > diff --git a/osaf/libs/common/immsv/include/immsv_evt_model.h > b/osaf/libs/common/immsv/include/immsv_evt_model.h > --- a/osaf/libs/common/immsv/include/immsv_evt_model.h > +++ b/osaf/libs/common/immsv/include/immsv_evt_model.h > @@ -81,6 +81,10 @@ extern "C" { > IMMSV_OM_RSP_SEARCH_NEXT **searchResult; > } IMMSV_OM_RSP_SEARCH_BUNDLE_NEXT; > > + typedef struct ImmsvOmRspAccessorGet { > + IMMSV_ATTR_VALUES_LIST *attrValuesList; > + } IMMSV_OM_RSP_ACCESSOR_GET; > + > typedef struct ImmsvOmRspSearchRemote { > SaAisErrorT result; > SaUint32T requestNodeId; > @@ -208,6 +212,12 @@ extern "C" { > IMMSV_ATTR_NAME_LIST *attributeNames; > } IMMSV_OM_SEARCH_INIT; > > + typedef struct ImmsvOmAccessorGet { > + SaImmHandleT client_hdl; > + IMMSV_OCTET_STRING objectName; > + IMMSV_ATTR_NAME_LIST *attributeNames; > + } IMMSV_OM_ACCESSOR_GET; > + > typedef struct ImmsvOmSearchRemote { > SaImmHandleT client_hdl; > SaUint32T requestNodeId; > diff --git a/osaf/services/saf/immsv/immnd/ImmModel.cc > b/osaf/services/saf/immsv/immnd/ImmModel.cc > --- a/osaf/services/saf/immsv/immnd/ImmModel.cc > +++ b/osaf/services/saf/immsv/immnd/ImmModel.cc > @@ -547,7 +547,7 @@ void > immModel_specialApplierSavePrtoCreateAttrs(IMMND_CB *cb, > struct ImmsvOmCcbObjectCreate *req, SaUint32T continuationId) > { > - return ImmModel::instance(&cb->immModel)-> > + ImmModel::instance(&cb->immModel)-> > specialApplierSavePrtoCreateAttrs(req, continuationId); > } > > @@ -555,7 +555,7 @@ void > immModel_specialApplierSaveRtUpdateAttrs(IMMND_CB *cb, > struct ImmsvOmCcbObjectModify *req, SaUint32T continuationId) > { > - return ImmModel::instance(&cb->immModel)-> > + ImmModel::instance(&cb->immModel)-> > specialApplierSaveRtUpdateAttrs(req, continuationId); > } > > @@ -1107,12 +1107,13 @@ immModel_ccbAugmentAdmo(IMMND_CB *cb, Sa > > SaAisErrorT > immModel_searchInitialize(IMMND_CB *cb, struct ImmsvOmSearchInit* req, > - void** searchOp, SaBoolT isSync) > + void** searchOp, SaBoolT isSync, SaBoolT isAccessor) > { > ImmSearchOp* op = new ImmSearchOp(); > *searchOp = op; > > if(isSync) {op->setIsSync();} > + if(isAccessor) {op->setIsAccessor();} > > return ImmModel::instance(&cb->immModel)->searchInitialize(req, *op); > } > @@ -1209,6 +1210,13 @@ immModel_clearLastResult(void* searchOp) > op->clearLastResult(); > } > > +SaBoolT > +immModel_isSearchOpAccessor(void* searchOp) { > + ImmSearchOp* op = (ImmSearchOp *) searchOp; > + return op->isAccessor() ? SA_TRUE : SA_FALSE; } > + > void > immModel_setAdmReqContinuation(IMMND_CB *cb, SaInvocationT invoc, > SaUint32T reqConn) > diff --git a/osaf/services/saf/immsv/immnd/ImmSearchOp.cc > b/osaf/services/saf/immsv/immnd/ImmSearchOp.cc > --- a/osaf/services/saf/immsv/immnd/ImmSearchOp.cc > +++ b/osaf/services/saf/immsv/immnd/ImmSearchOp.cc > @@ -23,6 +23,7 @@ ImmSearchOp::ImmSearchOp() > { > mLastResult=NULL; > mIsSync=false; > + mIsAccessor=false; > syncOsi=NULL; > attrNameList=NULL; > classInfo=NULL; > diff --git a/osaf/services/saf/immsv/immnd/ImmSearchOp.hh > b/osaf/services/saf/immsv/immnd/ImmSearchOp.hh > --- a/osaf/services/saf/immsv/immnd/ImmSearchOp.hh > +++ b/osaf/services/saf/immsv/immnd/ImmSearchOp.hh > @@ -85,7 +85,9 @@ public: > fetchLastResult() {return mLastResult;} > void clearLastResult() {mLastResult = NULL;} > void setIsSync() {mIsSync = true;} > + void setIsAccessor() {mIsAccessor = true;} > bool isSync() {return mIsSync;} > + bool isAccessor() {return mIsAccessor;} > void* syncOsi; > void* attrNameList; > void* classInfo; > @@ -95,6 +97,7 @@ private: > //fetching of runtime attribute values. > AttributeList mRtsToFetch; > bool mIsSync; > + bool mIsAccessor; > }; > > #endif > diff --git a/osaf/services/saf/immsv/immnd/immnd_evt.c > b/osaf/services/saf/immsv/immnd/immnd_evt.c > --- a/osaf/services/saf/immsv/immnd/immnd_evt.c > +++ b/osaf/services/saf/immsv/immnd/immnd_evt.c > @@ -208,6 +208,8 @@ static uint32_t immnd_evt_proc_remote_se > > static uint32_t immnd_evt_proc_search_finalize(IMMND_CB *cb, > IMMND_EVT *evt, IMMSV_SEND_INFO *sinfo); > > +static uint32_t immnd_evt_proc_accessor_get(IMMND_CB *cb, IMMND_EVT > +*evt, IMMSV_SEND_INFO *sinfo); > + > static uint32_t immnd_evt_proc_mds_evt(IMMND_CB *cb, IMMND_EVT > *evt); > > /*static uint32_t immnd_evt_immd_new_active(IMMND_CB *cb);*/ @@ > -365,6 +367,11 @@ uint32_t immnd_evt_destroy(IMMSV_EVT *ev > > immsv_evt_free_attrNames(evt->info.immnd.info.searchInit.attributeNames); > evt->info.immnd.info.searchInit.attributeNames = NULL; > + } else if (evt->info.immnd.type == IMMND_EVT_A2ND_ACCESSOR_GET) { > + if(evt->info.immnd.info.accessorGet.objectName.buf) > + free(evt->info.immnd.info.accessorGet.objectName.buf); > + if(evt->info.immnd.info.accessorGet.attributeNames) > + > +immsv_evt_free_attrNames(evt->info.immnd.info.accessorGet.attributeNa > +mes); > } else if ((evt->info.immnd.type == IMMND_EVT_ND2ND_SYNC_FINALIZE) || > (evt->info.immnd.type == IMMND_EVT_ND2ND_SYNC_FINALIZE_2)) { > immsv_evt_free_admo(evt->info.immnd.info.finSync.adminOwners); > @@ -589,6 +596,10 @@ void immnd_process_evt(void) > rc = immnd_evt_proc_search_next(cb, &evt->info.immnd, &evt->sinfo); > break; > > + case IMMND_EVT_A2ND_ACCESSOR_GET: > + rc = immnd_evt_proc_accessor_get(cb, &evt->info.immnd, &evt->sinfo); > + break; > + > case IMMND_EVT_A2ND_RT_ATT_UPPD_RSP: > rc = immnd_evt_proc_oi_att_pull_rpl(cb, &evt->info.immnd, &evt->sinfo); > break; > @@ -860,7 +871,7 @@ static uint32_t immnd_evt_proc_search_in > goto agent_rsp; > } > > - error = immModel_searchInitialize(cb, &(evt->info.searchInit), &searchOp, isSync); > + error = immModel_searchInitialize(cb, &(evt->info.searchInit), > +&searchOp, isSync, SA_FALSE); > > if((error == SA_AIS_OK) && isSync) { > /* Special processing only for sync iterator. */ @@ -895,6 +906,8 > @@ static uint32_t immnd_evt_proc_search_in > } > > sn->searchId = cb->cli_id_gen++; /* separate count for search */ > + if(cb->cli_id_gen == 0xffffffff) > + cb->cli_id_gen = 1; > sn->searchOp = searchOp; /*TODO: wraparround */ > sn->next = cl_node->searchOpList; > cl_node->searchOpList = sn; > @@ -926,6 +939,7 @@ void search_req_continue(IMMND_CB *cb, I > IMMSV_ATTR_VALUES_LIST *oldRsp, *fetchedRsp; > IMMND_OM_SEARCH_NODE *sn = NULL; > SaAisErrorT err = reply->result; > + SaBoolT isAccessor = SA_FALSE; > TRACE_ENTER(); > osafassert(reply->requestNodeId == cb->node_id); > memset(&send_evt, '\0', sizeof(IMMSV_EVT)); @@ -954,6 +968,7 @@ > void search_req_continue(IMMND_CB *cb, I > if (sn) { > immModel_fetchLastResult(sn->searchOp, &rsp); > immModel_clearLastResult(sn->searchOp); > + isAccessor = immModel_isSearchOpAccessor(sn->searchOp); > } else { > LOG_ER("Could not find search node for search-ID:%u", reply->searchId); > if (err == SA_AIS_OK) { > @@ -1036,8 +1051,14 @@ void search_req_continue(IMMND_CB *cb, I > > agent_rsp: > if (err == SA_AIS_OK) { > - send_evt.info.imma.type = IMMA_EVT_ND2A_SEARCHNEXT_RSP; > - send_evt.info.imma.info.searchNextRsp = rsp; > + if(isAccessor == SA_FALSE) { > + send_evt.info.imma.type = IMMA_EVT_ND2A_SEARCHNEXT_RSP; > + send_evt.info.imma.info.searchNextRsp = rsp; > + } else { > + send_evt.info.imma.type = IMMA_EVT_ND2A_ACCESSOR_GET_RSP; > + send_evt.info.imma.info.accessorGetRsp.attrValuesList = rsp->attrValuesList; > + immModel_deleteSearchOp(sn->searchOp); > + } > } else { /*err != SA_AIS_OK */ > send_evt.info.imma.type = IMMA_EVT_ND2A_IMM_ERROR; > send_evt.info.imma.info.errRsp.error = err; @@ -1047,6 +1068,26 @@ > void search_req_continue(IMMND_CB *cb, I > LOG_WA("Could not send reply to agent for search-next continuaton"); > } > > + if(isAccessor) { > + if(sn && cl_node) { > + IMMND_OM_SEARCH_NODE **prev = &(cl_node->searchOpList); > + IMMND_OM_SEARCH_NODE *n = cl_node->searchOpList; > + while(n) { > + if(n == sn) { > + *prev = n->next; > + break; > + } > + prev = &(n->next); > + n = n->next; > + } > + } > + if(sn) { > + if(sn->searchOp) > + immModel_deleteSearchOp(sn->searchOp); > + free(sn); > + } > + } > + > if (rsp) { > freeSearchNext(rsp, true); > } > @@ -1111,7 +1152,7 @@ static uint32_t immnd_evt_proc_oi_att_pu > reqo.attributeNames = evt->info.rtAttUpdRpl.sr.attributeNames; /*borrowing. */ > > TRACE_2("oi_att_pull_rpl Before searchInit"); > - err = immModel_searchInitialize(cb, &reqo, &searchOp, SA_FALSE); > + err = immModel_searchInitialize(cb, &reqo, &searchOp, SA_FALSE, > +SA_FALSE); > if (err == SA_AIS_OK) { > TRACE_2("oi_att_pull_rpl searchInit returned OK, calling searchNext"); > IMMSV_OM_RSP_SEARCH_NEXT *rsp = 0; @@ -1522,6 +1563,7 @@ static > uint32_t immnd_evt_proc_search_ne > } else { > send_evt.info.imma.type = IMMA_EVT_ND2A_IMM_ERROR; > send_evt.info.imma.info.errRsp.error = error; > + send_evt.info.imma.info.errRsp.errStrings = NULL; > } > > rc = immnd_mds_send_rsp(cb, sinfo, &send_evt); @@ -1633,6 +1675,306 > @@ static uint32_t immnd_evt_proc_search_fi > } > > > /********************************************************************* > ******* > + * Name : immnd_evt_proc_accessor_get > + * > + * Description : Function to process the saImmOmAccessorGet call. > + * Note that this is a read, local to the ND (does not go > + * over FEVS). > + * > + * Arguments : IMMND_CB *cb - IMMND CB pointer > + * IMMND_EVT *evt - Received Event structure > + * IMMSV_SEND_INFO *sinfo - sender info > + * > + * Return Values : NCSCC_RC_SUCCESS/Error. > + * > + * Notes : None. > + > +********************************************************************* > +********/ static uint32_t immnd_evt_proc_accessor_get(IMMND_CB *cb, > +IMMND_EVT *evt, IMMSV_SEND_INFO *sinfo) { > + IMMSV_EVT send_evt; > + uint32_t rc = NCSCC_RC_SUCCESS; > + SaAisErrorT error = SA_AIS_OK; > + void *searchOp = NULL; > + IMMND_IMM_CLIENT_NODE *cl_node = NULL; > + IMMND_IMM_CLIENT_NODE *oi_cl_node = NULL; > + SaImmOiHandleT implHandle = 0LL; > + IMMND_OM_SEARCH_NODE *sn = NULL; > + IMMSV_OM_SEARCH_INIT si; > + uint16_t searchOpCount=0; > + IMMSV_OM_RSP_SEARCH_NEXT *rsp = NULL; > + IMMSV_OM_RSP_SEARCH_NEXT *rsp1 = NULL; > + IMMSV_OM_RSP_SEARCH_NEXT **rspList = NULL; > + SaUint32T resultSize = 0; > + SaUint32T implConn = 0; > + SaUint32T implNodeId = 0; > + struct ImmsvAttrNameList *rtAttrsToFetch = NULL; > + MDS_DEST implDest = 0LL; > + SaBoolT retardSync = > + ((cb->fevs_replies_pending >= IMMSV_DEFAULT_FEVS_MAX_PENDING) && > + cb->mIsCoord && (cb->syncPid > 0)); > + > + > + TRACE_ENTER(); > + > +/* Search Init */ > + > + memset(&send_evt, 0, sizeof(IMMSV_EVT)); > + TRACE_2("ACCESSOR GET:%s", evt->info.accessorGet.objectName.buf); > + > + /*Look up client-node */ > + immnd_client_node_get(cb, evt->info.accessorGet.client_hdl, &cl_node); > + if (cl_node == NULL || cl_node->mIsStale) { > + LOG_WA("IMMND - Client Node Get Failed for cli_hdl"); > + TRACE_2("Client Node get failed for handle:%llu", evt->info.searchInit.client_hdl); > + error = SA_AIS_ERR_BAD_HANDLE; > + goto agent_init_rsp; > + } > + > + sn = cl_node->searchOpList; > + while(sn) { > + ++searchOpCount; > + sn = sn->next; > + } > + if(searchOpCount >= 5000) { > + LOG_WA("ERR_NO_RESOURCES: Too many search operations (%u) on OM handle -" > + " probable resource leak.", searchOpCount); > + error = SA_AIS_ERR_NO_RESOURCES; > + goto agent_init_rsp; > + } > + > + si.client_hdl = evt->info.accessorGet.client_hdl; > + si.rootName.buf = evt->info.accessorGet.objectName.buf; > + si.rootName.size = evt->info.accessorGet.objectName.size; > + si.scope = SA_IMM_ONE; > + si.searchParam.present = ImmOmSearchParameter_PR_NOTHING; > + si.attributeNames = evt->info.accessorGet.attributeNames; > + if(si.attributeNames && si.attributeNames->next == NULL && > + strncmp(si.attributeNames->name.buf, "SA_IMM_SEARCH_GET_CONFIG_ATTR", si.attributeNames->name.size) == 0) { > + si.searchOptions = SA_IMM_SEARCH_ONE_ATTR | SA_IMM_SEARCH_GET_CONFIG_ATTR; > + si.attributeNames = NULL; > + } else > + si.searchOptions = SA_IMM_SEARCH_ONE_ATTR | > + (si.attributeNames ? SA_IMM_SEARCH_GET_SOME_ATTR : > +SA_IMM_SEARCH_GET_ALL_ATTR); > + > + error = immModel_searchInitialize(cb, &si, &searchOp, SA_FALSE, > +SA_TRUE); > + > + if (error != SA_AIS_OK) > + goto agent_init_rsp; > + > + /*Generate search-id */ > + sn = calloc(1, sizeof(IMMND_OM_SEARCH_NODE)); > + if(sn == NULL) { > + error = SA_AIS_ERR_NO_MEMORY; > + goto agent_init_rsp; > + } > + > + sn->searchId = cb->cli_id_gen++; /* separate count for search */ > + if(cb->cli_id_gen == 0xffffffff) > + cb->cli_id_gen = 1; > + sn->searchOp = searchOp; /*TODO: wraparround */ > + sn->next = cl_node->searchOpList; > + cl_node->searchOpList = sn; > + > +/* Search Next */ > + > + error = immModel_nextResult(cb, sn->searchOp, &rsp, &implConn, &implNodeId, &rtAttrsToFetch, > + &implDest, retardSync); > + if (error != SA_AIS_OK) > + goto agent_next_rsp; > + > + /*Three cases: > + A) No runtime attributes to fetch. > + Reply directly with this call. > + B) Runtime attributes to fetch and the implementer is local. > + => (store continuation?) and call on implementer. > + C) Runtime attributes to fetch, but the implementer is remote > + => store continuation and use request remote invoc over > + either FEVS or direct adressing to peer ND. > + */ > + > + if (implNodeId) { /* Case B or C */ > + TRACE_2("There is an implementer and there are pure rt's !"); > + osafassert(rtAttrsToFetch); > + /*rsp kept in ImmSearchOp to be used in continuation. > + rtAttrsToFetch is expected to be deleted by this layer after used. > + > + rsp needs to be appended by the replies. > + ((attrsToFetch needs to be checked/matched when replies received.)) > + If the (non cached runtime) attribute is ALSO persistent, then > + the value should be stored (exactly as cached). The only difference > + with respect to officially cached is how the attribute is fetched. > + */ > + > + if (implConn) { > + TRACE_2("The implementer is local"); > + /*Case B Invoke rtUpdateCallback directly. */ > + osafassert(implNodeId == cb->node_id); > + send_evt.type = IMMSV_EVT_TYPE_IMMA; > + send_evt.info.imma.type = IMMA_EVT_ND2A_SEARCH_REMOTE; > + IMMSV_OM_SEARCH_REMOTE *rreq = &send_evt.info.imma.info.searchRemote; > + rreq->remoteNodeId = implNodeId; > + rreq->searchId = sn->searchId; > + rreq->requestNodeId = cb->node_id; /* NOTE: obsolete ? */ > + rreq->objectName = rsp->objectName; /* borrow objectName.buf */ > + rreq->attributeNames = rtAttrsToFetch; /* borrow this structure */ > + > + implHandle = m_IMMSV_PACK_HANDLE(implConn, implNodeId); > + /*Fetch client node for OI ! */ > + immnd_client_node_get(cb, implHandle, &oi_cl_node); > + if (oi_cl_node == NULL || oi_cl_node->mIsStale) { > + LOG_WA("ERR_NO_RESOURCES: SearchNext: Implementer died during fetch of pure RTA"); > + error = SA_AIS_ERR_NO_RESOURCES; > + goto agent_init_rsp; > + } else { > + rreq->client_hdl = implHandle; > + TRACE_2("MAKING OI-IMPLEMENTER rtUpdate upcall towards agent"); > + if (immnd_mds_msg_send(cb, NCSMDS_SVC_ID_IMMA_OI, > + oi_cl_node->agent_mds_dest, &send_evt) != NCSCC_RC_SUCCESS) { > + LOG_WA("ERR_NO_RESOURCES: SearchNext - Agent upcall over MDS for rtUpdate failed"); > + error = SA_AIS_ERR_NO_RESOURCES; > + goto agent_init_rsp; > + } > + } > + } else { > + TRACE_2("The implementer is remote"); > + /*Case C Send the message directly to nd where implementer resides. */ > + send_evt.type = IMMSV_EVT_TYPE_IMMND; > + send_evt.info.immnd.type = IMMND_EVT_ND2ND_SEARCH_REMOTE; > + IMMSV_OM_SEARCH_REMOTE *rreq = &send_evt.info.immnd.info.searchRemote; > + rreq->remoteNodeId = implNodeId; > + rreq->searchId = sn->searchId; > + rreq->requestNodeId = cb->node_id; /* NOTE: obsolete ? */ > + rreq->objectName = rsp->objectName; /* borrowed buf; */ > + rreq->attributeNames = rtAttrsToFetch; /* borrowed attrList */ > + > + TRACE_2("FORWARDING TO OTHER ND!"); > + > + rc = immnd_mds_msg_send(cb, NCSMDS_SVC_ID_IMMND, implDest, &send_evt); > + if (rc != NCSCC_RC_SUCCESS) { > + LOG_ER("ERR_NO_RESOURCES: SearchNext - Problem in sending to peer IMMND over MDS. Aborting searchNext."); > + error = SA_AIS_ERR_NO_RESOURCES; > + goto agent_init_rsp; > + } > + } > + > + /*Register request continuation ! */ > + SaInvocationT invoc = m_IMMSV_PACK_HANDLE(implNodeId, sn->searchId); > + SaUint32T clientId = > +m_IMMSV_UNPACK_HANDLE_HIGH(evt->info.searchOp.client_hdl); > + > + TRACE_2("SETTING SEARCH REQ CONTINUATION FOR %u|%x->%u", > +sn->searchId, implNodeId, clientId); > + > + immModel_setSearchReqContinuation(cb, invoc, clientId); > + > + cl_node->tmpSinfo = *sinfo; //TODO should be part of continuation? > + > + osafassert(error == SA_AIS_OK); > + if (rtAttrsToFetch) { > + immsv_evt_free_attrNames(rtAttrsToFetch); > + } > + TRACE_LEAVE(); > + return NCSCC_RC_SUCCESS; > + } else if(!rtAttrsToFetch) { /*Case A */ > + IMMSV_ATTR_NAME_LIST *rtAttrs; > + SaAisErrorT err; > + SaBoolT bRtAttrs; > + uint32_t size = search_result_size(rsp); > + resultSize = 1; > + > + /* Repeat to the maximum search result, > + * or the size os search results becomes bigger then IMMND_SEARCH_BUNDLE_SIZE, > + * or till the object with at least one pure runtime attribute */ > + while(resultSize < IMMND_MAX_SEARCH_RESULT && size < IMMND_SEARCH_BUNDLE_SIZE) { > + err = immModel_testTopResult(sn->searchOp, &implNodeId, &bRtAttrs); > + if ((err != SA_AIS_OK) || (bRtAttrs == SA_TRUE)) > + break; > + > + err = immModel_nextResult(cb, sn->searchOp, &rsp1, &implConn, &implNodeId, &rtAttrs, > + &implDest, retardSync); > + if(err != SA_AIS_OK) { > + osafassert(err == SA_AIS_ERR_NOT_EXIST); > + break; > + } > + > + if(resultSize == 1) { > + rspList = (IMMSV_OM_RSP_SEARCH_NEXT **)calloc(IMMND_MAX_SEARCH_RESULT, sizeof(IMMSV_OM_RSP_SEARCH_NEXT *)); > + rspList[0] = rsp; > + rsp = NULL; > + } > + > + rspList[resultSize++] = rsp1; > + > + size += search_result_size(rsp1); > + } > + > + immModel_clearLastResult(sn->searchOp); > + } > + > + agent_next_rsp: > + > + if (error == SA_AIS_OK) { > + if(resultSize == 1) { > + send_evt.type = IMMSV_EVT_TYPE_IMMA; > + send_evt.info.imma.type = IMMA_EVT_ND2A_ACCESSOR_GET_RSP; > + send_evt.info.imma.info.accessorGetRsp.attrValuesList = rsp->attrValuesList; > + } else > + error = SA_AIS_ERR_INVALID_PARAM; > + } > + > + agent_init_rsp: > + > + if (error != SA_AIS_OK) { > + send_evt.type = IMMSV_EVT_TYPE_IMMA; > + send_evt.info.imma.type = IMMA_EVT_ND2A_IMM_ERROR; > + send_evt.info.imma.info.errRsp.error = error; > + send_evt.info.imma.info.errRsp.errStrings = NULL; > + } > + > + rc = immnd_mds_send_rsp(cb, sinfo, &send_evt); > + > + if(rsp) > + freeSearchNext(rsp, true); > + > + if(rspList) { > + int ix; > + for(ix=0; ix<IMMND_MAX_SEARCH_RESULT; ix++) { > + if(rspList[ix]) { > + freeSearchNext(rspList[ix], true); > + } > + } > + free(rspList); > + > + immModel_clearLastResult(sn->searchOp); > + } > + > + if (rtAttrsToFetch) { > + immsv_evt_free_attrNames(rtAttrsToFetch); > + } > + > + if(sn && cl_node) { > + IMMND_OM_SEARCH_NODE **prev = &(cl_node->searchOpList); > + IMMND_OM_SEARCH_NODE *n = cl_node->searchOpList; > + while(n) { > + if(n == sn) { > + *prev = n->next; > + break; > + } > + prev = &(n->next); > + n = n->next; > + } > + } > + > + if(searchOp) > + immModel_deleteSearchOp(searchOp); > + > + if(sn) > + free(sn); > + > + TRACE_LEAVE(); > + > + return rc; > +} > + > +/******************************************************************** > +******** > * Name : immnd_evt_proc_class_desc_get > * > * Description : Function to process the SaImmOmClassDescriptionGet call. > diff --git a/osaf/services/saf/immsv/immnd/immnd_init.h > b/osaf/services/saf/immsv/immnd/immnd_init.h > --- a/osaf/services/saf/immsv/immnd/immnd_init.h > +++ b/osaf/services/saf/immsv/immnd/immnd_init.h > @@ -188,7 +188,7 @@ extern "C" { > SaBoolT immModel_ccbCommit(IMMND_CB *cb, SaUint32T ccbId, SaUint32T *arrSize, SaUint32T **implConnArr); > SaAisErrorT immModel_ccbFinalize(IMMND_CB *cb, SaUint32T ccbId); > > - SaAisErrorT immModel_searchInitialize(IMMND_CB *cb, struct ImmsvOmSearchInit *req, void **searchOp, SaBoolT isSync); > + SaAisErrorT immModel_searchInitialize(IMMND_CB *cb, struct > +ImmsvOmSearchInit *req, void **searchOp, SaBoolT isSync, SaBoolT > +isAccessor); > > SaAisErrorT immModel_testTopResult(void *searchOp, SaUint32T > *implNodeId, SaBoolT *bRtAttrsToFetch); > > @@ -204,6 +204,8 @@ extern "C" { > > void immModel_fetchLastResult(void *searchOp, > IMMSV_OM_RSP_SEARCH_NEXT **rsp); > > + SaBoolT immModel_isSearchOpAccessor(void* searchOp); > + > void immModel_setAdmReqContinuation(IMMND_CB *cb, SaInvocationT > invoc, SaUint32T reqCon); > > void immModel_setSearchReqContinuation(IMMND_CB *cb, SaInvocationT > invoc, SaUint32T reqCon); ------------------------------------------------------------------------------ Own the Future-Intel® Level Up Game Demo Contest 2013 Rise to greatness in Intel's independent game demo contest. Compete for recognition, cash, and the chance to get your game on Steam. $5K grand prize plus 10 genre and skill prizes. Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d _______________________________________________ Opensaf-devel mailing list Ope...@li... https://lists.sourceforge.net/lists/listinfo/opensaf-devel |
From: OpenSAF T. <tr...@de...> - 2013-04-02 07:43:43
|
#3086: immsv: Applier crashes in MDS thread due to incorrect OI handle state. closed defect --------------------------------------------------------------------- Reporter: anders Owner: anders Priority: minor Milestone: 4.2.3 Component: saf/immsv Version: 4.2.2 --------------------------------------------------------------------- Changes (by anders): * Status from 'accepted' to 'closed' * Resolution from 'None' to 'fixed' * Patch_waiting from 'yes' to 'no' --------------------------------------------------------------------- Comment: opensaf-4.2.x: changeset: 4138:0a386543a31e branch: opensaf-4.2.x parent: 4135:a098c8f62293 user: Anders Bjornerstedt <and...@er...> date: Wed Mar 27 10:35:51 2013 +0100 summary: immsv: saImmOiImplementerSet returns INVALID_PARAM on interface violation (#3086) changeset: 4139:d31bb160e619 branch: opensaf-4.2.x tag: tip user: Anders Bjornerstedt <and...@er...> date: Wed Mar 27 11:10:11 2013 +0100 summary: tests/safimm: Update immoitest 2 4 to expect ERR_INVALID_PARAM (#3086) ----------------------------------------------------------------------------------- opensaf-4.3.x: changeset: 4140:f6f0570ef0ff branch: opensaf-4.3.x parent: 4136:7285b0e11830 user: Anders Bjornerstedt <and...@er...> date: Wed Mar 27 10:35:51 2013 +0100 summary: immsv: saImmOiImplementerSet returns INVALID_PARAM on interface violation (#3086) changeset: 4141:fc185ca61c0f branch: opensaf-4.3.x tag: tip user: Anders Bjornerstedt <and...@er...> date: Wed Mar 27 11:10:11 2013 +0100 summary: tests/safimm: Update immoitest 2 4 to expect ERR_INVALID_PARAM (#3086) ------------------------------------------------------------------------------------ default (4.4): f6f0570ef0ff transplanted to b5ad093780d8 fc185ca61c0f transplanted to 3cf6822101aa changeset: 4142:b5ad093780d8 parent: 4137:96ee9aa963d8 user: Anders Bjornerstedt <and...@er...> date: Wed Mar 27 10:35:51 2013 +0100 summary: immsv: saImmOiImplementerSet returns INVALID_PARAM on interface violation (#3086) changeset: 4143:3cf6822101aa tag: tip user: Anders Bjornerstedt <and...@er...> date: Wed Mar 27 11:10:11 2013 +0100 summary: tests/safimm: Update immoitest 2 4 to expect ERR_INVALID_PARAM (#3086) -- Ticket URL: <URL:http://devel.opensaf.org/ticket/3086> OpenSAF <URL:http://devel.opensaf.org/> Open Source High Availability Middleware Based on the SA Forum Specifications |
From: Neelakanta R. <red...@or...> - 2013-04-01 15:56:41
|
Hi Zoran, Reviewed and tested the patch. Ack. Neel. On Wednesday 27 March 2013 03:53 PM, Zoran Milinkovic wrote: > osaf/libs/agents/saf/imma/imma_om_api.c | 340 +++++++++++++++++----- > osaf/libs/common/immsv/immsv_evt.c | 93 ++++++ > osaf/libs/common/immsv/include/immsv_evt.h | 5 + > osaf/libs/common/immsv/include/immsv_evt_model.h | 10 + > osaf/services/saf/immsv/immnd/ImmModel.cc | 14 +- > osaf/services/saf/immsv/immnd/ImmSearchOp.cc | 1 + > osaf/services/saf/immsv/immnd/ImmSearchOp.hh | 3 + > osaf/services/saf/immsv/immnd/immnd_evt.c | 350 ++++++++++++++++++++++- > osaf/services/saf/immsv/immnd/immnd_init.h | 4 +- > 9 files changed, 734 insertions(+), 86 deletions(-) > > > The redesign of object access functions increases the preformance of saImmOmAccessorGet and reduce the number of calls from client side to server side. > > diff --git a/osaf/libs/agents/saf/imma/imma_om_api.c b/osaf/libs/agents/saf/imma/imma_om_api.c > --- a/osaf/libs/agents/saf/imma/imma_om_api.c > +++ b/osaf/libs/agents/saf/imma/imma_om_api.c > @@ -5069,6 +5069,7 @@ SaAisErrorT saImmOmAccessorInitialize(Sa > > search_node->search_hdl = (SaImmSearchHandleT)m_NCS_GET_TIME_NS; > search_node->mImmHandle = immHandle; > + search_node->mSearchId = 0xffffffff; /* 0xffffffff for accessorGet */ > /*This is the external handle that the application uses. > Internally we use the searchId provided by the Node Director. */ > > @@ -5110,6 +5111,7 @@ SaAisErrorT saImmOmAccessorFinalize(SaIm > IMMA_SEARCH_NODE *search_node = NULL; > IMMA_CLIENT_NODE *cl_node = NULL; > uint32_t proc_rc = NCSCC_RC_SUCCESS; > + SaImmHandleT immHandle; > TRACE_ENTER(); > > if (cb->sv_id == 0) { > @@ -5128,37 +5130,33 @@ SaAisErrorT saImmOmAccessorFinalize(SaIm > > imma_search_node_get(&cb->search_tree, &accessorHandle, &search_node); > > - if (!search_node) { > + if (!search_node || search_node->mSearchId != 0xffffffff) { > TRACE_2("ERR_BAD_HANDLE: Search node is missing"); > rc = SA_AIS_ERR_BAD_HANDLE; > goto release_lock; > } > > - if (search_node->mSearchId) { > - /*Finalize as a searchHandle */ > - m_NCS_UNLOCK(&cb->cb_lock, NCS_LOCK_WRITE); > - locked = false; > - /*NOTE: We return directly in the next statement. */ > - return saImmOmSearchFinalize((SaImmSearchHandleT)accessorHandle); > - > + if (search_node->mLastAttributes) { > + imma_freeSearchAttrs((SaImmAttrValuesT_2 **)search_node->mLastAttributes); > + search_node->mLastAttributes = NULL; > + } > + > + immHandle = search_node->mImmHandle; > + /*Search handle was apparently never used, just remove the node. */ > + proc_rc = imma_search_node_delete(cb, search_node); > + search_node = NULL; > + if (proc_rc != NCSCC_RC_SUCCESS) { > + TRACE_4("ERR_LIBRARY: Could not delete search node"); > + rc = SA_AIS_ERR_LIBRARY; > } else { > - SaImmHandleT immHandle = search_node->mImmHandle; > - /*Search handle was apparently never used, just remove the node. */ > - proc_rc = imma_search_node_delete(cb, search_node); > - search_node = NULL; > - if (proc_rc != NCSCC_RC_SUCCESS) { > - TRACE_4("ERR_LIBRARY: Could not delete search node"); > + /* Decrease number of search handles per IMM handle */ > + imma_client_node_get(&cb->client_tree, &immHandle, &cl_node); > + if (cl_node && cl_node->isOm) { /* TODO: Is osafassert(cl_node && cl_node->isOm) better solution */ > + osafassert(cl_node->searchHandleSize); > + cl_node->searchHandleSize--; > + } else { > + TRACE_2("ERR_LIBRARY: Invalid SaImmHandleT related to search handle"); > rc = SA_AIS_ERR_LIBRARY; > - } else { > - /* Decrease number of search handles per IMM handle */ > - imma_client_node_get(&cb->client_tree, &immHandle, &cl_node); > - if (cl_node && cl_node->isOm) { /* TODO: Is osafassert(cl_node && cl_node->isOm) better solution */ > - osafassert(cl_node->searchHandleSize); > - cl_node->searchHandleSize--; > - } else { > - TRACE_2("ERR_LIBRARY: Invalid SaImmHandleT related to search handle"); > - rc = SA_AIS_ERR_LIBRARY; > - } > } > } > > @@ -5177,25 +5175,40 @@ SaAisErrorT saImmOmAccessorGet_2(SaImmAc > const SaImmAttrNameT *attributeNames, SaImmAttrValuesT_2 ***attributes) > { > SaAisErrorT rc = SA_AIS_OK; > + uint32_t proc_rc; > bool locked = true; > IMMA_CB *cb = &imma_cb; > + IMMA_CLIENT_NODE *cl_node = NULL; > IMMA_SEARCH_NODE *search_node = NULL; > - SaNameT redundantName; > - SaImmAttrValuesT_2 **attributeList = NULL; > + IMMSV_EVT evt; > + IMMSV_EVT *out_evt = NULL; > + SaUint32T timeout; > + SaImmSearchHandleT tmpSearchHandle; > + > + TRACE_ENTER(); > > if (cb->sv_id == 0) { > TRACE_2("ERR_BAD_HANDLE: No initialized handle exists!"); > + TRACE_LEAVE(); > return SA_AIS_ERR_BAD_HANDLE; > } > > + if (cb->is_immnd_up == false) { > + TRACE_3("ERR_TRY_AGAIN: IMMND is DOWN"); > + TRACE_LEAVE(); > + return SA_AIS_ERR_TRY_AGAIN; > + } > + > if ((objectName == NULL) || (objectName->length == 0) || (objectName->length >= SA_MAX_NAME_LENGTH)) { > TRACE_2("ERR_INVALID_PARAM: Incorrect parameter contents: objectName"); > + TRACE_LEAVE(); > return SA_AIS_ERR_INVALID_PARAM; > } > > /* Skip the case when attributeNames[0] == NULL and attributes == NULL (#2166) */ > if (!attributes && (!attributeNames || attributeNames[0])) { > TRACE_2("ERR_INVALID_PARAM: attributes is NULL"); > + TRACE_LEAVE(); > return SA_AIS_ERR_INVALID_PARAM; > } > > @@ -5215,74 +5228,245 @@ SaAisErrorT saImmOmAccessorGet_2(SaImmAc > goto release_lock; > } > > + if(search_node->mSearchId != 0xffffffff) { > + rc = SA_AIS_ERR_BAD_HANDLE; > + TRACE_4("ERR_BAD_HANDLE: Search handle is not accessory object handle"); > + goto release_lock; > + } > + > SaImmHandleT immHandle = search_node->mImmHandle; > > - /* Stale check etc done in searchInit & searchNext below. */ > - > - /* Release locks and cb for normal cases as it uses SearchInit & > + imma_client_node_get(&cb->client_tree, &immHandle, &cl_node); > + if (!(cl_node && cl_node->isOm)) { > + TRACE_2("ERR_BAD_HANDLE: Client node is missing"); > + rc = SA_AIS_ERR_BAD_HANDLE; > + goto release_lock; > + } > + > + if (cl_node->stale) { > + TRACE_1("IMM Handle %llx is stale", immHandle); > + bool resurrected = imma_om_resurrect(cb, cl_node, &locked); > + cl_node = NULL; > + > + if (!locked && m_NCS_LOCK(&cb->cb_lock, NCS_LOCK_WRITE) != NCSCC_RC_SUCCESS) { > + TRACE_4("ERR_LIBRARY: Lock failed"); > + rc = SA_AIS_ERR_LIBRARY; > + goto release_cb; > + } > + locked = true; > + > + imma_client_node_get(&cb->client_tree, &immHandle, &cl_node); > + > + if (!resurrected || !cl_node || !(cl_node->isOm) || cl_node->stale) { > + TRACE_3("ERR_BAD_HANDLE: Reactive ressurect of handle %llx failed", immHandle); > + if (cl_node && cl_node->stale) {cl_node->exposed = true;} > + rc = SA_AIS_ERR_BAD_HANDLE; > + goto release_lock; > + } > + > + TRACE_1("Reactive resurrect of handle %llx succeeded", immHandle); > + } > + > + if((rc = imma_proc_increment_pending_reply(cl_node, true)) != SA_AIS_OK) { > + TRACE_4("ERR_LIBRARY: Overlapping use of IMM handle by multiple threads"); > + goto release_lock; > + } > + > + memset(&evt, 0, sizeof(IMMSV_EVT)); > + evt.type = IMMSV_EVT_TYPE_IMMND; > + evt.info.immnd.type = IMMND_EVT_A2ND_ACCESSOR_GET; > + IMMSV_OM_ACCESSOR_GET *req = &(evt.info.immnd.info.accessorGet); > + req->client_hdl = immHandle; > + req->objectName.size = strlen((char *)objectName->value) + 1; > + if(objectName->length + 1 < req->objectName.size) > + req->objectName.size = objectName->length + 1; > + req->objectName.buf = malloc(req->objectName.size); /* alloc-1 */ > + strncpy(req->objectName.buf, (char *)objectName->value, (size_t)req->objectName.size); > + req->objectName.buf[req->objectName.size - 1] = 0; > + > + req->attributeNames = NULL; > + if(attributeNames) { > + const SaImmAttrNameT *namev; > + for (namev = attributeNames; *namev; namev++) { > + IMMSV_ATTR_NAME_LIST *p = (IMMSV_ATTR_NAME_LIST *) > + malloc(sizeof(IMMSV_ATTR_NAME_LIST)); /* alloc-2 */ > + p->name.size = strlen(*namev) + 1; > + p->name.buf = malloc(p->name.size); /* alloc-3 */ > + strncpy(p->name.buf, *namev, p->name.size); > + p->name.buf[p->name.size - 1] = 0; > + > + p->next = req->attributeNames; /*NULL in first iteration */ > + req->attributeNames = p; > + } > + } > + > + tmpSearchHandle = search_node->search_hdl; > + timeout = cl_node->syncr_timeout; > + > + /* Release locks and cb for normal cases as it uses SearchInit & > SearchNext. > */ > m_NCS_UNLOCK(&cb->cb_lock, NCS_LOCK_WRITE); > locked = false; > > - /*The accessorHandle is actually just a searchhandle in this > - implementation. > - SaImmSearchHandleT searchHandle = (SaImmSearchHandleT) accessorHandle; > - */ > - > - if (search_node->mSearchId) { /* TODO: Use of search_node not safe (unlocked) */ > - TRACE("Closing previous allocation :%u\n", search_node->mSearchId); > - > - /*Perform a search-next, simply to discard any previous allocation. */ > - /*Cant do a searchFinalize since that will discard the node. */ > - > - redundantName.length = 0; > - m_IMMSV_SET_SANAMET((&redundantName)); > - > - rc = saImmOmSearchNext_2(accessorHandle, &redundantName, &attributeList); > - > - if (rc != SA_AIS_ERR_NOT_EXIST && rc != SA_AIS_ERR_BAD_HANDLE) { > - TRACE_4("ERR_LIBRARY: Unexpected return code from internal searchNext: %u", rc); > - return SA_AIS_ERR_LIBRARY; /*No handles to close here. */ > - } > - > - /* Close the previous search id. > - Cant use saImmOmSearchfinalize, because this will also close the > - search handle and deallocate the search_node. > - */ > - > - /* NOTE/TODO: Should Send a ImmOmSearchFinalize message to IMMND !! > - This to discard the search on the server side. See searchFinalize. */ > - search_node->mSearchId = 0; > - } > - > - rc = saImmOmSearchInitialize_2(immHandle, objectName, /*root == object */ > - SA_IMM_ONE, /* Normally illegal in search */ > - 0, NULL, attributeNames, &accessorHandle); > - > - if (rc != SA_AIS_OK) { > - search_node->mSearchId = 0; > - return rc; > - } > - > - redundantName.length = 0; > - m_IMMSV_SET_SANAMET((&redundantName)); > - rc = saImmOmSearchNext_2(accessorHandle, &redundantName, &attributeList); > - if(attributes) > - *attributes = attributeList; > - return rc; > + /* IMMND GOES DOWN */ > + if (cb->is_immnd_up == false) { > + rc = SA_AIS_ERR_TRY_AGAIN; > + TRACE_3("ERR_TRY_AGAIN: IMMND is DOWN"); > + goto mds_send_fail; > + } > + > + /* send the request to the IMMND */ > + proc_rc = imma_mds_msg_sync_send(cb->imma_mds_hdl, &cb->immnd_mds_dest, &evt, &out_evt, timeout); > + > + switch(proc_rc) { > + case NCSCC_RC_SUCCESS: > + break; > + > + case NCSCC_RC_REQ_TIMOUT: > + rc = imma_proc_check_stale(cb, immHandle, SA_AIS_ERR_TIMEOUT); > + goto mds_send_fail; > + > + default: > + rc = SA_AIS_ERR_LIBRARY; > + TRACE_4("ERR_LIBRARY: MDS returned unexpected error code %u", proc_rc); > + goto mds_send_fail; > + } > + > + if (search_node->mLastAttributes) { > + imma_freeSearchAttrs((SaImmAttrValuesT_2 **)search_node->mLastAttributes); > + search_node->mLastAttributes = NULL; > + } > + > + if(out_evt) { > + osafassert(out_evt->type == IMMSV_EVT_TYPE_IMMA); > + if (out_evt->info.imma.type == IMMA_EVT_ND2A_IMM_ERROR) { > + rc = out_evt->info.imma.info.errRsp.error; > + osafassert(rc && (rc != SA_AIS_OK)); > + free(out_evt); /*BUGFIX (leak) 090506 */ > + out_evt = NULL; > + goto mds_send_fail; > + } > + > + osafassert(out_evt->info.imma.type == IMMA_EVT_ND2A_ACCESSOR_GET_RSP); > + > + if(attributes) { > + int noOfAttributes = 0; > + int i = 0; > + IMMSV_ATTR_VALUES_LIST *p; > + IMMSV_ATTR_VALUES_LIST *attrValueList; > + SaImmAttrValuesT_2 **attr; > + > + attrValueList = out_evt->info.imma.info.accessorGetRsp.attrValuesList; > + > + p = attrValueList; > + while(p) { > + noOfAttributes++; > + p = p->next; > + } > + > + p = attrValueList; > + attr = calloc(noOfAttributes + 1, sizeof(SaImmAttrValuesT_2 *)); /* alloc-1 */ > + for(i=0; i<noOfAttributes; i++, p = p->next) { > + IMMSV_ATTR_VALUES *q = &(p->n); > + attr[i] = calloc(1, sizeof(SaImmAttrValuesT_2)); /* alloc-2 */ > + attr[i]->attrName = malloc(q->attrName.size + 1); /* alloc-3 */ > + strncpy(attr[i]->attrName, (const char *)q->attrName.buf, q->attrName.size + 1); > + attr[i]->attrName[q->attrName.size] = 0; /*redundant. */ > + attr[i]->attrValuesNumber = q->attrValuesNumber; > + attr[i]->attrValueType = (SaImmValueTypeT)q->attrValueType; > + > + if (q->attrValuesNumber) { > + attr[i]->attrValues = calloc(1, q->attrValuesNumber * sizeof(SaImmAttrValueT)); /*alloc-4 */ > + /*alloc-5 */ > + attr[i]->attrValues[0] = imma_copyAttrValue3(q->attrValueType, &(q->attrValue)); > + > + if (q->attrValuesNumber > 1) { > + int ix; > + IMMSV_EDU_ATTR_VAL_LIST *r = q->attrMoreValues; > + for (ix = 1; ix < q->attrValuesNumber; ++ix) { > + osafassert(r); > + attr[i]->attrValues[ix] = imma_copyAttrValue3(q->attrValueType, &(r->n)); /*alloc-5 */ > + r = r->next; > + } > + } > + } > + } > + *attributes = attr; > + search_node->mLastAttributes = attr; > + } > + } else { > + TRACE_4("ERR_LIBRARY: Empty return message from IMMND"); > + rc = SA_AIS_ERR_LIBRARY; > + } > + > +mds_send_fail: > + > + if(req->objectName.buf) { > + free(req->objectName.buf); /* free-1 */ > + req->objectName.buf = NULL; > + req->objectName.size = 0; > + } > + if (req->attributeNames) { > + immsv_evt_free_attrNames(req->attributeNames); /* free-2 and free-3 */ > + req->attributeNames = NULL; > + } > + > + if (m_NCS_LOCK(&cb->cb_lock, NCS_LOCK_WRITE) != NCSCC_RC_SUCCESS) { > + rc = SA_AIS_ERR_LIBRARY; > + TRACE_4("ERR_LIBRARY: Lock error"); > + goto release_cb; > + } > + locked = true; > + > + imma_client_node_get(&cb->client_tree, &immHandle, &cl_node); > + if (!(cl_node && cl_node->isOm)) { > + TRACE_3("ERR_BAD_HANDLE: Client node is gone after down call"); > + rc = SA_AIS_ERR_BAD_HANDLE; > + goto release_lock; > + } > + > + imma_proc_decrement_pending_reply(cl_node, true); > + > + imma_search_node_get(&cb->search_tree, &tmpSearchHandle, &search_node); > + if ((!search_node) || (search_node->mImmHandle != immHandle)) { > + TRACE_3("ERR_BAD_HANDLE: Search node is missing after down call"); > + rc = SA_AIS_ERR_BAD_HANDLE; > + goto release_lock; > + } > + > + if (cl_node->stale) { > + if (isExposed(cb, cl_node)) { > + TRACE_2("ERR_BAD_HANDLE: client is stale after down call and exposed"); > + rc = SA_AIS_ERR_BAD_HANDLE; > + } else { > + TRACE_2("ERR_TRY_AGAIN: Handle %llx is stale after down call but " > + "possible to resurrect", immHandle); > + /* Can override BAD_HANDLE/TIMEOUT set in check_stale */ > + rc = SA_AIS_ERR_TRY_AGAIN; > + } > + } > > /*error cases only */ > - release_lock: > +release_lock: > if (locked) { > m_NCS_UNLOCK(&cb->cb_lock, NCS_LOCK_WRITE); > } > > - release_cb: > - > + if(out_evt) { > + if(out_evt->info.imma.info.accessorGetRsp.attrValuesList) { > + immsv_free_attrvalues_list(out_evt->info.imma.info.accessorGetRsp.attrValuesList); > + } > + > + free(out_evt); > + } > + > +release_cb: > + TRACE_LEAVE(); > return rc; > } > > + > static unsigned int get_att_val_size(IMMSV_EDU_ATTR_VAL *p, SaImmValueTypeT t) > { > switch (t) { > diff --git a/osaf/libs/common/immsv/immsv_evt.c b/osaf/libs/common/immsv/immsv_evt.c > --- a/osaf/libs/common/immsv/immsv_evt.c > +++ b/osaf/libs/common/immsv/immsv_evt.c > @@ -168,6 +168,7 @@ static const char *immnd_evt_names[] = { > "IMMND_EVT_A2ND_OI_CCB_AUG_INIT", > "IMMND_EVT_A2ND_AUG_ADMO", > "IMMND_EVT_A2ND_CL_TIMEOUT", > + "IMMND_EVT_A2ND_ACCESSOR_GET", > "undefined (high)" > }; > > @@ -1379,6 +1380,28 @@ static uint32_t immsv_evt_enc_sublevels( > else > { No attrValues } > */ > + } else if (i_evt->info.imma.type == IMMA_EVT_ND2A_ACCESSOR_GET_RSP) { > + uint8_t *p8; > + int depth = 0; > + /*Encode searchNext response */ > + IMMSV_OM_RSP_ACCESSOR_GET *ag = &(i_evt->info.imma.info.accessorGetRsp); > + > + IMMSV_RSRV_SPACE_ASSERT(p8, o_ub, 1); > + ncs_encode_8bit(&p8, (ag->attrValuesList) ? 1 : 0); > + ncs_enc_claim_space(o_ub, 1); > + > + if (ag->attrValuesList) { > + IMMSV_ATTR_VALUES_LIST *al = ag->attrValuesList; > + do { > + immsv_evt_enc_attribute(o_ub, al); > + al = al->next; > + ++depth; > + } while (al && (depth < IMMSV_MAX_ATTRIBUTES)); > + if (depth >= IMMSV_MAX_ATTRIBUTES) { > + LOG_ER("Search next: TOO MANY ATTR DEFS line:%u", __LINE__); > + return NCSCC_RC_OUT_OF_MEM; > + } > + } > } else if (i_evt->info.imma.type == IMMA_EVT_ND2A_OI_OBJ_CREATE_UC) { > int depth = 0; > /*Encode the className */ > @@ -1858,6 +1881,25 @@ static uint32_t immsv_evt_enc_sublevels( > return NCSCC_RC_OUT_OF_MEM; > } > > + } else if (i_evt->info.immnd.type == IMMND_EVT_A2ND_ACCESSOR_GET) { > + int depth = 0; > + > + IMMSV_OCTET_STRING *objectName = &(i_evt->info.immnd.info.accessorGet.objectName); > + if (!immsv_evt_enc_inline_text(__LINE__, o_ub, objectName)) { > + return NCSCC_RC_OUT_OF_MEM; > + } > + > + IMMSV_ATTR_NAME_LIST *attr = i_evt->info.immnd.info.accessorGet.attributeNames; > + while(attr && (depth < IMMSV_MAX_ATTRIBUTES)) { > + immsv_evt_enc_attrName(o_ub, attr); > + attr = attr->next; > + ++depth; > + } > + > + if (depth >= IMMSV_MAX_ATTRIBUTES) { > + LOG_ER("TOO MANY attribute names line:%u", __LINE__); > + return NCSCC_RC_OUT_OF_MEM; > + } > } else if (i_evt->info.immnd.type == IMMND_EVT_A2ND_RT_ATT_UPPD_RSP) { > int depth = 0; > /*Encode the objectName */ > @@ -2042,6 +2084,25 @@ static uint32_t immsv_evt_dec_sublevels( > } else { > o_evt->info.imma.info.searchNextRsp->attrValuesList = NULL; > } > + } else if (o_evt->info.imma.type == IMMA_EVT_ND2A_ACCESSOR_GET_RSP) { > + uint8_t *p8; > + uint8_t c8; > + uint8_t local_data[8]; > + > + /*Decode accessorGet Response */ > + IMMSV_OM_RSP_ACCESSOR_GET *ag = &(o_evt->info.imma.info.accessorGetRsp); > + > + IMMSV_FLTN_SPACE_ASSERT(p8, local_data, i_ub, 1); > + c8 = ncs_decode_8bit(&p8); > + ncs_dec_skip_space(i_ub, 1); > + if (c8) { > + /*Decode the list of attributes */ > + IMMSV_ATTR_VALUES_LIST *p = NULL; > + immsv_evt_dec_attributes(i_ub, &p); > + ag->attrValuesList = p; > + } else { > + ag->attrValuesList = NULL; > + } > } else if (o_evt->info.imma.type == IMMA_EVT_ND2A_OI_OBJ_CREATE_UC) { > /*Decode the className */ > IMMSV_OCTET_STRING *os = &(o_evt->info.imma.info.objCreate.className); > @@ -2373,6 +2434,18 @@ static uint32_t immsv_evt_dec_sublevels( > immsv_evt_dec_attrNames(i_ub, &p); > o_evt->info.immnd.info.searchInit.attributeNames = p; > } > + } else if (o_evt->info.immnd.type == IMMND_EVT_A2ND_ACCESSOR_GET) { > + IMMSV_OCTET_STRING *os = &(o_evt->info.immnd.info.accessorGet.objectName); > + if (os->size) { > + immsv_evt_dec_inline_string(i_ub, os); > + } else > + os->buf = NULL; > + > + IMMSV_ATTR_NAME_LIST *p = o_evt->info.immnd.info.accessorGet.attributeNames; > + if (p) { > + immsv_evt_dec_attrNames(i_ub, &p); > + o_evt->info.immnd.info.accessorGet.attributeNames = p; > + } > } else if (o_evt->info.immnd.type == IMMND_EVT_A2ND_RT_ATT_UPPD_RSP) { > /*Decode the objectName */ > IMMSV_OCTET_STRING *os = &(o_evt->info.immnd.info.rtAttUpdRpl.sr.objectName); > @@ -2639,6 +2712,10 @@ static uint32_t immsv_evt_enc_toplevel(I > /*Totaly encoded in sublevel. */ > break; > > + case IMMA_EVT_ND2A_ACCESSOR_GET_RSP: //Response from for AccessorGet > + /*Totaly encoded in sublevel. */ > + break; > + > case IMMA_EVT_ND2A_SEARCH_REMOTE: //Fetch pure runtime attributes. > IMMSV_RSRV_SPACE_ASSERT(p8, o_ub, 8); > ncs_encode_64bit(&p8, immaevt->info.searchRemote.client_hdl); > @@ -3125,6 +3202,12 @@ static uint32_t immsv_evt_enc_toplevel(I > case IMMND_EVT_A2ND_SEARCH_REMOTE: > */ > > + case IMMND_EVT_A2ND_ACCESSOR_GET: /* AccessorGet */ > + IMMSV_RSRV_SPACE_ASSERT(p8, o_ub, 8); > + ncs_encode_64bit(&p8, immndevt->info.accessorGet.client_hdl); > + ncs_enc_claim_space(o_ub, 8); > + break; > + > case IMMND_EVT_A2ND_RT_ATT_UPPD_RSP: /* reply for fetch of rt attr vals */ > IMMSV_RSRV_SPACE_ASSERT(p8, o_ub, 8); > ncs_encode_64bit(&p8, immndevt->info.rtAttUpdRpl.sr.client_hdl); > @@ -3896,6 +3979,10 @@ static uint32_t immsv_evt_dec_toplevel(N > /*Totaly decoded in sublevel. */ > break; > > + case IMMA_EVT_ND2A_ACCESSOR_GET_RSP: //Response from for AccessorGet > + /*Totaly decoded in sublevel. */ > + break; > + > case IMMA_EVT_ND2A_SEARCH_REMOTE: //Fetch pure runtime attributes. > IMMSV_FLTN_SPACE_ASSERT(p8, local_data, i_ub, 8); > immaevt->info.searchRemote.client_hdl = ncs_decode_64bit(&p8); > @@ -4399,6 +4486,12 @@ static uint32_t immsv_evt_dec_toplevel(N > case IMMND_EVT_A2ND_SEARCH_REMOTE: > */ > > + case IMMND_EVT_A2ND_ACCESSOR_GET: /* AccessorGet */ > + IMMSV_FLTN_SPACE_ASSERT(p8, local_data, i_ub, 8); > + immndevt->info.accessorGet.client_hdl = ncs_decode_64bit(&p8); > + ncs_dec_skip_space(i_ub, 8); > + break; > + > case IMMND_EVT_A2ND_RT_ATT_UPPD_RSP: /* reply for fetch of rt attr vals */ > IMMSV_FLTN_SPACE_ASSERT(p8, local_data, i_ub, 8); > immndevt->info.rtAttUpdRpl.sr.client_hdl = ncs_decode_64bit(&p8); > diff --git a/osaf/libs/common/immsv/include/immsv_evt.h b/osaf/libs/common/immsv/include/immsv_evt.h > --- a/osaf/libs/common/immsv/include/immsv_evt.h > +++ b/osaf/libs/common/immsv/include/immsv_evt.h > @@ -89,6 +89,7 @@ typedef enum imma_evt_type { > IMMA_EVT_ND2A_CCB_AUG_INIT_RSP = 28, /* Response on IMMND_EVT_A2ND_OI_CCB_AUG_INIT */ > > IMMA_EVT_ND2A_SEARCHBUNDLENEXT_RSP = 29, /*Response from SearchNext with more results */ > + IMMA_EVT_ND2A_ACCESSOR_GET_RSP = 30, /* Response from accessorGet */ > > IMMA_EVT_MAX > } IMMA_EVT_TYPE; > @@ -202,6 +203,8 @@ typedef enum immnd_evt_type { > IMMND_EVT_A2ND_AUG_ADMO = 92, /* Inform IMMNDs of extra admo for augment ccb */ > IMMND_EVT_A2ND_CL_TIMEOUT = 93, /* Inform local IMMND of a library timeout. */ > > + IMMND_EVT_A2ND_ACCESSOR_GET = 94, /* saImmOmAccessorGet_2 */ > + > IMMND_EVT_MAX > } IMMND_EVT_TYPE; > /* Make sure the string array in immsv_evt.c matches the IMMND_EVT_TYPE enum. */ > @@ -432,6 +435,7 @@ typedef struct imma_evt { > IMMSV_OM_RSP_SEARCH_NEXT *searchNextRsp; > IMMSV_OM_RSP_SEARCH_BUNDLE_NEXT *searchBundleNextRsp; > IMMSV_OM_SEARCH_REMOTE searchRemote; > + IMMSV_OM_RSP_ACCESSOR_GET accessorGetRsp; > IMMSV_OM_ADMIN_OP_INVOKE admOpReq; //For the OI callback. > IMMSV_OI_ADMIN_OP_RSP admOpRsp; > IMMSV_OM_CCB_OBJECT_CREATE objCreate; //callback > @@ -488,6 +492,7 @@ typedef struct immnd_evt { > IMMSV_OI_SEARCH_REMOTE_RSP rtAttUpdRpl; > IMMSV_OM_SEARCH_REMOTE searchRemote; > IMMSV_OM_RSP_SEARCH_REMOTE rspSrchRmte; > + IMMSV_OM_ACCESSOR_GET accessorGet; > > /* IMMD --> IMMND */ > IMMSV_D2ND_CONTROL ctrl; > diff --git a/osaf/libs/common/immsv/include/immsv_evt_model.h b/osaf/libs/common/immsv/include/immsv_evt_model.h > --- a/osaf/libs/common/immsv/include/immsv_evt_model.h > +++ b/osaf/libs/common/immsv/include/immsv_evt_model.h > @@ -81,6 +81,10 @@ extern "C" { > IMMSV_OM_RSP_SEARCH_NEXT **searchResult; > } IMMSV_OM_RSP_SEARCH_BUNDLE_NEXT; > > + typedef struct ImmsvOmRspAccessorGet { > + IMMSV_ATTR_VALUES_LIST *attrValuesList; > + } IMMSV_OM_RSP_ACCESSOR_GET; > + > typedef struct ImmsvOmRspSearchRemote { > SaAisErrorT result; > SaUint32T requestNodeId; > @@ -208,6 +212,12 @@ extern "C" { > IMMSV_ATTR_NAME_LIST *attributeNames; > } IMMSV_OM_SEARCH_INIT; > > + typedef struct ImmsvOmAccessorGet { > + SaImmHandleT client_hdl; > + IMMSV_OCTET_STRING objectName; > + IMMSV_ATTR_NAME_LIST *attributeNames; > + } IMMSV_OM_ACCESSOR_GET; > + > typedef struct ImmsvOmSearchRemote { > SaImmHandleT client_hdl; > SaUint32T requestNodeId; > diff --git a/osaf/services/saf/immsv/immnd/ImmModel.cc b/osaf/services/saf/immsv/immnd/ImmModel.cc > --- a/osaf/services/saf/immsv/immnd/ImmModel.cc > +++ b/osaf/services/saf/immsv/immnd/ImmModel.cc > @@ -547,7 +547,7 @@ void > immModel_specialApplierSavePrtoCreateAttrs(IMMND_CB *cb, > struct ImmsvOmCcbObjectCreate *req, SaUint32T continuationId) > { > - return ImmModel::instance(&cb->immModel)-> > + ImmModel::instance(&cb->immModel)-> > specialApplierSavePrtoCreateAttrs(req, continuationId); > } > > @@ -555,7 +555,7 @@ void > immModel_specialApplierSaveRtUpdateAttrs(IMMND_CB *cb, > struct ImmsvOmCcbObjectModify *req, SaUint32T continuationId) > { > - return ImmModel::instance(&cb->immModel)-> > + ImmModel::instance(&cb->immModel)-> > specialApplierSaveRtUpdateAttrs(req, continuationId); > } > > @@ -1107,12 +1107,13 @@ immModel_ccbAugmentAdmo(IMMND_CB *cb, Sa > > SaAisErrorT > immModel_searchInitialize(IMMND_CB *cb, struct ImmsvOmSearchInit* req, > - void** searchOp, SaBoolT isSync) > + void** searchOp, SaBoolT isSync, SaBoolT isAccessor) > { > ImmSearchOp* op = new ImmSearchOp(); > *searchOp = op; > > if(isSync) {op->setIsSync();} > + if(isAccessor) {op->setIsAccessor();} > > return ImmModel::instance(&cb->immModel)->searchInitialize(req, *op); > } > @@ -1209,6 +1210,13 @@ immModel_clearLastResult(void* searchOp) > op->clearLastResult(); > } > > +SaBoolT > +immModel_isSearchOpAccessor(void* searchOp) > +{ > + ImmSearchOp* op = (ImmSearchOp *) searchOp; > + return op->isAccessor() ? SA_TRUE : SA_FALSE; > +} > + > void > immModel_setAdmReqContinuation(IMMND_CB *cb, SaInvocationT invoc, > SaUint32T reqConn) > diff --git a/osaf/services/saf/immsv/immnd/ImmSearchOp.cc b/osaf/services/saf/immsv/immnd/ImmSearchOp.cc > --- a/osaf/services/saf/immsv/immnd/ImmSearchOp.cc > +++ b/osaf/services/saf/immsv/immnd/ImmSearchOp.cc > @@ -23,6 +23,7 @@ ImmSearchOp::ImmSearchOp() > { > mLastResult=NULL; > mIsSync=false; > + mIsAccessor=false; > syncOsi=NULL; > attrNameList=NULL; > classInfo=NULL; > diff --git a/osaf/services/saf/immsv/immnd/ImmSearchOp.hh b/osaf/services/saf/immsv/immnd/ImmSearchOp.hh > --- a/osaf/services/saf/immsv/immnd/ImmSearchOp.hh > +++ b/osaf/services/saf/immsv/immnd/ImmSearchOp.hh > @@ -85,7 +85,9 @@ public: > fetchLastResult() {return mLastResult;} > void clearLastResult() {mLastResult = NULL;} > void setIsSync() {mIsSync = true;} > + void setIsAccessor() {mIsAccessor = true;} > bool isSync() {return mIsSync;} > + bool isAccessor() {return mIsAccessor;} > void* syncOsi; > void* attrNameList; > void* classInfo; > @@ -95,6 +97,7 @@ private: > //fetching of runtime attribute values. > AttributeList mRtsToFetch; > bool mIsSync; > + bool mIsAccessor; > }; > > #endif > diff --git a/osaf/services/saf/immsv/immnd/immnd_evt.c b/osaf/services/saf/immsv/immnd/immnd_evt.c > --- a/osaf/services/saf/immsv/immnd/immnd_evt.c > +++ b/osaf/services/saf/immsv/immnd/immnd_evt.c > @@ -208,6 +208,8 @@ static uint32_t immnd_evt_proc_remote_se > > static uint32_t immnd_evt_proc_search_finalize(IMMND_CB *cb, IMMND_EVT *evt, IMMSV_SEND_INFO *sinfo); > > +static uint32_t immnd_evt_proc_accessor_get(IMMND_CB *cb, IMMND_EVT *evt, IMMSV_SEND_INFO *sinfo); > + > static uint32_t immnd_evt_proc_mds_evt(IMMND_CB *cb, IMMND_EVT *evt); > > /*static uint32_t immnd_evt_immd_new_active(IMMND_CB *cb);*/ > @@ -365,6 +367,11 @@ uint32_t immnd_evt_destroy(IMMSV_EVT *ev > > immsv_evt_free_attrNames(evt->info.immnd.info.searchInit.attributeNames); > evt->info.immnd.info.searchInit.attributeNames = NULL; > + } else if (evt->info.immnd.type == IMMND_EVT_A2ND_ACCESSOR_GET) { > + if(evt->info.immnd.info.accessorGet.objectName.buf) > + free(evt->info.immnd.info.accessorGet.objectName.buf); > + if(evt->info.immnd.info.accessorGet.attributeNames) > + immsv_evt_free_attrNames(evt->info.immnd.info.accessorGet.attributeNames); > } else if ((evt->info.immnd.type == IMMND_EVT_ND2ND_SYNC_FINALIZE) || > (evt->info.immnd.type == IMMND_EVT_ND2ND_SYNC_FINALIZE_2)) { > immsv_evt_free_admo(evt->info.immnd.info.finSync.adminOwners); > @@ -589,6 +596,10 @@ void immnd_process_evt(void) > rc = immnd_evt_proc_search_next(cb, &evt->info.immnd, &evt->sinfo); > break; > > + case IMMND_EVT_A2ND_ACCESSOR_GET: > + rc = immnd_evt_proc_accessor_get(cb, &evt->info.immnd, &evt->sinfo); > + break; > + > case IMMND_EVT_A2ND_RT_ATT_UPPD_RSP: > rc = immnd_evt_proc_oi_att_pull_rpl(cb, &evt->info.immnd, &evt->sinfo); > break; > @@ -860,7 +871,7 @@ static uint32_t immnd_evt_proc_search_in > goto agent_rsp; > } > > - error = immModel_searchInitialize(cb, &(evt->info.searchInit), &searchOp, isSync); > + error = immModel_searchInitialize(cb, &(evt->info.searchInit), &searchOp, isSync, SA_FALSE); > > if((error == SA_AIS_OK) && isSync) { > /* Special processing only for sync iterator. */ > @@ -895,6 +906,8 @@ static uint32_t immnd_evt_proc_search_in > } > > sn->searchId = cb->cli_id_gen++; /* separate count for search */ > + if(cb->cli_id_gen == 0xffffffff) > + cb->cli_id_gen = 1; > sn->searchOp = searchOp; /*TODO: wraparround */ > sn->next = cl_node->searchOpList; > cl_node->searchOpList = sn; > @@ -926,6 +939,7 @@ void search_req_continue(IMMND_CB *cb, I > IMMSV_ATTR_VALUES_LIST *oldRsp, *fetchedRsp; > IMMND_OM_SEARCH_NODE *sn = NULL; > SaAisErrorT err = reply->result; > + SaBoolT isAccessor = SA_FALSE; > TRACE_ENTER(); > osafassert(reply->requestNodeId == cb->node_id); > memset(&send_evt, '\0', sizeof(IMMSV_EVT)); > @@ -954,6 +968,7 @@ void search_req_continue(IMMND_CB *cb, I > if (sn) { > immModel_fetchLastResult(sn->searchOp, &rsp); > immModel_clearLastResult(sn->searchOp); > + isAccessor = immModel_isSearchOpAccessor(sn->searchOp); > } else { > LOG_ER("Could not find search node for search-ID:%u", reply->searchId); > if (err == SA_AIS_OK) { > @@ -1036,8 +1051,14 @@ void search_req_continue(IMMND_CB *cb, I > > agent_rsp: > if (err == SA_AIS_OK) { > - send_evt.info.imma.type = IMMA_EVT_ND2A_SEARCHNEXT_RSP; > - send_evt.info.imma.info.searchNextRsp = rsp; > + if(isAccessor == SA_FALSE) { > + send_evt.info.imma.type = IMMA_EVT_ND2A_SEARCHNEXT_RSP; > + send_evt.info.imma.info.searchNextRsp = rsp; > + } else { > + send_evt.info.imma.type = IMMA_EVT_ND2A_ACCESSOR_GET_RSP; > + send_evt.info.imma.info.accessorGetRsp.attrValuesList = rsp->attrValuesList; > + immModel_deleteSearchOp(sn->searchOp); > + } > } else { /*err != SA_AIS_OK */ > send_evt.info.imma.type = IMMA_EVT_ND2A_IMM_ERROR; > send_evt.info.imma.info.errRsp.error = err; > @@ -1047,6 +1068,26 @@ void search_req_continue(IMMND_CB *cb, I > LOG_WA("Could not send reply to agent for search-next continuaton"); > } > > + if(isAccessor) { > + if(sn && cl_node) { > + IMMND_OM_SEARCH_NODE **prev = &(cl_node->searchOpList); > + IMMND_OM_SEARCH_NODE *n = cl_node->searchOpList; > + while(n) { > + if(n == sn) { > + *prev = n->next; > + break; > + } > + prev = &(n->next); > + n = n->next; > + } > + } > + if(sn) { > + if(sn->searchOp) > + immModel_deleteSearchOp(sn->searchOp); > + free(sn); > + } > + } > + > if (rsp) { > freeSearchNext(rsp, true); > } > @@ -1111,7 +1152,7 @@ static uint32_t immnd_evt_proc_oi_att_pu > reqo.attributeNames = evt->info.rtAttUpdRpl.sr.attributeNames; /*borrowing. */ > > TRACE_2("oi_att_pull_rpl Before searchInit"); > - err = immModel_searchInitialize(cb, &reqo, &searchOp, SA_FALSE); > + err = immModel_searchInitialize(cb, &reqo, &searchOp, SA_FALSE, SA_FALSE); > if (err == SA_AIS_OK) { > TRACE_2("oi_att_pull_rpl searchInit returned OK, calling searchNext"); > IMMSV_OM_RSP_SEARCH_NEXT *rsp = 0; > @@ -1522,6 +1563,7 @@ static uint32_t immnd_evt_proc_search_ne > } else { > send_evt.info.imma.type = IMMA_EVT_ND2A_IMM_ERROR; > send_evt.info.imma.info.errRsp.error = error; > + send_evt.info.imma.info.errRsp.errStrings = NULL; > } > > rc = immnd_mds_send_rsp(cb, sinfo, &send_evt); > @@ -1633,6 +1675,306 @@ static uint32_t immnd_evt_proc_search_fi > } > > /**************************************************************************** > + * Name : immnd_evt_proc_accessor_get > + * > + * Description : Function to process the saImmOmAccessorGet call. > + * Note that this is a read, local to the ND (does not go > + * over FEVS). > + * > + * Arguments : IMMND_CB *cb - IMMND CB pointer > + * IMMND_EVT *evt - Received Event structure > + * IMMSV_SEND_INFO *sinfo - sender info > + * > + * Return Values : NCSCC_RC_SUCCESS/Error. > + * > + * Notes : None. > + *****************************************************************************/ > +static uint32_t immnd_evt_proc_accessor_get(IMMND_CB *cb, IMMND_EVT *evt, IMMSV_SEND_INFO *sinfo) > +{ > + IMMSV_EVT send_evt; > + uint32_t rc = NCSCC_RC_SUCCESS; > + SaAisErrorT error = SA_AIS_OK; > + void *searchOp = NULL; > + IMMND_IMM_CLIENT_NODE *cl_node = NULL; > + IMMND_IMM_CLIENT_NODE *oi_cl_node = NULL; > + SaImmOiHandleT implHandle = 0LL; > + IMMND_OM_SEARCH_NODE *sn = NULL; > + IMMSV_OM_SEARCH_INIT si; > + uint16_t searchOpCount=0; > + IMMSV_OM_RSP_SEARCH_NEXT *rsp = NULL; > + IMMSV_OM_RSP_SEARCH_NEXT *rsp1 = NULL; > + IMMSV_OM_RSP_SEARCH_NEXT **rspList = NULL; > + SaUint32T resultSize = 0; > + SaUint32T implConn = 0; > + SaUint32T implNodeId = 0; > + struct ImmsvAttrNameList *rtAttrsToFetch = NULL; > + MDS_DEST implDest = 0LL; > + SaBoolT retardSync = > + ((cb->fevs_replies_pending >= IMMSV_DEFAULT_FEVS_MAX_PENDING) && > + cb->mIsCoord && (cb->syncPid > 0)); > + > + > + TRACE_ENTER(); > + > +/* Search Init */ > + > + memset(&send_evt, 0, sizeof(IMMSV_EVT)); > + TRACE_2("ACCESSOR GET:%s", evt->info.accessorGet.objectName.buf); > + > + /*Look up client-node */ > + immnd_client_node_get(cb, evt->info.accessorGet.client_hdl, &cl_node); > + if (cl_node == NULL || cl_node->mIsStale) { > + LOG_WA("IMMND - Client Node Get Failed for cli_hdl"); > + TRACE_2("Client Node get failed for handle:%llu", evt->info.searchInit.client_hdl); > + error = SA_AIS_ERR_BAD_HANDLE; > + goto agent_init_rsp; > + } > + > + sn = cl_node->searchOpList; > + while(sn) { > + ++searchOpCount; > + sn = sn->next; > + } > + if(searchOpCount >= 5000) { > + LOG_WA("ERR_NO_RESOURCES: Too many search operations (%u) on OM handle -" > + " probable resource leak.", searchOpCount); > + error = SA_AIS_ERR_NO_RESOURCES; > + goto agent_init_rsp; > + } > + > + si.client_hdl = evt->info.accessorGet.client_hdl; > + si.rootName.buf = evt->info.accessorGet.objectName.buf; > + si.rootName.size = evt->info.accessorGet.objectName.size; > + si.scope = SA_IMM_ONE; > + si.searchParam.present = ImmOmSearchParameter_PR_NOTHING; > + si.attributeNames = evt->info.accessorGet.attributeNames; > + if(si.attributeNames && si.attributeNames->next == NULL && > + strncmp(si.attributeNames->name.buf, "SA_IMM_SEARCH_GET_CONFIG_ATTR", si.attributeNames->name.size) == 0) { > + si.searchOptions = SA_IMM_SEARCH_ONE_ATTR | SA_IMM_SEARCH_GET_CONFIG_ATTR; > + si.attributeNames = NULL; > + } else > + si.searchOptions = SA_IMM_SEARCH_ONE_ATTR | > + (si.attributeNames ? SA_IMM_SEARCH_GET_SOME_ATTR : SA_IMM_SEARCH_GET_ALL_ATTR); > + > + error = immModel_searchInitialize(cb, &si, &searchOp, SA_FALSE, SA_TRUE); > + > + if (error != SA_AIS_OK) > + goto agent_init_rsp; > + > + /*Generate search-id */ > + sn = calloc(1, sizeof(IMMND_OM_SEARCH_NODE)); > + if(sn == NULL) { > + error = SA_AIS_ERR_NO_MEMORY; > + goto agent_init_rsp; > + } > + > + sn->searchId = cb->cli_id_gen++; /* separate count for search */ > + if(cb->cli_id_gen == 0xffffffff) > + cb->cli_id_gen = 1; > + sn->searchOp = searchOp; /*TODO: wraparround */ > + sn->next = cl_node->searchOpList; > + cl_node->searchOpList = sn; > + > +/* Search Next */ > + > + error = immModel_nextResult(cb, sn->searchOp, &rsp, &implConn, &implNodeId, &rtAttrsToFetch, > + &implDest, retardSync); > + if (error != SA_AIS_OK) > + goto agent_next_rsp; > + > + /*Three cases: > + A) No runtime attributes to fetch. > + Reply directly with this call. > + B) Runtime attributes to fetch and the implementer is local. > + => (store continuation?) and call on implementer. > + C) Runtime attributes to fetch, but the implementer is remote > + => store continuation and use request remote invoc over > + either FEVS or direct adressing to peer ND. > + */ > + > + if (implNodeId) { /* Case B or C */ > + TRACE_2("There is an implementer and there are pure rt's !"); > + osafassert(rtAttrsToFetch); > + /*rsp kept in ImmSearchOp to be used in continuation. > + rtAttrsToFetch is expected to be deleted by this layer after used. > + > + rsp needs to be appended by the replies. > + ((attrsToFetch needs to be checked/matched when replies received.)) > + If the (non cached runtime) attribute is ALSO persistent, then > + the value should be stored (exactly as cached). The only difference > + with respect to officially cached is how the attribute is fetched. > + */ > + > + if (implConn) { > + TRACE_2("The implementer is local"); > + /*Case B Invoke rtUpdateCallback directly. */ > + osafassert(implNodeId == cb->node_id); > + send_evt.type = IMMSV_EVT_TYPE_IMMA; > + send_evt.info.imma.type = IMMA_EVT_ND2A_SEARCH_REMOTE; > + IMMSV_OM_SEARCH_REMOTE *rreq = &send_evt.info.imma.info.searchRemote; > + rreq->remoteNodeId = implNodeId; > + rreq->searchId = sn->searchId; > + rreq->requestNodeId = cb->node_id; /* NOTE: obsolete ? */ > + rreq->objectName = rsp->objectName; /* borrow objectName.buf */ > + rreq->attributeNames = rtAttrsToFetch; /* borrow this structure */ > + > + implHandle = m_IMMSV_PACK_HANDLE(implConn, implNodeId); > + /*Fetch client node for OI ! */ > + immnd_client_node_get(cb, implHandle, &oi_cl_node); > + if (oi_cl_node == NULL || oi_cl_node->mIsStale) { > + LOG_WA("ERR_NO_RESOURCES: SearchNext: Implementer died during fetch of pure RTA"); > + error = SA_AIS_ERR_NO_RESOURCES; > + goto agent_init_rsp; > + } else { > + rreq->client_hdl = implHandle; > + TRACE_2("MAKING OI-IMPLEMENTER rtUpdate upcall towards agent"); > + if (immnd_mds_msg_send(cb, NCSMDS_SVC_ID_IMMA_OI, > + oi_cl_node->agent_mds_dest, &send_evt) != NCSCC_RC_SUCCESS) { > + LOG_WA("ERR_NO_RESOURCES: SearchNext - Agent upcall over MDS for rtUpdate failed"); > + error = SA_AIS_ERR_NO_RESOURCES; > + goto agent_init_rsp; > + } > + } > + } else { > + TRACE_2("The implementer is remote"); > + /*Case C Send the message directly to nd where implementer resides. */ > + send_evt.type = IMMSV_EVT_TYPE_IMMND; > + send_evt.info.immnd.type = IMMND_EVT_ND2ND_SEARCH_REMOTE; > + IMMSV_OM_SEARCH_REMOTE *rreq = &send_evt.info.immnd.info.searchRemote; > + rreq->remoteNodeId = implNodeId; > + rreq->searchId = sn->searchId; > + rreq->requestNodeId = cb->node_id; /* NOTE: obsolete ? */ > + rreq->objectName = rsp->objectName; /* borrowed buf; */ > + rreq->attributeNames = rtAttrsToFetch; /* borrowed attrList */ > + > + TRACE_2("FORWARDING TO OTHER ND!"); > + > + rc = immnd_mds_msg_send(cb, NCSMDS_SVC_ID_IMMND, implDest, &send_evt); > + if (rc != NCSCC_RC_SUCCESS) { > + LOG_ER("ERR_NO_RESOURCES: SearchNext - Problem in sending to peer IMMND over MDS. Aborting searchNext."); > + error = SA_AIS_ERR_NO_RESOURCES; > + goto agent_init_rsp; > + } > + } > + > + /*Register request continuation ! */ > + SaInvocationT invoc = m_IMMSV_PACK_HANDLE(implNodeId, sn->searchId); > + SaUint32T clientId = m_IMMSV_UNPACK_HANDLE_HIGH(evt->info.searchOp.client_hdl); > + > + TRACE_2("SETTING SEARCH REQ CONTINUATION FOR %u|%x->%u", sn->searchId, implNodeId, clientId); > + > + immModel_setSearchReqContinuation(cb, invoc, clientId); > + > + cl_node->tmpSinfo = *sinfo; //TODO should be part of continuation? > + > + osafassert(error == SA_AIS_OK); > + if (rtAttrsToFetch) { > + immsv_evt_free_attrNames(rtAttrsToFetch); > + } > + TRACE_LEAVE(); > + return NCSCC_RC_SUCCESS; > + } else if(!rtAttrsToFetch) { /*Case A */ > + IMMSV_ATTR_NAME_LIST *rtAttrs; > + SaAisErrorT err; > + SaBoolT bRtAttrs; > + uint32_t size = search_result_size(rsp); > + resultSize = 1; > + > + /* Repeat to the maximum search result, > + * or the size os search results becomes bigger then IMMND_SEARCH_BUNDLE_SIZE, > + * or till the object with at least one pure runtime attribute */ > + while(resultSize < IMMND_MAX_SEARCH_RESULT && size < IMMND_SEARCH_BUNDLE_SIZE) { > + err = immModel_testTopResult(sn->searchOp, &implNodeId, &bRtAttrs); > + if ((err != SA_AIS_OK) || (bRtAttrs == SA_TRUE)) > + break; > + > + err = immModel_nextResult(cb, sn->searchOp, &rsp1, &implConn, &implNodeId, &rtAttrs, > + &implDest, retardSync); > + if(err != SA_AIS_OK) { > + osafassert(err == SA_AIS_ERR_NOT_EXIST); > + break; > + } > + > + if(resultSize == 1) { > + rspList = (IMMSV_OM_RSP_SEARCH_NEXT **)calloc(IMMND_MAX_SEARCH_RESULT, sizeof(IMMSV_OM_RSP_SEARCH_NEXT *)); > + rspList[0] = rsp; > + rsp = NULL; > + } > + > + rspList[resultSize++] = rsp1; > + > + size += search_result_size(rsp1); > + } > + > + immModel_clearLastResult(sn->searchOp); > + } > + > + agent_next_rsp: > + > + if (error == SA_AIS_OK) { > + if(resultSize == 1) { > + send_evt.type = IMMSV_EVT_TYPE_IMMA; > + send_evt.info.imma.type = IMMA_EVT_ND2A_ACCESSOR_GET_RSP; > + send_evt.info.imma.info.accessorGetRsp.attrValuesList = rsp->attrValuesList; > + } else > + error = SA_AIS_ERR_INVALID_PARAM; > + } > + > + agent_init_rsp: > + > + if (error != SA_AIS_OK) { > + send_evt.type = IMMSV_EVT_TYPE_IMMA; > + send_evt.info.imma.type = IMMA_EVT_ND2A_IMM_ERROR; > + send_evt.info.imma.info.errRsp.error = error; > + send_evt.info.imma.info.errRsp.errStrings = NULL; > + } > + > + rc = immnd_mds_send_rsp(cb, sinfo, &send_evt); > + > + if(rsp) > + freeSearchNext(rsp, true); > + > + if(rspList) { > + int ix; > + for(ix=0; ix<IMMND_MAX_SEARCH_RESULT; ix++) { > + if(rspList[ix]) { > + freeSearchNext(rspList[ix], true); > + } > + } > + free(rspList); > + > + immModel_clearLastResult(sn->searchOp); > + } > + > + if (rtAttrsToFetch) { > + immsv_evt_free_attrNames(rtAttrsToFetch); > + } > + > + if(sn && cl_node) { > + IMMND_OM_SEARCH_NODE **prev = &(cl_node->searchOpList); > + IMMND_OM_SEARCH_NODE *n = cl_node->searchOpList; > + while(n) { > + if(n == sn) { > + *prev = n->next; > + break; > + } > + prev = &(n->next); > + n = n->next; > + } > + } > + > + if(searchOp) > + immModel_deleteSearchOp(searchOp); > + > + if(sn) > + free(sn); > + > + TRACE_LEAVE(); > + > + return rc; > +} > + > +/**************************************************************************** > * Name : immnd_evt_proc_class_desc_get > * > * Description : Function to process the SaImmOmClassDescriptionGet call. > diff --git a/osaf/services/saf/immsv/immnd/immnd_init.h b/osaf/services/saf/immsv/immnd/immnd_init.h > --- a/osaf/services/saf/immsv/immnd/immnd_init.h > +++ b/osaf/services/saf/immsv/immnd/immnd_init.h > @@ -188,7 +188,7 @@ extern "C" { > SaBoolT immModel_ccbCommit(IMMND_CB *cb, SaUint32T ccbId, SaUint32T *arrSize, SaUint32T **implConnArr); > SaAisErrorT immModel_ccbFinalize(IMMND_CB *cb, SaUint32T ccbId); > > - SaAisErrorT immModel_searchInitialize(IMMND_CB *cb, struct ImmsvOmSearchInit *req, void **searchOp, SaBoolT isSync); > + SaAisErrorT immModel_searchInitialize(IMMND_CB *cb, struct ImmsvOmSearchInit *req, void **searchOp, SaBoolT isSync, SaBoolT isAccessor); > > SaAisErrorT immModel_testTopResult(void *searchOp, SaUint32T *implNodeId, SaBoolT *bRtAttrsToFetch); > > @@ -204,6 +204,8 @@ extern "C" { > > void immModel_fetchLastResult(void *searchOp, IMMSV_OM_RSP_SEARCH_NEXT **rsp); > > + SaBoolT immModel_isSearchOpAccessor(void* searchOp); > + > void immModel_setAdmReqContinuation(IMMND_CB *cb, SaInvocationT invoc, SaUint32T reqCon); > > void immModel_setSearchReqContinuation(IMMND_CB *cb, SaInvocationT invoc, SaUint32T reqCon); |
From: Nagendra K. <nag...@or...> - 2013-04-01 11:37:18
|
Hi, The below items needs to be documented as implementation notes/Specs deviations: 1. AMF is not instantiating components with same instantiation levels parallel. 2. Spec deviation in SI lock case: When SI lock is done, AMF delivers Act to Quisced callback rather than directly Act to Remove callback. 3. If two assigned Sus are on the same node, then node lock is not allowed. 4. saAmfCtDefDisableRestart/saAmfCompDisableRestart is supported completely: Component's SI are not getting Reasigned to other components, when that component fails, whose saAmfCtDefDisableRestart/saAmfCompDisableRestart is set to TRUE. It is doing SU Failover and not component failover. Also that component should undergo normal presence state change(terminating, uninstantiated, instantiating, and then instantiated) as like absence of failures. Thanks -Nagu |
From: mahesh v. <mah...@or...> - 2013-04-01 06:59:25
|
From: Anders W. <and...@er...> - 2013-03-31 19:10:54
|
The OpenSAF devel mailing list has been moved to to a new server. Subscriptions have not been automatically transferred, so you need to subscribe to the new mailing list if you have not already done so. Also note: * The code review script has been updated with the new address - make sure your mercurial repository is up-to-date before using it. * When replying to a message that was sent on the old mailing list, change the address to the new mailing list. New URL for subscribing and unsubscribing: https://lists.sourceforge.net/lists/listinfo/opensaf-devel New URL for mailing list archive: https://sourceforge.net/mailarchive/forum.php?forum_name=opensaf-devel regards, Anders Widell |
From: Anders W. <and...@er...> - 2013-03-26 08:38:18
|
As previously announced, the devel mailing list will be moved to a new server. The move will happen on 2013-04-01. If you haven't subscribed to the new mailing list yet, please do so as soon as possible. Below is a link to the original announcement, which contains instructions for how to subscribe to the new list: http://list.opensaf.org/pipermail/devel/2013-March/029969.html regards, Anders Widell |