Hi, In your proposal, calling "getObject" could be a blocker also:
if(getObject(IMM_CONFIG_OBJECT_DN, &attributes) == false) { LOG_ER("Could not get IMM config object from IMM %s", IMM_CONFIG_OBJECT_DN); TRACE_LEAVE(); return false; } In my proposal (the patch sent to review), I removed the above "return false", that is why the function changed from bool to void, and the caller functions modified according to that. Still need to decide between your and my proposal. Br, Robert -----Original Message----- From: Ingvar Bergström Sent: den 5 december 2014 08:20 To: Robert Apanowicz; Bertil Engelholm Cc: opensaf-devel@lists.sourceforge.net Subject: RE: [PATCH 1 of 1] smf: reading of longDnsAllowed attribute does not block [#1230] I think it is better to just change the "read_IMM_long_DN_config_and_set_control_block" routine. Something like this: diff --git a/osaf/services/saf/smfsv/smfd/SmfUtils.cc b/osaf/services/saf/smfsv/smfd/SmfUtils.cc --- a/osaf/services/saf/smfsv/smfd/SmfUtils.cc +++ b/osaf/services/saf/smfsv/smfd/SmfUtils.cc @@ -758,10 +758,12 @@ SmfImmUtils::read_IMM_long_DN_config_and TRACE_LEAVE(); return true; } - } - LOG_ER("Could not get long DN config from IMM attr %s %s", IMM_LONG_DN_CONFIG_ATTRIBUTE_NAME, IMM_CONFIG_OBJECT_DN); + } else { + LOG_NO("Could not get long DN config [%s %s], use default DN length", IMM_LONG_DN_CONFIG_ATTRIBUTE_NAME, IMM_CONFIG_OBJECT_DN); + } + TRACE_LEAVE(); - return false; + return true; } Thanks Ingvar -----Original Message----- From: Robert Apanowicz Sent: den 4 december 2014 12:29 To: Ingvar Bergström; Bertil Engelholm Cc: opensaf-devel@lists.sourceforge.net Subject: [PATCH 1 of 1] smf: reading of longDnsAllowed attribute does not block [#1230] osaf/services/saf/smfsv/smfd/SmfCampaignInit.cc | 13 +++---------- osaf/services/saf/smfsv/smfd/SmfUtils.cc | 12 ++++++------ osaf/services/saf/smfsv/smfd/SmfUtils.hh | 3 +-- osaf/services/saf/smfsv/smfd/smfd_campaign_oi.cc | 5 +---- 4 files changed, 11 insertions(+), 22 deletions(-) The reader function of "longDnsAllowed" IMM attribute changed to not block. It changed from bool type to void. The error logs and default settings of long DN data in SMF is kept. diff --git a/osaf/services/saf/smfsv/smfd/SmfCampaignInit.cc b/osaf/services/saf/smfsv/smfd/SmfCampaignInit.cc --- a/osaf/services/saf/smfsv/smfd/SmfCampaignInit.cc +++ b/osaf/services/saf/smfsv/smfd/SmfCampaignInit.cc @@ -225,19 +225,12 @@ SmfCampaignInit::execute() return false; } - if (!immUtil.read_IMM_long_DN_config_and_set_control_block(smfd_cb)) { - LOG_ER("SmfCampaignInit: reading long DN config from IMM FAILED"); - TRACE_LEAVE(); - return false; - } + immUtil.read_IMM_long_DN_config_and_set_control_block(smfd_cb); std::list < SmfUpgradeAction * >::iterator upActiter; upActiter = m_campInitAction.begin(); while (upActiter != m_campInitAction.end()) { - if (!immUtil.read_IMM_long_DN_config_and_set_control_block(smfd_cb)) { - LOG_ER("SmfCampaignInit: reading long DN config from IMM FAILED"); - TRACE_LEAVE(); - return false; - } + immUtil.read_IMM_long_DN_config_and_set_control_block(smfd_cb); + SaAisErrorT rc = (*upActiter)->execute(SmfCampaignThread::instance()->getImmHandle(), &initRollbackDn); if (rc != SA_AIS_OK) { diff --git a/osaf/services/saf/smfsv/smfd/SmfUtils.cc b/osaf/services/saf/smfsv/smfd/SmfUtils.cc --- a/osaf/services/saf/smfsv/smfd/SmfUtils.cc +++ b/osaf/services/saf/smfsv/smfd/SmfUtils.cc @@ -713,7 +713,7 @@ SmfImmUtils::nodeToClmNode(const std::st //------------------------------------------------------------------------------ // Reads IMM configuration data for long DNs and sets cb data structure //------------------------------------------------------------------------------ -bool +void SmfImmUtils::read_IMM_long_DN_config_and_set_control_block(smfd_cb_t * cb) { TRACE_ENTER(); @@ -728,7 +728,7 @@ SmfImmUtils::read_IMM_long_DN_config_and if(cb->maxDnLength == maxDnLength) { TRACE("read_IMM_long_DN_config_and_set_control_block(): Long DNs already enabled"); TRACE_LEAVE(); - return true; + return; } /* Set the default value first, @@ -742,7 +742,7 @@ SmfImmUtils::read_IMM_long_DN_config_and if(getObject(IMM_CONFIG_OBJECT_DN, &attributes) == false) { LOG_ER("Could not get IMM config object from IMM %s", IMM_CONFIG_OBJECT_DN); TRACE_LEAVE(); - return false; + return; } const SaUint32T *longDnsAllowed = immutil_getUint32Attr((const SaImmAttrValuesT_2 **)attributes, IMM_LONG_DN_CONFIG_ATTRIBUTE_NAME, 0); @@ -751,17 +751,17 @@ SmfImmUtils::read_IMM_long_DN_config_and if(*longDnsAllowed == 0) { cb->maxDnLength = DEFAULT_MAX_DN_LENGTH; TRACE_LEAVE(); - return true; + return; } if(*longDnsAllowed == 1) { cb->maxDnLength = maxDnLength; TRACE_LEAVE(); - return true; + return; } } LOG_ER("Could not get long DN config from IMM attr %s %s", IMM_LONG_DN_CONFIG_ATTRIBUTE_NAME, IMM_CONFIG_OBJECT_DN); TRACE_LEAVE(); - return false; + return; } // ------------------------------------------------------------------------------ diff --git a/osaf/services/saf/smfsv/smfd/SmfUtils.hh b/osaf/services/saf/smfsv/smfd/SmfUtils.hh --- a/osaf/services/saf/smfsv/smfd/SmfUtils.hh +++ b/osaf/services/saf/smfsv/smfd/SmfUtils.hh @@ -195,9 +195,8 @@ class SmfImmUtils { /// /// Purpose: Read long DN information from IMM /// @param cb is the SMF control block -/// @return True if successful, otherwise false /// - bool read_IMM_long_DN_config_and_set_control_block(smfd_cb_t * cb); + void read_IMM_long_DN_config_and_set_control_block(smfd_cb_t * cb); private: bool initialize(void); diff --git a/osaf/services/saf/smfsv/smfd/smfd_campaign_oi.cc b/osaf/services/saf/smfsv/smfd/smfd_campaign_oi.cc --- a/osaf/services/saf/smfsv/smfd/smfd_campaign_oi.cc +++ b/osaf/services/saf/smfsv/smfd/smfd_campaign_oi.cc @@ -852,10 +852,7 @@ uint32_t read_config_and_set_control_blo //Read IMM configuration for long DNs and set cb data structure //The long DN info is configured in IMM not in SMF config object - if (!immutil.read_IMM_long_DN_config_and_set_control_block(cb)) { - LOG_ER("read_IMM_long_DN_config_and_set_control_block FAIL"); - return NCSCC_RC_FAILURE; - } + immutil.read_IMM_long_DN_config_and_set_control_block(cb); if (immutil.getObject(SMF_CONFIG_OBJECT_DN, &attributes) == false) { LOG_ER("Could not get SMF config object from IMM %s", SMF_CONFIG_OBJECT_DN); ------------------------------------------------------------------------------ Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk _______________________________________________ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel