Hi Hung,

Find my comments inline.


From: Hung Nguyen D
Sent: Thursday, September 17, 2015 12:00 PM
To: Zoran Milinkovic; [email protected]
Cc: [email protected]
Subject: Re: [devel] [PATCH 1 of 1] imm: classify abort error strings and 
prefix existing error strings [#744]

Hi Zoran,

Please see inline comments below.

Best Regards,

Hùng Nguyễn - DEK Technologies


________________________________

From: Zoran Milinkovic
Sent: Wednesday, September 16, 2015 9:28PM
To: Neelakanta Reddy
Cc: Opensaf-devel
Subject: [devel] [PATCH 1 of 1] imm: classify abort error strings and prefix 
existing error strings [#744]

 osaf/services/saf/immsv/immnd/ImmModel.cc  |  129 +++++++++++++++++++++++-----

 osaf/services/saf/immsv/immnd/ImmModel.hh  |    5 +

 osaf/services/saf/immsv/immnd/immnd_evt.c  |  125 ++++++++++++++++++++++++++-

 osaf/services/saf/immsv/immnd/immnd_init.h |    6 +

 4 files changed, 232 insertions(+), 33 deletions(-)





The patch set prefix "IMM:" to all error string that come from IMM.

Based on CCB abort type (resource or validation abort), error strings are 
prefixed with "IMM: Resource abort:" or "IMM: Validation abort:"





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

@@ -38,6 +38,10 @@

 #define IMMND_SEARCH_BUNDLE_SIZE ((MDS_DIRECT_BUF_MAXSIZE / 100) * 90)

 #define IMMND_MAX_SEARCH_RESULT (IMMND_SEARCH_BUNDLE_SIZE / 300)



+// Same strings exists in ImmModel.cc

+#define IMM_VALIDATION_ABORT  "IMM: Validation abort: "

+#define IMM_RESOURCE_ABORT           "IMM: Resource abort: "

+

[Hung] Can we expose these macros to saImmOm_A_2_x.h so that applications can 
use them?



[Zoran] These strings are for internal use, and make them official in public 
headers is not a good idea.

I know that it’s not the best solution to keep the same defined strings in two 
places.

These error string should be described in a document, so that applications use 
the string pattern to distinguish between two kind of aborts.





@@ -7413,14 +7503,23 @@ static void immnd_evt_proc_ccb_finalize(

               memset(&send_evt, '\0', sizeof(IMMSV_EVT));



               send_evt.type = IMMSV_EVT_TYPE_IMMA;

-              send_evt.info.imma.type = IMMA_EVT_ND2A_IMM_ERROR;

               send_evt.info.imma.info.errRsp.error = err;

+              send_evt.info.imma.info.errRsp.errStrings = NULL;

+

+              if(err == SA_AIS_OK) {

+                      send_evt.info.imma.type = IMMA_EVT_ND2A_IMM_ERROR;

+              } else {

+                      send_evt.info.imma.type = IMMA_EVT_ND2A_IMM_ERROR_2;

+                      send_evt.info.imma.info.errRsp.errStrings = 
immModel_ccbGrabErrStrings(cb, evt->info.ccbId);

+              }

[Hung] IMM_ERROR_2 should only be used when there's at least one error string.

We can't make sure that when err is not SA_AIS_OK, there will be at least one 
error string.

Please see immnd_evt_proc_object_create().



[Zoran] I will change this when I push the code



@@ -7768,11 +7871,19 @@ static void immnd_evt_proc_ccb_apply(IMM

                               memset(&send_evt, '\0', sizeof(IMMSV_EVT));

                               send_evt.type = IMMSV_EVT_TYPE_IMMA;

                               send_evt.info.imma.info.errRsp.error = err;

+                              send_evt.info.imma.info.errRsp.errStrings = NULL;

                               send_evt.info.imma.type = 
IMMA_EVT_ND2A_IMM_ERROR;



+                              if(err != SA_AIS_OK) {

+                                     send_evt.info.imma.type = 
IMMA_EVT_ND2A_IMM_ERROR_2;

+                                     send_evt.info.imma.info.errRsp.errStrings 
= immModel_ccbGrabErrStrings(cb, evt->info.objDelete.ccbId);

+                              }

+

[Hung] The same as immnd_evt_proc_ccb_finalize().



[Zoran] I will change this when I push the code



Thanks,

Zoran


------------------------------------------------------------------------------
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to