Re: [devel] [PATCH 1 of 1] imm:allow augumentCcbInit with ROF as false in completed callback[#1956] V2

2016-12-01 Thread Hung Nguyen
Hi Neel,

I agree with your comments.
Please send new patch for review since there are many fixes.

Thanks,

Hung Nguyen - DEK Technologies



From: Neelakanta Reddy reddy.neelaka...@oracle.com
Sent: Thursday, December 01, 2016 4:53PM
To: Hung Nguyen, Zoran Milinkovic
 hung.d.ngu...@dektech.com.au, zoran.milinko...@ericsson.com
Cc: Opensaf-devel
 opensaf-devel@lists.sourceforge.net
Subject: Re: [PATCH 1 of 1] imm:allow augumentCcbInit with ROF as false in 
completed callback[#1956] V2


Hi Hung,

comments inline.

On 2016/12/01 03:07 PM, Hung Nguyen wrote:
> Hi Neel,
>
> Besides Zoran's comment, I have 2 more comments inline.
>
> BR,
> Hung Nguyen - DEK Technologies
>
> 
> From: Neelakanta reddyreddy.neelaka...@oracle.com
> Sent: Wednesday, November 30, 2016 12:39PM
> To: Zoran Milinkovic, Hung Nguyen
>  zoran.milinko...@ericsson.com,hung.d.ngu...@dektech.com.au
> Cc: Opensaf-devel
>  opensaf-devel@lists.sourceforge.net
> Subject: [PATCH 1 of 1] imm:allow augumentCcbInit with ROF as false in 
> completed callback[#1956] V2
>
>
>   osaf/libs/agents/saf/imma/imma_cb.h |   5 +
>   osaf/libs/agents/saf/imma/imma_db.c |  99 
> +
>   osaf/libs/agents/saf/imma/imma_oi_api.c |  60 +++
>   osaf/libs/agents/saf/imma/imma_proc.c   |  64 ++---
>   4 files changed, 133 insertions(+), 95 deletions(-)
>
>
> Two new variables objectName and adminOwnerName added to imma_oi_ccb_record. 
> For CCB create operation adminOwnerName will be added.
> For CCB delete/modify operation objectName will be added
>
> diff --git a/osaf/libs/agents/saf/imma/imma_cb.h 
> b/osaf/libs/agents/saf/imma/imma_cb.h
> --- a/osaf/libs/agents/saf/imma/imma_cb.h
> +++ b/osaf/libs/agents/saf/imma/imma_cb.h
> @@ -36,6 +36,10 @@ struct imma_oi_ccb_record {
>   struct imma_callback_info* ccbCallback;
>   SaImmHandleT privateAugOmHandle;
>   SaImmAdminOwnerHandleT privateAoHandle;
> + SaNameT objectName;/* The  Object name from the modif/delete ccb 
> operationi. The objectName is used to obtain
> + adminOnerName when saImmOiAugmentCcbInitialize is 
> called in completed-callback*/
> + SaNameT adminOwnerName; /* adminowner name of the ccb id, assigned at 
> ccb-create-callback.The adminOwnerName is used
> +saImmOiAugmentCcbInitialize is called in 
> completed-callback*/
>   };
>   
>   typedef struct imma_client_node {
> @@ -197,6 +201,7 @@ int imma_oi_ccb_record_set_critical(IMMA
>   int imma_oi_ccb_record_terminate(IMMA_CLIENT_NODE *cl_node, SaImmOiCcbIdT 
> ccbId);
>   int imma_oi_ccb_record_abort(IMMA_CLIENT_NODE *cl_node, SaImmOiCcbIdT 
> ccbId);
>   int imma_oi_ccb_record_exists(IMMA_CLIENT_NODE *cl_node, SaImmOiCcbIdT 
> ccbId);
> +struct imma_oi_ccb_record * imma_oi_ccb_record_find(IMMA_CLIENT_NODE 
> *cl_node, SaImmOiCcbIdT ccbId);
>   int imma_oi_ccb_record_set_error(IMMA_CLIENT_NODE *cl_node, SaImmOiCcbIdT 
> ccbId, const SaStringT errorString);
>   SaStringT imma_oi_ccb_record_get_error(IMMA_CLIENT_NODE *cl_node, 
> SaImmOiCcbIdT ccbId);
>   void imma_oi_ccb_allow_error_string(IMMA_CLIENT_NODE *cl_node, 
> SaImmOiCcbIdT ccbId);
> diff --git a/osaf/libs/agents/saf/imma/imma_db.c 
> b/osaf/libs/agents/saf/imma/imma_db.c
> --- a/osaf/libs/agents/saf/imma/imma_db.c
> +++ b/osaf/libs/agents/saf/imma/imma_db.c
> @@ -24,6 +24,8 @@
>   
> */
>   
>   #include "imma.h"
> +#include "osaf_extended_name.h"
> +
>   
> /
> Name  : imma_client_tree_init
> Description   : This routine is used to initialize the client tree
> @@ -273,6 +275,9 @@ int imma_oi_ccb_record_delete(IMMA_CLIEN
>   to_delete->mCcbErrorString = NULL;
>   }
>   
> + osaf_extended_name_free(&(to_delete->objectName));
> + osaf_extended_name_free(&(to_delete->adminOwnerName));
> +
>   free(to_delete);
>   TRACE_LEAVE();
>   return 1;
> @@ -541,6 +546,11 @@ int imma_oi_ccb_record_note_callback(IMM
>*/
>   
>   int rs = 0;
> + const SaImmAttrNameT admoNameAttr = SA_IMM_ATTR_ADMIN_OWNER_NAME;
> + SaImmAttrValuesT_2 **attr, **attributes = NULL;
> + SaImmAttrValuesT_2 *attrVal = NULL;
> + size_t attrDataSize = 0;
> +
>   struct imma_oi_ccb_record *tmp = imma_oi_ccb_record_find(cl_node, 
> ccbId);
>   
>   if(tmp && !(tmp->isAborted)) {
> @@ -553,7 +563,96 @@ int imma_oi_ccb_record_note_callback(IMM
>   rs = 1;
>   }
>   }
> + if(callback){
>   
> +
> + int noOfAttributes = 0;
> +
> + /* NOTE: The code below is practically a copy of the 

Re: [devel] [PATCH 1 of 1] imm:allow augumentCcbInit with ROF as false in completed callback[#1956] V2

2016-12-01 Thread Neelakanta Reddy
Hi Hung,

comments inline.

On 2016/12/01 03:07 PM, Hung Nguyen wrote:
> Hi Neel,
>
> Besides Zoran's comment, I have 2 more comments inline.
>
> BR,
> Hung Nguyen - DEK Technologies
>
> 
> From: Neelakanta reddyreddy.neelaka...@oracle.com
> Sent: Wednesday, November 30, 2016 12:39PM
> To: Zoran Milinkovic, Hung Nguyen
>  zoran.milinko...@ericsson.com,hung.d.ngu...@dektech.com.au
> Cc: Opensaf-devel
>  opensaf-devel@lists.sourceforge.net
> Subject: [PATCH 1 of 1] imm:allow augumentCcbInit with ROF as false in 
> completed callback[#1956] V2
>
>
>   osaf/libs/agents/saf/imma/imma_cb.h |   5 +
>   osaf/libs/agents/saf/imma/imma_db.c |  99 
> +
>   osaf/libs/agents/saf/imma/imma_oi_api.c |  60 +++
>   osaf/libs/agents/saf/imma/imma_proc.c   |  64 ++---
>   4 files changed, 133 insertions(+), 95 deletions(-)
>
>
> Two new variables objectName and adminOwnerName added to imma_oi_ccb_record. 
> For CCB create operation adminOwnerName will be added.
> For CCB delete/modify operation objectName will be added
>
> diff --git a/osaf/libs/agents/saf/imma/imma_cb.h 
> b/osaf/libs/agents/saf/imma/imma_cb.h
> --- a/osaf/libs/agents/saf/imma/imma_cb.h
> +++ b/osaf/libs/agents/saf/imma/imma_cb.h
> @@ -36,6 +36,10 @@ struct imma_oi_ccb_record {
>   struct imma_callback_info* ccbCallback;
>   SaImmHandleT privateAugOmHandle;
>   SaImmAdminOwnerHandleT privateAoHandle;
> + SaNameT objectName;/* The  Object name from the modif/delete ccb 
> operationi. The objectName is used to obtain
> + adminOnerName when saImmOiAugmentCcbInitialize is 
> called in completed-callback*/
> + SaNameT adminOwnerName; /* adminowner name of the ccb id, assigned at 
> ccb-create-callback.The adminOwnerName is used
> +saImmOiAugmentCcbInitialize is called in 
> completed-callback*/
>   };
>   
>   typedef struct imma_client_node {
> @@ -197,6 +201,7 @@ int imma_oi_ccb_record_set_critical(IMMA
>   int imma_oi_ccb_record_terminate(IMMA_CLIENT_NODE *cl_node, SaImmOiCcbIdT 
> ccbId);
>   int imma_oi_ccb_record_abort(IMMA_CLIENT_NODE *cl_node, SaImmOiCcbIdT 
> ccbId);
>   int imma_oi_ccb_record_exists(IMMA_CLIENT_NODE *cl_node, SaImmOiCcbIdT 
> ccbId);
> +struct imma_oi_ccb_record * imma_oi_ccb_record_find(IMMA_CLIENT_NODE 
> *cl_node, SaImmOiCcbIdT ccbId);
>   int imma_oi_ccb_record_set_error(IMMA_CLIENT_NODE *cl_node, SaImmOiCcbIdT 
> ccbId, const SaStringT errorString);
>   SaStringT imma_oi_ccb_record_get_error(IMMA_CLIENT_NODE *cl_node, 
> SaImmOiCcbIdT ccbId);
>   void imma_oi_ccb_allow_error_string(IMMA_CLIENT_NODE *cl_node, 
> SaImmOiCcbIdT ccbId);
> diff --git a/osaf/libs/agents/saf/imma/imma_db.c 
> b/osaf/libs/agents/saf/imma/imma_db.c
> --- a/osaf/libs/agents/saf/imma/imma_db.c
> +++ b/osaf/libs/agents/saf/imma/imma_db.c
> @@ -24,6 +24,8 @@
>   
> */
>   
>   #include "imma.h"
> +#include "osaf_extended_name.h"
> +
>   
> /
> Name  : imma_client_tree_init
> Description   : This routine is used to initialize the client tree
> @@ -273,6 +275,9 @@ int imma_oi_ccb_record_delete(IMMA_CLIEN
>   to_delete->mCcbErrorString = NULL;
>   }
>   
> + osaf_extended_name_free(&(to_delete->objectName));
> + osaf_extended_name_free(&(to_delete->adminOwnerName));
> +
>   free(to_delete);
>   TRACE_LEAVE();
>   return 1;
> @@ -541,6 +546,11 @@ int imma_oi_ccb_record_note_callback(IMM
>*/
>   
>   int rs = 0;
> + const SaImmAttrNameT admoNameAttr = SA_IMM_ATTR_ADMIN_OWNER_NAME;
> + SaImmAttrValuesT_2 **attr, **attributes = NULL;
> + SaImmAttrValuesT_2 *attrVal = NULL;
> + size_t attrDataSize = 0;
> +
>   struct imma_oi_ccb_record *tmp = imma_oi_ccb_record_find(cl_node, 
> ccbId);
>   
>   if(tmp && !(tmp->isAborted)) {
> @@ -553,7 +563,96 @@ int imma_oi_ccb_record_note_callback(IMM
>   rs = 1;
>   }
>   }
> + if(callback){
>   
> +
> + int noOfAttributes = 0;
> +
> + /* NOTE: The code below is practically a copy of the code
> +in immOm searchNext, for serving the attrValues structure.
> +This code should be factored out into some common function.
> +  */
> + IMMSV_ATTR_VALUES_LIST *p = callback->attrValues;
> + int i = 0;
> + while (p) {
> + ++noOfAttributes;
> + p = p->next;
> + }
> +
> + p = callback->attrValues;
> +
> +
> + if(cl_node->isImmA2fCbk) {
> + if(noOfAttributes) {
> + p = 

Re: [devel] [PATCH 1 of 1] imm:allow augumentCcbInit with ROF as false in completed callback[#1956] V2

2016-12-01 Thread Hung Nguyen
Hi Neel,

Besides Zoran's comment, I have 2 more comments inline.

BR,

Hung Nguyen - DEK Technologies



From: Neelakanta Reddy reddy.neelaka...@oracle.com
Sent: Wednesday, November 30, 2016 12:39PM
To: Zoran Milinkovic, Hung Nguyen
 zoran.milinko...@ericsson.com, hung.d.ngu...@dektech.com.au
Cc: Opensaf-devel
 opensaf-devel@lists.sourceforge.net
Subject: [PATCH 1 of 1] imm:allow augumentCcbInit with ROF as false in 
completed callback[#1956] V2


  osaf/libs/agents/saf/imma/imma_cb.h |   5 +
  osaf/libs/agents/saf/imma/imma_db.c |  99 
+
  osaf/libs/agents/saf/imma/imma_oi_api.c |  60 +++
  osaf/libs/agents/saf/imma/imma_proc.c   |  64 ++---
  4 files changed, 133 insertions(+), 95 deletions(-)


Two new variables objectName and adminOwnerName added to imma_oi_ccb_record. 
For CCB create operation adminOwnerName will be added.
For CCB delete/modify operation objectName will be added

diff --git a/osaf/libs/agents/saf/imma/imma_cb.h 
b/osaf/libs/agents/saf/imma/imma_cb.h
--- a/osaf/libs/agents/saf/imma/imma_cb.h
+++ b/osaf/libs/agents/saf/imma/imma_cb.h
@@ -36,6 +36,10 @@ struct imma_oi_ccb_record {
struct imma_callback_info* ccbCallback;
SaImmHandleT privateAugOmHandle;
SaImmAdminOwnerHandleT privateAoHandle;
+   SaNameT objectName;/* The  Object name from the modif/delete ccb 
operationi. The objectName is used to obtain
+   adminOnerName when saImmOiAugmentCcbInitialize is 
called in completed-callback*/
+   SaNameT adminOwnerName; /* adminowner name of the ccb id, assigned at 
ccb-create-callback.The adminOwnerName is used
+saImmOiAugmentCcbInitialize is called in 
completed-callback*/
  };
  
  typedef struct imma_client_node {
@@ -197,6 +201,7 @@ int imma_oi_ccb_record_set_critical(IMMA
  int imma_oi_ccb_record_terminate(IMMA_CLIENT_NODE *cl_node, SaImmOiCcbIdT 
ccbId);
  int imma_oi_ccb_record_abort(IMMA_CLIENT_NODE *cl_node, SaImmOiCcbIdT ccbId);
  int imma_oi_ccb_record_exists(IMMA_CLIENT_NODE *cl_node, SaImmOiCcbIdT ccbId);
+struct imma_oi_ccb_record * imma_oi_ccb_record_find(IMMA_CLIENT_NODE *cl_node, 
SaImmOiCcbIdT ccbId);
  int imma_oi_ccb_record_set_error(IMMA_CLIENT_NODE *cl_node, SaImmOiCcbIdT 
ccbId, const SaStringT errorString);
  SaStringT imma_oi_ccb_record_get_error(IMMA_CLIENT_NODE *cl_node, 
SaImmOiCcbIdT ccbId);
  void imma_oi_ccb_allow_error_string(IMMA_CLIENT_NODE *cl_node, SaImmOiCcbIdT 
ccbId);
diff --git a/osaf/libs/agents/saf/imma/imma_db.c 
b/osaf/libs/agents/saf/imma/imma_db.c
--- a/osaf/libs/agents/saf/imma/imma_db.c
+++ b/osaf/libs/agents/saf/imma/imma_db.c
@@ -24,6 +24,8 @@
  */
  
  #include "imma.h"
+#include "osaf_extended_name.h"
+
  /
Name  : imma_client_tree_init
Description   : This routine is used to initialize the client tree
@@ -273,6 +275,9 @@ int imma_oi_ccb_record_delete(IMMA_CLIEN
to_delete->mCcbErrorString = NULL;
}
  
+   osaf_extended_name_free(&(to_delete->objectName));
+   osaf_extended_name_free(&(to_delete->adminOwnerName));
+
free(to_delete);
TRACE_LEAVE();
return 1;
@@ -541,6 +546,11 @@ int imma_oi_ccb_record_note_callback(IMM
 */
  
int rs = 0;
+   const SaImmAttrNameT admoNameAttr = SA_IMM_ATTR_ADMIN_OWNER_NAME;
+   SaImmAttrValuesT_2 **attr, **attributes = NULL;
+   SaImmAttrValuesT_2 *attrVal = NULL;
+   size_t attrDataSize = 0;
+
struct imma_oi_ccb_record *tmp = imma_oi_ccb_record_find(cl_node, 
ccbId);
  
if(tmp && !(tmp->isAborted)) {
@@ -553,7 +563,96 @@ int imma_oi_ccb_record_note_callback(IMM
rs = 1;
}
}
+   if(callback){
  
+
+   int noOfAttributes = 0;
+
+   /* NOTE: The code below is practically a copy of the code
+  in immOm searchNext, for serving the attrValues structure.
+  This code should be factored out into some common function.
+*/
+   IMMSV_ATTR_VALUES_LIST *p = callback->attrValues;
+   int i = 0;
+   while (p) {
+   ++noOfAttributes;
+   p = p->next;
+   }
+
+   p = callback->attrValues;
+
+
+   if(cl_node->isImmA2fCbk) {
+   if(noOfAttributes) {
+   p = p->next;  // Skip RDN. RDN is the first 
attribute
+   noOfAttributes--;
+   }
+   }
+
+   attrDataSize = sizeof(SaImmAttrValuesT_2 *) * (noOfAttributes + 
1);
+ 

Re: [devel] [PATCH 1 of 1] imm:allow augumentCcbInit with ROF as false in completed callback[#1956] V2

2016-12-01 Thread Zoran Milinkovic
Hi Neelakanta,

Ack from me when the code is fixed.

Thanks,
Zoran

From: Neelakanta Reddy [mailto:reddy.neelaka...@oracle.com]
Sent: den 1 december 2016 10:35
To: Zoran Milinkovic ; Hung Duc Nguyen 

Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [PATCH 1 of 1] imm:allow augumentCcbInit with ROF as false in 
completed callback[#1956] V2

Hi zoran,

Yes, the code needs to be corrected for IMMA_CALLBACK_OI_CCB_COMPLETED.

Thanks,
Neel.
On 2016/12/01 02:42 PM, Zoran Milinkovic wrote:
Hi Hung,

Then the code needs to be fixed, and objectName variable can remain in the code.
Otherwise I don't see the purpose of the variable.

Thanks,
Zoran


From: Hung Nguyen [mailto:hung.d.ngu...@dektech.com.au]
Sent: den 1 december 2016 10:04
To: Zoran Milinkovic 
; 
Neelakanta Reddy 

Cc: 
opensaf-devel@lists.sourceforge.net
Subject: Re: [PATCH 1 of 1] imm:allow augumentCcbInit with ROF as false in 
completed callback[#1956] V2


Hi Zoran,



It's still needed, Neel just forgot to pass the 'object' param to 
immsv_om_augment_ccb_get_admo_name() when it's IMMA_CALLBACK_OI_CCB_COMPLETED.

'cbi->name' is not set (not usable) when it's a CcbCompletedCallback and we 
have to use 'object' param instead.



BR,

Hung Nguyen - DEK Technologies




From: Zoran Milinkovic 
zoran.milinko...@ericsson.com

Sent: Thursday, December 01, 2016 3:53PM

To: Neelakanta Reddy, Hung Nguyen

reddy.neelaka...@oracle.com, 
hung.d.ngu...@dektech.com.au

Cc: Opensaf-devel


opensaf-devel@lists.sourceforge.net

Subject: RE: [PATCH 1 of 1] imm:allow augumentCcbInit with ROF as false in 
completed callback[#1956] V2



Hi Neelakanta,



I still don't see where you use the new objectName variable.

The only place where the variable is used is:



+   if((cbi->type == IMMA_CALLBACK_OI_CCB_CREATE)|| 
((cbi->type == IMMA_CALLBACK_OI_CCB_COMPLETED) &&

+   
!osaf_is_extended_name_empty(&(ccb_oi_record->adminOwnerName{

+   admName = ccb_oi_record->adminOwnerName;

+   } else {

+   rc = getAdmoName(privateOmHandle, cbi, 
&(ccb_oi_record->objectName),);

+   }



But, if you look at getAdmoName()  function, you will see that the third 
parameter is not used in the function at all, and it implies that objectName is 
not needed as well.



Thanks,

Zoran



-Original Message-

From: Neelakanta Reddy [mailto:reddy.neelaka...@oracle.com]

Sent: den 1 december 2016 05:56

To: Zoran Milinkovic 
; Hung Duc 
Nguyen 

Cc: 
opensaf-devel@lists.sourceforge.net

Subject: Re: [PATCH 1 of 1] imm:allow augumentCcbInit with ROF as false in 
completed callback[#1956] V2



Hi Zoran,



comments inline.



On 2016/11/30 06:11 PM, Zoran Milinkovic wrote:



From: Zoran Milinkovic 
zoran.milinko...@ericsson.com

Sent: Thursday, December 01, 2016 3:53PM

To: Neelakanta Reddy, Hung Nguyen

reddy.neelaka...@oracle.com, 
hung.d.ngu...@dektech.com.au

Cc: Opensaf-devel


opensaf-devel@lists.sourceforge.net

Subject: RE: [PATCH 1 of 1] imm:allow augumentCcbInit with ROF as false in 
completed callback[#1956] V2





Hi Neelakanta,



The new objectName variable is not used in the code.

I think here you are referring to variable name.

The variable name can be changed to object.

I would rather like to see adminOwnerName as some sort of string type than 
using SaNameT. This is not an issue in the patch, only the suggestion.

The reason for this is to try to avoid using SaNameT type as much as possible, 
and replace it with SaImmAdminOwnerNameT (or other sting type).

SaStringT will be used for both object and adminOwnerName

Find other comments inline



-Original Message-

From: reddy.neelaka...@oracle.com 
[mailto:reddy.neelaka...@oracle.com]

Sent: den 30 november 2016 06:39

To: Zoran Milinkovic 
; Hung Duc 
Nguyen



Cc: 

Re: [devel] [PATCH 1 of 1] imm:allow augumentCcbInit with ROF as false in completed callback[#1956] V2

2016-12-01 Thread Neelakanta Reddy
Hi zoran,

Yes, the code needs to be corrected for IMMA_CALLBACK_OI_CCB_COMPLETED.

Thanks,
Neel.

On 2016/12/01 02:42 PM, Zoran Milinkovic wrote:
>
> Hi Hung,
>
> Then the code needs to be fixed, and objectName variable can remain in 
> the code.
>
> Otherwise I don’t see the purpose of the variable.
>
> Thanks,
>
> Zoran
>
> *From:*Hung Nguyen [mailto:hung.d.ngu...@dektech.com.au]
> *Sent:* den 1 december 2016 10:04
> *To:* Zoran Milinkovic ; Neelakanta 
> Reddy 
> *Cc:* opensaf-devel@lists.sourceforge.net
> *Subject:* Re: [PATCH 1 of 1] imm:allow augumentCcbInit with ROF as 
> false in completed callback[#1956] V2
>
> Hi Zoran,
>   
> It's still needed, Neel just forgot to pass the 'object' param to 
> immsv_om_augment_ccb_get_admo_name() when it's IMMA_CALLBACK_OI_CCB_COMPLETED.
> 'cbi->name' is not set (not usable) when it's a CcbCompletedCallback and we 
> have to use 'object' param instead.
>   
> BR,
> Hung Nguyen - DEK Technologies
>
> 
> From: Zoran milinkoviczoran.milinko...@ericsson.com 
> 
> Sent: Thursday, December 01, 2016 3:53PM
> To: Neelakanta Reddy, Hung Nguyen
>  reddy.neelaka...@oracle.com 
> ,hung.d.ngu...@dektech.com.au 
> 
> Cc: Opensaf-devel
>  opensaf-devel@lists.sourceforge.net 
> 
> Subject: RE: [PATCH 1 of 1] imm:allow augumentCcbInit with ROF as false in 
> completed callback[#1956] V2
>   
> Hi Neelakanta,
>   
> I still don't see where you use the new objectName variable.
> The only place where the variable is used is:
>   
> +   if((cbi->type == IMMA_CALLBACK_OI_CCB_CREATE)|| 
> ((cbi->type == IMMA_CALLBACK_OI_CCB_COMPLETED) &&
> +   
> !osaf_is_extended_name_empty(&(ccb_oi_record->adminOwnerName{
> +   admName = ccb_oi_record->adminOwnerName;
> +   } else {
> +   rc = getAdmoName(privateOmHandle, cbi, 
> &(ccb_oi_record->objectName),);
> +   }
>   
> But, if you look at getAdmoName()  function, you will see that the third 
> parameter is not used in the function at all, and it implies that objectName 
> is not needed as well.
>   
> Thanks,
> Zoran
>   
> -Original Message-
> From: Neelakanta Reddy [mailto:reddy.neelaka...@oracle.com]
> Sent: den 1 december 2016 05:56
> To: Zoran Milinkovic 
> ; Hung Duc 
> Nguyen 
> Cc:opensaf-devel@lists.sourceforge.net 
> 
> Subject: Re: [PATCH 1 of 1] imm:allow augumentCcbInit with ROF as false in 
> completed callback[#1956] V2
>   
> Hi Zoran,
>   
> comments inline.
>   
> On 2016/11/30 06:11 PM, Zoran Milinkovic wrote:
> 
> From: Zoran milinkoviczoran.milinko...@ericsson.com 
> 
> Sent: Thursday, December 01, 2016 3:53PM
> To: Neelakanta Reddy, Hung Nguyen
>  reddy.neelaka...@oracle.com 
> ,hung.d.ngu...@dektech.com.au 
> 
> Cc: Opensaf-devel
>  opensaf-devel@lists.sourceforge.net 
> 
> Subject: RE: [PATCH 1 of 1] imm:allow augumentCcbInit with ROF as false in 
> completed callback[#1956] V2
>   
>   
>
> Hi Neelakanta,
>
>   
>
> The new objectName variable is not used in the code.
>
> I think here you are referring to variable name.
> The variable name can be changed to object.
>
> I would rather like to see adminOwnerName as some sort of string type 
> than using SaNameT. This is not an issue in the patch, only the suggestion.
>
> The reason for this is to try to avoid using SaNameT type as much as 
> possible, and replace it with SaImmAdminOwnerNameT (or other sting type).
>
> SaStringT will be used for both object and adminOwnerName
>
> Find other comments inline
>
>   
>
> -Original Message-
>
> From:reddy.neelaka...@oracle.com   
> [mailto:reddy.neelaka...@oracle.com]
>
> Sent: den 30 november 2016 06:39
>
> To: Zoran Milinkovic 
> ; Hung Duc Nguyen
>
>  
>
> Cc:opensaf-devel@lists.sourceforge.net
> 
>
> Subject: [PATCH 1 of 1] imm:allow augumentCcbInit with ROF as false in
>
> completed callback[#1956] V2
>
>   
>
>osaf/libs/agents/saf/imma/imma_cb.h |   5 +
>

Re: [devel] [PATCH 1 of 1] imm:allow augumentCcbInit with ROF as false in completed callback[#1956] V2

2016-12-01 Thread Zoran Milinkovic
Hi Hung,

Then the code needs to be fixed, and objectName variable can remain in the code.
Otherwise I don't see the purpose of the variable.

Thanks,
Zoran


From: Hung Nguyen [mailto:hung.d.ngu...@dektech.com.au]
Sent: den 1 december 2016 10:04
To: Zoran Milinkovic ; Neelakanta Reddy 

Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [PATCH 1 of 1] imm:allow augumentCcbInit with ROF as false in 
completed callback[#1956] V2


Hi Zoran,



It's still needed, Neel just forgot to pass the 'object' param to 
immsv_om_augment_ccb_get_admo_name() when it's IMMA_CALLBACK_OI_CCB_COMPLETED.

'cbi->name' is not set (not usable) when it's a CcbCompletedCallback and we 
have to use 'object' param instead.



BR,

Hung Nguyen - DEK Technologies




From: Zoran Milinkovic 
zoran.milinko...@ericsson.com

Sent: Thursday, December 01, 2016 3:53PM

To: Neelakanta Reddy, Hung Nguyen

reddy.neelaka...@oracle.com, 
hung.d.ngu...@dektech.com.au

Cc: Opensaf-devel


opensaf-devel@lists.sourceforge.net

Subject: RE: [PATCH 1 of 1] imm:allow augumentCcbInit with ROF as false in 
completed callback[#1956] V2



Hi Neelakanta,



I still don't see where you use the new objectName variable.

The only place where the variable is used is:



+   if((cbi->type == IMMA_CALLBACK_OI_CCB_CREATE)|| 
((cbi->type == IMMA_CALLBACK_OI_CCB_COMPLETED) &&

+   
!osaf_is_extended_name_empty(&(ccb_oi_record->adminOwnerName{

+   admName = ccb_oi_record->adminOwnerName;

+   } else {

+   rc = getAdmoName(privateOmHandle, cbi, 
&(ccb_oi_record->objectName),);

+   }



But, if you look at getAdmoName()  function, you will see that the third 
parameter is not used in the function at all, and it implies that objectName is 
not needed as well.



Thanks,

Zoran



-Original Message-

From: Neelakanta Reddy [mailto:reddy.neelaka...@oracle.com]

Sent: den 1 december 2016 05:56

To: Zoran Milinkovic 
; Hung Duc 
Nguyen 

Cc: 
opensaf-devel@lists.sourceforge.net

Subject: Re: [PATCH 1 of 1] imm:allow augumentCcbInit with ROF as false in 
completed callback[#1956] V2



Hi Zoran,



comments inline.



On 2016/11/30 06:11 PM, Zoran Milinkovic wrote:



From: Zoran Milinkovic 
zoran.milinko...@ericsson.com

Sent: Thursday, December 01, 2016 3:53PM

To: Neelakanta Reddy, Hung Nguyen

reddy.neelaka...@oracle.com, 
hung.d.ngu...@dektech.com.au

Cc: Opensaf-devel


opensaf-devel@lists.sourceforge.net

Subject: RE: [PATCH 1 of 1] imm:allow augumentCcbInit with ROF as false in 
completed callback[#1956] V2





Hi Neelakanta,



The new objectName variable is not used in the code.

I think here you are referring to variable name.

The variable name can be changed to object.

I would rather like to see adminOwnerName as some sort of string type than 
using SaNameT. This is not an issue in the patch, only the suggestion.

The reason for this is to try to avoid using SaNameT type as much as possible, 
and replace it with SaImmAdminOwnerNameT (or other sting type).

SaStringT will be used for both object and adminOwnerName

Find other comments inline



-Original Message-

From: reddy.neelaka...@oracle.com 
[mailto:reddy.neelaka...@oracle.com]

Sent: den 30 november 2016 06:39

To: Zoran Milinkovic 
; Hung Duc 
Nguyen



Cc: 
opensaf-devel@lists.sourceforge.net

Subject: [PATCH 1 of 1] imm:allow augumentCcbInit with ROF as false in

completed callback[#1956] V2



  osaf/libs/agents/saf/imma/imma_cb.h |   5 +

  osaf/libs/agents/saf/imma/imma_db.c |  99 
+

  osaf/libs/agents/saf/imma/imma_oi_api.c |  60 +++

  osaf/libs/agents/saf/imma/imma_proc.c   |  64 ++---

  4 files changed, 133 insertions(+), 95 deletions(-)





Two new variables objectName and adminOwnerName added to imma_oi_ccb_record. 
For CCB create operation adminOwnerName will be added.

For CCB delete/modify operation objectName will be added

Re: [devel] [PATCH 1 of 1] imm:allow augumentCcbInit with ROF as false in completed callback[#1956] V2

2016-12-01 Thread Hung Nguyen
Hi Zoran,

It's still needed, Neel just forgot to pass the 'object' param to 
immsv_om_augment_ccb_get_admo_name() when it's IMMA_CALLBACK_OI_CCB_COMPLETED.
'cbi->name' is not set (not usable) when it's a CcbCompletedCallback and we 
have to use 'object' param instead.

BR,

Hung Nguyen - DEK Technologies



From: Zoran Milinkovic zoran.milinko...@ericsson.com
Sent: Thursday, December 01, 2016 3:53PM
To: Neelakanta Reddy, Hung Nguyen
 reddy.neelaka...@oracle.com, hung.d.ngu...@dektech.com.au
Cc: Opensaf-devel
 opensaf-devel@lists.sourceforge.net
Subject: RE: [PATCH 1 of 1] imm:allow augumentCcbInit with ROF as false in 
completed callback[#1956] V2

Hi Neelakanta,

I still don't see where you use the new objectName variable.
The only place where the variable is used is:

+   if((cbi->type == IMMA_CALLBACK_OI_CCB_CREATE)|| 
((cbi->type == IMMA_CALLBACK_OI_CCB_COMPLETED) &&
+   
!osaf_is_extended_name_empty(&(ccb_oi_record->adminOwnerName{
+   admName = ccb_oi_record->adminOwnerName;
+   } else {
+   rc = getAdmoName(privateOmHandle, cbi, 
&(ccb_oi_record->objectName),);
+   }

But, if you look at getAdmoName()  function, you will see that the third 
parameter is not used in the function at all, and it implies that objectName is 
not needed as well.

Thanks,
Zoran

-Original Message-
From: Neelakanta Reddy [mailto:reddy.neelaka...@oracle.com]
Sent: den 1 december 2016 05:56
To: Zoran Milinkovic ; Hung Duc Nguyen 

Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [PATCH 1 of 1] imm:allow augumentCcbInit with ROF as false in 
completed callback[#1956] V2

Hi Zoran,

comments inline.

On 2016/11/30 06:11 PM, Zoran Milinkovic wrote:


From: Zoran Milinkovic zoran.milinko...@ericsson.com
Sent: Thursday, December 01, 2016 3:53PM
To: Neelakanta Reddy, Hung Nguyen
 reddy.neelaka...@oracle.com, hung.d.ngu...@dektech.com.au
Cc: Opensaf-devel
 opensaf-devel@lists.sourceforge.net
Subject: RE: [PATCH 1 of 1] imm:allow augumentCcbInit with ROF as false in 
completed callback[#1956] V2


> Hi Neelakanta,
>
> The new objectName variable is not used in the code.

I think here you are referring to variable name.
The variable name can be changed to object.

> I would rather like to see adminOwnerName as some sort of string type than 
> using SaNameT. This is not an issue in the patch, only the suggestion.
> The reason for this is to try to avoid using SaNameT type as much as 
> possible, and replace it with SaImmAdminOwnerNameT (or other sting type).

SaStringT will be used for both object and adminOwnerName

> Find other comments inline
>
> -Original Message-
> From: reddy.neelaka...@oracle.com [mailto:reddy.neelaka...@oracle.com]
> Sent: den 30 november 2016 06:39
> To: Zoran Milinkovic ; Hung Duc Nguyen
> 
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: [PATCH 1 of 1] imm:allow augumentCcbInit with ROF as false in
> completed callback[#1956] V2
>
>osaf/libs/agents/saf/imma/imma_cb.h |   5 +
>osaf/libs/agents/saf/imma/imma_db.c |  99 
> +
>osaf/libs/agents/saf/imma/imma_oi_api.c |  60 +++
>osaf/libs/agents/saf/imma/imma_proc.c   |  64 ++---
>4 files changed, 133 insertions(+), 95 deletions(-)
>
>
> Two new variables objectName and adminOwnerName added to imma_oi_ccb_record. 
> For CCB create operation adminOwnerName will be added.
> For CCB delete/modify operation objectName will be added
>
> diff --git a/osaf/libs/agents/saf/imma/imma_cb.h
> b/osaf/libs/agents/saf/imma/imma_cb.h
> --- a/osaf/libs/agents/saf/imma/imma_cb.h
> +++ b/osaf/libs/agents/saf/imma/imma_cb.h
> @@ -36,6 +36,10 @@ struct imma_oi_ccb_record {
>struct imma_callback_info* ccbCallback;
>SaImmHandleT privateAugOmHandle;
>SaImmAdminOwnerHandleT privateAoHandle;
> +SaNameT objectName;/* The  Object name from the modif/delete ccb operationi. 
> The objectName is used to obtain
> +adminOnerName when saImmOiAugmentCcbInitialize is called in
> +completed-callback*/
>
> [Zoran] objectName is not used in the code. It can be removed from the
> patch

The ObjectName will be changed to "SastingT Object".
The object variable is required to store the object name in the case of 
modify/delete ccb operation

> +SaNameT adminOwnerName; /* adminowner name of the ccb id, assigned at 
> ccb-create-callback.The adminOwnerName is used
> +saImmOiAugmentCcbInitialize is called in
> +completed-callback*/
>};
>
>typedef struct imma_client_node {
> @@ -197,6 +201,7 @@ int 

Re: [devel] [PATCH 1 of 1] imm:allow augumentCcbInit with ROF as false in completed callback[#1956] V2

2016-12-01 Thread Zoran Milinkovic
Hi Neelakanta,

I still don't see where you use the new objectName variable.
The only place where the variable is used is:

+   if((cbi->type == IMMA_CALLBACK_OI_CCB_CREATE)|| 
((cbi->type == IMMA_CALLBACK_OI_CCB_COMPLETED) && 
+   
!osaf_is_extended_name_empty(&(ccb_oi_record->adminOwnerName{
+   admName = ccb_oi_record->adminOwnerName;
+   } else {
+   rc = getAdmoName(privateOmHandle, cbi, 
&(ccb_oi_record->objectName),);
+   }

But, if you look at getAdmoName()  function, you will see that the third 
parameter is not used in the function at all, and it implies that objectName is 
not needed as well.

Thanks,
Zoran

-Original Message-
From: Neelakanta Reddy [mailto:reddy.neelaka...@oracle.com] 
Sent: den 1 december 2016 05:56
To: Zoran Milinkovic ; Hung Duc Nguyen 

Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [PATCH 1 of 1] imm:allow augumentCcbInit with ROF as false in 
completed callback[#1956] V2

Hi Zoran,

comments inline.

On 2016/11/30 06:11 PM, Zoran Milinkovic wrote:
> Hi Neelakanta,
>
> The new objectName variable is not used in the code.
I think here you are referring to variable name.
The variable name can be changed to object.
> I would rather like to see adminOwnerName as some sort of string type than 
> using SaNameT. This is not an issue in the patch, only the suggestion.
> The reason for this is to try to avoid using SaNameT type as much as 
> possible, and replace it with SaImmAdminOwnerNameT (or other sting type).
SaStringT will be used for both object and adminOwnerName
>
> Find other comments inline
>
> -Original Message-
> From: reddy.neelaka...@oracle.com [mailto:reddy.neelaka...@oracle.com]
> Sent: den 30 november 2016 06:39
> To: Zoran Milinkovic ; Hung Duc Nguyen 
> 
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: [PATCH 1 of 1] imm:allow augumentCcbInit with ROF as false in 
> completed callback[#1956] V2
>
>   osaf/libs/agents/saf/imma/imma_cb.h |   5 +
>   osaf/libs/agents/saf/imma/imma_db.c |  99 
> +
>   osaf/libs/agents/saf/imma/imma_oi_api.c |  60 +++
>   osaf/libs/agents/saf/imma/imma_proc.c   |  64 ++---
>   4 files changed, 133 insertions(+), 95 deletions(-)
>
>
> Two new variables objectName and adminOwnerName added to imma_oi_ccb_record. 
> For CCB create operation adminOwnerName will be added.
> For CCB delete/modify operation objectName will be added
>
> diff --git a/osaf/libs/agents/saf/imma/imma_cb.h 
> b/osaf/libs/agents/saf/imma/imma_cb.h
> --- a/osaf/libs/agents/saf/imma/imma_cb.h
> +++ b/osaf/libs/agents/saf/imma/imma_cb.h
> @@ -36,6 +36,10 @@ struct imma_oi_ccb_record {
>   struct imma_callback_info* ccbCallback;
>   SaImmHandleT privateAugOmHandle;
>   SaImmAdminOwnerHandleT privateAoHandle;
> + SaNameT objectName;/* The  Object name from the modif/delete ccb 
> operationi. The objectName is used to obtain
> + adminOnerName when saImmOiAugmentCcbInitialize is 
> called in 
> +completed-callback*/
>
> [Zoran] objectName is not used in the code. It can be removed from the 
> patch
The ObjectName will be changed to "SastingT Object".
The object variable is required to store the object name in the case of 
modify/delete ccb operation
>
> + SaNameT adminOwnerName; /* adminowner name of the ccb id, assigned at 
> ccb-create-callback.The adminOwnerName is used
> +saImmOiAugmentCcbInitialize is called in 
> +completed-callback*/
>   };
>
>   typedef struct imma_client_node {
> @@ -197,6 +201,7 @@ int imma_oi_ccb_record_set_critical(IMMA
>   int imma_oi_ccb_record_terminate(IMMA_CLIENT_NODE *cl_node, SaImmOiCcbIdT 
> ccbId);
>   int imma_oi_ccb_record_abort(IMMA_CLIENT_NODE *cl_node, SaImmOiCcbIdT 
> ccbId);
>   int imma_oi_ccb_record_exists(IMMA_CLIENT_NODE *cl_node, 
> SaImmOiCcbIdT ccbId);
> +struct imma_oi_ccb_record * imma_oi_ccb_record_find(IMMA_CLIENT_NODE 
> +*cl_node, SaImmOiCcbIdT ccbId);
>   int imma_oi_ccb_record_set_error(IMMA_CLIENT_NODE *cl_node, SaImmOiCcbIdT 
> ccbId, const SaStringT errorString);
>   SaStringT imma_oi_ccb_record_get_error(IMMA_CLIENT_NODE *cl_node, 
> SaImmOiCcbIdT ccbId);
>   void imma_oi_ccb_allow_error_string(IMMA_CLIENT_NODE *cl_node, 
> SaImmOiCcbIdT ccbId); diff --git a/osaf/libs/agents/saf/imma/imma_db.c 
> b/osaf/libs/agents/saf/imma/imma_db.c
> --- a/osaf/libs/agents/saf/imma/imma_db.c
> +++ b/osaf/libs/agents/saf/imma/imma_db.c
> @@ -24,6 +24,8 @@
>   
> **
> ***/
>   
>   #include "imma.h"
> +#include "osaf_extended_name.h"
> +
>   
> /
> 

Re: [devel] [PATCH 1 of 1] imm:allow augumentCcbInit with ROF as false in completed callback[#1956] V2

2016-11-30 Thread Zoran Milinkovic
Hi Neelakanta,

The new objectName variable is not used in the code.
I would rather like to see adminOwnerName as some sort of string type than 
using SaNameT. This is not an issue in the patch, only the suggestion.
The reason for this is to try to avoid using SaNameT type as much as possible, 
and replace it with SaImmAdminOwnerNameT (or other sting type).

Find other comments inline

-Original Message-
From: reddy.neelaka...@oracle.com [mailto:reddy.neelaka...@oracle.com] 
Sent: den 30 november 2016 06:39
To: Zoran Milinkovic ; Hung Duc Nguyen 

Cc: opensaf-devel@lists.sourceforge.net
Subject: [PATCH 1 of 1] imm:allow augumentCcbInit with ROF as false in 
completed callback[#1956] V2

 osaf/libs/agents/saf/imma/imma_cb.h |   5 +
 osaf/libs/agents/saf/imma/imma_db.c |  99 +
 osaf/libs/agents/saf/imma/imma_oi_api.c |  60 +++
 osaf/libs/agents/saf/imma/imma_proc.c   |  64 ++---
 4 files changed, 133 insertions(+), 95 deletions(-)


Two new variables objectName and adminOwnerName added to imma_oi_ccb_record. 
For CCB create operation adminOwnerName will be added.
For CCB delete/modify operation objectName will be added

diff --git a/osaf/libs/agents/saf/imma/imma_cb.h 
b/osaf/libs/agents/saf/imma/imma_cb.h
--- a/osaf/libs/agents/saf/imma/imma_cb.h
+++ b/osaf/libs/agents/saf/imma/imma_cb.h
@@ -36,6 +36,10 @@ struct imma_oi_ccb_record {
struct imma_callback_info* ccbCallback;
SaImmHandleT privateAugOmHandle; 
SaImmAdminOwnerHandleT privateAoHandle;
+   SaNameT objectName;/* The  Object name from the modif/delete ccb 
operationi. The objectName is used to obtain
+   adminOnerName when saImmOiAugmentCcbInitialize is 
called in completed-callback*/

[Zoran] objectName is not used in the code. It can be removed from the patch

+   SaNameT adminOwnerName; /* adminowner name of the ccb id, assigned at 
ccb-create-callback.The adminOwnerName is used 
+saImmOiAugmentCcbInitialize is called in 
completed-callback*/
 };

 typedef struct imma_client_node {
@@ -197,6 +201,7 @@ int imma_oi_ccb_record_set_critical(IMMA
 int imma_oi_ccb_record_terminate(IMMA_CLIENT_NODE *cl_node, SaImmOiCcbIdT 
ccbId);
 int imma_oi_ccb_record_abort(IMMA_CLIENT_NODE *cl_node, SaImmOiCcbIdT ccbId);
 int imma_oi_ccb_record_exists(IMMA_CLIENT_NODE *cl_node, SaImmOiCcbIdT ccbId);
+struct imma_oi_ccb_record * imma_oi_ccb_record_find(IMMA_CLIENT_NODE *cl_node, 
SaImmOiCcbIdT ccbId);
 int imma_oi_ccb_record_set_error(IMMA_CLIENT_NODE *cl_node, SaImmOiCcbIdT 
ccbId, const SaStringT errorString);
 SaStringT imma_oi_ccb_record_get_error(IMMA_CLIENT_NODE *cl_node, 
SaImmOiCcbIdT ccbId);
 void imma_oi_ccb_allow_error_string(IMMA_CLIENT_NODE *cl_node, SaImmOiCcbIdT 
ccbId);
diff --git a/osaf/libs/agents/saf/imma/imma_db.c 
b/osaf/libs/agents/saf/imma/imma_db.c
--- a/osaf/libs/agents/saf/imma/imma_db.c
+++ b/osaf/libs/agents/saf/imma/imma_db.c
@@ -24,6 +24,8 @@
 */
 
 #include "imma.h"
+#include "osaf_extended_name.h"
+
 /
   Name  : imma_client_tree_init
   Description   : This routine is used to initialize the client tree
@@ -273,6 +275,9 @@ int imma_oi_ccb_record_delete(IMMA_CLIEN
to_delete->mCcbErrorString = NULL;
}
 
+   osaf_extended_name_free(&(to_delete->objectName));
+   osaf_extended_name_free(&(to_delete->adminOwnerName));
+
free(to_delete);
TRACE_LEAVE();
return 1;
@@ -541,6 +546,11 @@ int imma_oi_ccb_record_note_callback(IMM
 */
 
int rs = 0;
+   const SaImmAttrNameT admoNameAttr = SA_IMM_ATTR_ADMIN_OWNER_NAME;
+   SaImmAttrValuesT_2 **attr, **attributes = NULL;
+   SaImmAttrValuesT_2 *attrVal = NULL;
+   size_t attrDataSize = 0;
+
struct imma_oi_ccb_record *tmp = imma_oi_ccb_record_find(cl_node, 
ccbId);
 
if(tmp && !(tmp->isAborted)) {
@@ -553,7 +563,96 @@ int imma_oi_ccb_record_note_callback(IMM
rs = 1;
}
}
+   if(callback){
 
+

[Zoran] Remove extra lines

+   int noOfAttributes = 0;
+
+   /* NOTE: The code below is practically a copy of the code
+  in immOm searchNext, for serving the attrValues structure.
+  This code should be factored out into some common function.
+*/
+   IMMSV_ATTR_VALUES_LIST *p = callback->attrValues;
+   int i = 0;
+   while (p) {
+   ++noOfAttributes;
+   p = p->next;
+   }
+
+   p = callback->attrValues;
+
+
+   if(cl_node->isImmA2fCbk) {
+