[devel] [PATCH 0 of 1] Review Request for logsv: Improve memory handling when writing log records [#1376]

2015-06-18 Thread Vu Minh Nguyen
Summary: logsv: Improve memory handling when writing log records [#1376]
Review request for Trac Ticket(s): #1376 
Peer Reviewer(s): mathi.naic...@oracle.com, lennart.l...@ericsson.com
Pull request to: lennart.l...@ericsson.com
Affected branch(es): default branch
Development branch: IF ANY GIVE THE REPO URL


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each y above):
-
 EXPLAIN/COMMENT THE PATCH SERIES HERE

changeset 805bd1b4137a62226814e25367a3e949ecf11d1c
Author: Vu Minh Nguyen vu.m.nguy...@dektech.com.au
Date:   Thu, 28 May 2015 10:35:24 +0700

logsv: Improve memory handling when writing log records [#1376]

Once having request to write log record, LOGSV allocates three separate
memories and do copying log record to there. As the result, it consumes
memory and decrease performance if log record is in big size.

With this fix, log record memory is allocated by the caller and this 
memory
is used or referred during log writing process including time-out/normal
cases.

Note that, In most cases, the caller thread is blocked until the log 
handler
thread finishs the request (e.g: writing log record to file). Therefore,
when the caller thread is unblocked, it is safe to free the log record
memory as the log handler thread no longer uses it.

But in time-out case, it is unsure when the log handler thread have 
done use
the log record memory. So, in worse case, if the log record memory is 
freed
by the main thread while the log handler is using it, it will cause the
problem.

To make sure there is no corruption of memory usage in case of 
time-out, We
leave the log record memory free to log handler thread.

It is never a good idea to allocate and free memory in different 
places. But
consider it as a trade-off to have a better performance of LOGsv as 
time-out
occurs very rarely.


Complete diffstat:
--
 osaf/services/saf/logsv/lgs/lgs_evt.c |   19 +-
 osaf/services/saf/logsv/lgs/lgs_file.c|6 ++--
 osaf/services/saf/logsv/lgs/lgs_filehdl.c |   34 ++
 osaf/services/saf/logsv/lgs/lgs_filehdl.h |7 +
 osaf/services/saf/logsv/lgs/lgs_mbcsv.c   |  106 
+++-
 osaf/services/saf/logsv/lgs/lgs_stream.c  |   40 

 6 files changed, 154 insertions(+), 58 deletions(-)


Testing Commands:
-
 Use saflogger to send alarms or other streams.


Testing, Expected Results:
--
 Log streams are writting to files successfully.


Conditions of Submission:
-
 Get ack from peer reviewers


Arch  Built StartedLinux distro
---
mipsn  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

[devel] [PATCH 1 of 1] tools: Color the failed test cases by Unit Test Framework [#1390]

2015-06-17 Thread Vu Minh Nguyen
 tests/unit_test_fw/src/utest.c |  18 --
 1 files changed, 12 insertions(+), 6 deletions(-)


If running lots of test cases, it was hard to find the failed ones
in the current fw.

With this enhancement, the fw uses red color to alert failed ones.

diff --git a/tests/unit_test_fw/src/utest.c b/tests/unit_test_fw/src/utest.c
--- a/tests/unit_test_fw/src/utest.c
+++ b/tests/unit_test_fw/src/utest.c
@@ -38,6 +38,11 @@ static unsigned int test_failed;
 
 #define NO_SUITES 64
 #define NR_TESTS 128
+
+/* Colors for test result output  */
+#define COLOR_RED \033[1;31m  /* [1 Bold font. [22 if normal font */
+#define COLOR_RESET \033[0m;
+
 static struct test testlist[NO_SUITES][NR_TESTS];
 static const char *suite_name[NO_SUITES];
 static int last_test_status;
@@ -69,7 +74,7 @@ void test_validate(SaUint32T rc, SaUint3
 else
 {
 test_failed++;
-printf(  %3d  FAILED, current_test);
+printf(%s  %3d  FAILED, COLOR_RED, current_test);
 last_test_status = -1;
 }
 
@@ -97,7 +102,7 @@ void aisrc_validate(SaAisErrorT rc, SaAi
 else
 {
 test_failed++;
-printf(  %3d  FAILED, current_test);
+printf(%s  %3d  FAILED, COLOR_RED, current_test);
 last_test_status = -1;
 }
 
@@ -129,7 +134,7 @@ void rc_validate(int rc, int expected)
 else
 {
 test_failed++;
-printf(  %3d  FAILED, current_test);
+printf(%s  %3d  FAILED, COLOR_RED, current_test);
rcstr = (rc  2) ? exit_str[rc]: other_str;
expstr = (expected  2) ? exit_str[expected]: other_str;
printf(\t(expected %s, got %s (%d)),expstr, rcstr, rc);
@@ -169,12 +174,13 @@ static int run_test_case(unsigned int su
 current_test = tcase;
 testlist[suite][tcase].testfunc();
 if (last_test_status == 0)
-printf(\t%s\n, testlist[suite][tcase].slogan);
+printf(\t%s%s\n, testlist[suite][tcase].slogan, COLOR_RESET);
 else
-printf(\t%s (expected %s, got %s)\n,
+printf(\t%s (expected %s, got %s)%s\n,
 testlist[suite][tcase].slogan, 
 get_saf_error(expectedStatus),
-get_saf_error(actualStatus));
+get_saf_error(actualStatus),
+COLOR_RESET);
 return 0;
 }
 else

--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0 of 1] Review Request for Color the failed test cases by Unit Test Framework [#1390]

2015-06-17 Thread Vu Minh Nguyen
Summary: Color the failed test cases by Unit Test Framework [#1370]
Review request for Trac Ticket(s): #1370
Peer Reviewer(s): Anders Widell anders.wid...@ericsson.com
Pull request to: lennart.l...@ericsson.com
Affected branch(es): default branch
Development branch: IF ANY GIVE THE REPO URL


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesn
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   y
 Other   n


Comments (indicate scope for each y above):
-
 EXPLAIN/COMMENT THE PATCH SERIES HERE

changeset 7c81abcbd0b3848f32a74c33c019b5eaf8141275
Author: Vu Minh Nguyen vu.m.nguy...@dektech.com.au
Date:   Wed, 17 Jun 2015 14:26:00 +0100

tools: Color the failed test cases by Unit Test Framework [#1390]

If running lots of test cases, it was hard to find the failed ones in 
the
current fw.

With this enhancement, the fw uses red color to alert failed ones.


Complete diffstat:
--
 tests/unit_test_fw/src/utest.c |  18 --
 1 files changed, 12 insertions(+), 6 deletions(-)


Testing Commands:
-
 Run test suites that use this unit test fw such as
 logtest, ntftest, etc.


Testing, Expected Results:
--
If there is failed test cases, that line is marked by red color.


Conditions of Submission:
-
 Get ack from peer reviewer(s)


Arch  Built StartedLinux distro
---
mipsn  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.


--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0 of 1] Review Request for ntftest: ntftest suite 22 test 3 fails [#1379]

2015-06-01 Thread Vu Minh Nguyen
Summary: ntftest: Fix ntftest suite 22 test 3 fails [#1379]
Review request for Trac Ticket(s): #1379
Peer Reviewer(s): praveen.malv...@oracle.com, lennart.l...@ericsson.com
Pull request to: lennart.l...@ericsson.com
Affected branch(es): 4.5, 4.6, default
Development branch: IF ANY GIVE THE REPO URL


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesn
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   y
 Other   n


Comments (indicate scope for each y above):
-

changeset 415e9e29422dbaba2a14e68042712f770a68ed55
Author: Vu Minh Nguyen vu.m.nguy...@dektech.com.au
Date:   Mon, 01 Jun 2015 13:27:16 +0700

ntftest: Fix ntftest suite 22 test 3 fails [#1379]

Test suite 22 test 3 invokes the test script
tests/ntfsv/ntf_search_criteria_test.sh. This script then passed an 
invalid
non-option `return` to ntfread tool.

This fix removed that non-option and also unused variable id.


Complete diffstat:
--
 tests/ntfsv/ntf_search_criteria_test.sh |  3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)


Testing Commands:
-
Run the test suite below:
# ntftest 22 3


Testing, Expected Results:
--
# ntftest 22 3

Suite 22: Consumer operations - Reader API 3
3  PASSED   saNtfSearchCriteriaT test all

=

   Test Result:
  Total:  1
  Passed: 1
  Failed: 0


Conditions of Submission:
-
 Ack from peer reviewers


Arch  Built StartedLinux distro
---
mipsn  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.


--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 1 of 1] ntftest: Fix ntftest suite 22 test 3 fails [#1379]

2015-06-01 Thread Vu Minh Nguyen
 tests/ntfsv/ntf_search_criteria_test.sh |  3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)


Test suite 22 test 3 invokes the test script 
tests/ntfsv/ntf_search_criteria_test.sh.
This script then passed an invalid non-option `return` to ntfread tool.

This fix removed that non-option and also unused variable id.

diff --git a/tests/ntfsv/ntf_search_criteria_test.sh 
b/tests/ntfsv/ntf_search_criteria_test.sh
--- a/tests/ntfsv/ntf_search_criteria_test.sh
+++ b/tests/ntfsv/ntf_search_criteria_test.sh
@@ -46,8 +46,7 @@ read_marked()
 expected_sequence=$1
 sc=$2 #search criteria
 sd=$3 #search direction
-id=$4return
-last=`ntfread -v $3 -b $sc -E 4 $id -n $testMark|grep -i eventtime|awk 
'{ print $3}'`
+last=`ntfread -v $3 -b $sc -E 4 -n $testMark|grep -i eventtime|awk '{ 
print $3}'`
 res=`echo $last|sed -n 's/\(.*\)$/\1 /p'`
 ver  result   :  \$res\
 ver  expected_sequence:  \$expected_sequence\

--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1 of 1] ntftool: ntfread and ntfsubscribe do not check invalid options [#1355]

2015-05-20 Thread Vu Minh Nguyen
Hi Praveen,

Thanks for your comments.  

But `ntfread -g` prints whole usage also.
I will update the code to make it show following format for invalid options.

E.g:
# ntfread -g
ntfread: invalid option -- 'g'
Try 'ntfread -h' for more information.

Please let me know your opinions. 

Regards,
Vu


-Original Message-
From: praveen malviya [mailto:praveen.malv...@oracle.com]
Sent: Wednesday, May 20, 2015 7:26 PM
To: Vu Minh Nguyen; minh.c...@dektech.com.au; lennart.l...@ericsson.com
Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [PATCH 1 of 1] ntftool: ntfread and ntfsubscribe do not check
invalid options [#1355]

I think one minor change is still required as:

`ntfread g`  gives:

Invalid non-option:
g
Try 'ntfread -h' for more information.

But `ntfread -g` prints whole usage also.

Please confirm.

Thanks
Praveen

On 05-May-15 11:38 AM, Vu Minh Nguyen wrote:
   osaf/tools/safntf/ntfread/ntfread.c   |   7 +++
   osaf/tools/safntf/ntfsubscribe/ntfsubscribe.c |  13 -
   2 files changed, 19 insertions(+), 1 deletions(-)


 ntfread/ntfsubscribe do not check invalid options.

 Add code to show invalid options to user.

 diff --git a/osaf/tools/safntf/ntfread/ntfread.c
 b/osaf/tools/safntf/ntfread/ntfread.c
 --- a/osaf/tools/safntf/ntfread/ntfread.c
 +++ b/osaf/tools/safntf/ntfread/ntfread.c
 @@ -357,6 +357,13 @@ int main(int argc, char *argv[]) {
  }
  }

 +if (optind  argc){
 +fprintf(stderr, Invalid non-option: \n);
 +while (optind  argc)
 +fprintf(stderr, %s \n, argv[optind++]);
 +fprintf(stderr, Try '%s -h' for more information. \n,
argv[0]);
 +exit(EXIT_FAILURE);
 +}
  rc = saNtfInitialize(ntfHandle, ntfCallbacks, version);
  if (SA_AIS_OK != rc) {
  fprintf(stderr, saNtfInitialize failed - %s\n, diff --git
 a/osaf/tools/safntf/ntfsubscribe/ntfsubscribe.c
 b/osaf/tools/safntf/ntfsubscribe/ntfsubscribe.c
 --- a/osaf/tools/safntf/ntfsubscribe/ntfsubscribe.c
 +++ b/osaf/tools/safntf/ntfsubscribe/ntfsubscribe.c
 @@ -198,7 +198,6 @@ static void usage(void)
  printf(  -y or --securityAlarm subscribe for
only
securityAlarm notifications\n);
  printf(  -h or --help  this help\n);
  printf(  -v or --verbose   print even
more\n);
 -exit((int)SA_AIS_ERR_INVALID_PARAM);
   }

   static void freeNtfFilter(SaNtfNotificationFilterHandleT *fh_ptr) @@
 -403,13 +402,25 @@ int main(int argc, char *argv[])
  verbose = 1;
  break;
  case 'h':
 +usage();
 +exit(EXIT_SUCCESS);
 +break;
  case '?':
  default:
  usage();
 +exit(EXIT_FAILURE);
  break;
  }
  }

 +if (optind  argc){
 +fprintf(stderr, Invalid non-option: \n);
 +while (optind  argc)
 +fprintf(stderr, %s \n, argv[optind++]);
 +fprintf(stderr, Try '%s -h' for more information. \n,
argv[0]);
 +exit(EXIT_FAILURE);
 +}
 +
  error = saNtfInitialize(ntfHandle, ntfCallbacks, version);
  if (SA_AIS_OK != error) {
  fprintf(stderr, saNtfInitialize failed - %s\n,
 error_output(error));



--
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0 of 1] Review Request for LOG: Unnable to rename cfg file when changing saLogStreamFileName attribute [#1346]

2015-05-06 Thread Vu Minh Nguyen
Summary: LOG: Unable to rename cfg file when changing saLogStreamFileName 
attribute [#1346]
Review request for Trac Ticket(s): #1346
Peer Reviewer(s): mathi.naic...@oracle.com, lennart.l...@ericsson.com
Pull request to: lennart.l...@ericsson.com
Affected branch(es): 4.5, 4.6, default
Development branch: IF ANY GIVE THE REPO URL


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each y above):
-

changeset 74a57dba79d6009094c109e30bdb05dab547099b
Author: Vu Minh Nguyen vu.m.nguy...@dektech.com.au
Date:   Wed, 06 May 2015 07:47:05 +0100

LOG: Fix unable to rename cfg file when changing saLogStreamFileName
attribute [#1346]

As expectation, LOG server should close the old cfg file and opening log
file, then creating new cfg/log files. But It failed to rename the
configuration file.

The cause is that the LOGsv does update stream log file name before it
requests to close old stream log. As the result, it got failed to find 
such
configuration file in system.


Complete diffstat:
--
 osaf/services/saf/logsv/lgs/lgs_imm.c |  36 
+---
 1 files changed, 29 insertions(+), 7 deletions(-)


Testing Commands:
-
 I will release the update for LOG test suite (suite 4, test case #1).
 Rebuild the test suit, copy the binary to correct path and 
 run test suite as below to verify the patch:

 logtest 4 1


Testing, Expected Results:
--
Suite 4: LOG OI tests, stream objects
1  PASSED   CCB Object Modify saLogStreamFileName

=

   Test Result:
  Total:  1
  Passed: 1
  Failed: 0



Conditions of Submission:
-
 Ack from peer reviewers


Arch  Built StartedLinux distro
---
mipsn  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.


--
One dashboard for servers and applications across

[devel] [PATCH 1 of 1] LOG: Fix unable to rename cfg file when changing saLogStreamFileName attribute [#1346]

2015-05-06 Thread Vu Minh Nguyen
 osaf/services/saf/logsv/lgs/lgs_imm.c |  36 --
 1 files changed, 29 insertions(+), 7 deletions(-)


As expectation, LOG server should close the old cfg file and  opening log file,
then creating new cfg/log files. But It failed to rename the configuration file.

The cause is that the LOGsv does update stream log file name before it requests
to close old stream log. As the result, it got failed to find such configuration
file in system.

diff --git a/osaf/services/saf/logsv/lgs/lgs_imm.c 
b/osaf/services/saf/logsv/lgs/lgs_imm.c
--- a/osaf/services/saf/logsv/lgs/lgs_imm.c
+++ b/osaf/services/saf/logsv/lgs/lgs_imm.c
@@ -2215,6 +2215,8 @@ static void stream_ccb_apply_modify(cons
bool new_cfg_file_needed = false;
int n = 0;
struct timespec curtime_tspec;
+   char *fileName;
+   bool logStreamFileName_modify = false;
 
TRACE_ENTER2(CCB ID %llu, '%s', opdata-ccbId, 
opdata-objectName.value);
 
@@ -2237,13 +2239,8 @@ static void stream_ccb_apply_modify(cons
value = attribute-attrValues[0];
 
if (!strcmp(attribute-attrName, saLogStreamFileName)) {
-   char *fileName = *((char **)value);
-   n = snprintf(stream-fileName, NAME_MAX, %s, 
fileName);
-   if (n = NAME_MAX) {
-   LOG_ER(Error: b. File name  NAME_MAX);
-   osafassert(0);
-   }
-   new_cfg_file_needed = true;
+   fileName = *((char **)value);
+   logStreamFileName_modify = true;
} else if (!strcmp(attribute-attrName, 
saLogStreamMaxLogFileSize)) {
SaUint64T maxLogFileSize = *((SaUint64T *)value);
stream-maxLogFileSize = maxLogFileSize;
@@ -2291,6 +2288,31 @@ static void stream_ccb_apply_modify(cons
}
}
 
+   /* Fix for ticket #1346 */
+   if (logStreamFileName_modify) {
+   int rc;
+   if ((rc = log_stream_config_change(!LGS_STREAM_CREATE_FILES, 
stream,
+  current_logfile_name, 
cur_time))
+   != 0) {
+   LOG_ER(log_stream_config_change failed: %d, rc);
+   }
+
+   n = snprintf(stream-fileName, NAME_MAX, %s, fileName);
+   if (n = NAME_MAX) {
+   LOG_ER(Error: File name (%zu)  NAME_MAX (%d), 
strlen(fileName), (int) NAME_MAX);
+   osafassert(0);
+   }
+   if ((rc = lgs_create_config_file_h(stream)) != 0) {
+   LOG_ER(lgs_create_config_file_h failed: %d, rc);
+   }
+
+   char *current_time = lgs_get_time(cur_time);
+   sprintf(stream-logFileCurrent, %s_%s, stream-fileName, 
current_time);
+
+   // Create the new log file based on updated configuration
+   *stream-p_fd = log_file_open(stream, stream-logFileCurrent, 
NULL);
+   }
+
/* Checkpoint to standby LOG server */
/* Save time change was done for standby */
stream-act_last_close_timestamp = cur_time;

--
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0 of 1] Review Request for ntftools: ntfread and ntfsubscribe do not check invalid options [#1355]

2015-05-05 Thread Vu Minh Nguyen
Summary: ntftools: ntfread and ntfsubscribe do not check invalid options [#1355]
Review request for Trac Ticket(s): #1355
Peer Reviewer(s): praveen.malv...@oracle.com, minh.c...@dektech.com.au, 
lennart.l...@ericsson.com
Pull request to: lennart.l...@ericsson.com
Affected branch(es): 4.5, 4.6, default
Development branch: IF ANY GIVE THE REPO URL


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each y above):
-
 EXPLAIN/COMMENT THE PATCH SERIES HERE

changeset 9982d7c77ad9a1ca265a31d99af0354fafd626a8
Author: Vu Minh Nguyen vu.m.nguyu...@dektech.com.au
Date:   Tue, 05 May 2015 05:14:44 +0100

ntftool: ntfread and ntfsubscribe do not check invalid options [#1355]

ntfread/ntfsubscribe do not check invalid options.

Add code to show invalid options to user.


Complete diffstat:
--
 osaf/tools/safntf/ntfread/ntfread.c   |   7 +++
 osaf/tools/safntf/ntfsubscribe/ntfsubscribe.c |  13 -
 2 files changed, 19 insertions(+), 1 deletions(-)


Testing Commands:
-
 ntfread abc def
 ntfsubscribe abc def


Testing, Expected Results:
--
 # ntfread abc def
 Invalid non-option: 
 abc 
 def 
 Try 'ntfread -h' for more information. 
 # 
 # ntfsubscribe abc def
 Invalid non-option: 
 abc 
 def 
 Try 'ntfsubscribe -h' for more information.


Conditions of Submission:
-
 Ack from peer reviewers.


Arch  Built StartedLinux distro
---
mipsn  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.


--
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https

[devel] [PATCH 1 of 1] ntftool: ntfread and ntfsubscribe do not check invalid options [#1355]

2015-05-05 Thread Vu Minh Nguyen
 osaf/tools/safntf/ntfread/ntfread.c   |   7 +++
 osaf/tools/safntf/ntfsubscribe/ntfsubscribe.c |  13 -
 2 files changed, 19 insertions(+), 1 deletions(-)


ntfread/ntfsubscribe do not check invalid options.

Add code to show invalid options to user.

diff --git a/osaf/tools/safntf/ntfread/ntfread.c 
b/osaf/tools/safntf/ntfread/ntfread.c
--- a/osaf/tools/safntf/ntfread/ntfread.c
+++ b/osaf/tools/safntf/ntfread/ntfread.c
@@ -357,6 +357,13 @@ int main(int argc, char *argv[]) {
}
}
 
+   if (optind  argc){
+   fprintf(stderr, Invalid non-option: \n);
+   while (optind  argc)
+   fprintf(stderr, %s \n, argv[optind++]);
+   fprintf(stderr, Try '%s -h' for more information. \n, 
argv[0]);
+   exit(EXIT_FAILURE);
+   }
rc = saNtfInitialize(ntfHandle, ntfCallbacks, version);
if (SA_AIS_OK != rc) {
fprintf(stderr, saNtfInitialize failed - %s\n,
diff --git a/osaf/tools/safntf/ntfsubscribe/ntfsubscribe.c 
b/osaf/tools/safntf/ntfsubscribe/ntfsubscribe.c
--- a/osaf/tools/safntf/ntfsubscribe/ntfsubscribe.c
+++ b/osaf/tools/safntf/ntfsubscribe/ntfsubscribe.c
@@ -198,7 +198,6 @@ static void usage(void)
printf(  -y or --securityAlarm subscribe for only 
securityAlarm notifications\n);
printf(  -h or --help  this help\n);
printf(  -v or --verbose   print even more\n);
-   exit((int)SA_AIS_ERR_INVALID_PARAM);
 }
 
 static void freeNtfFilter(SaNtfNotificationFilterHandleT *fh_ptr)
@@ -403,13 +402,25 @@ int main(int argc, char *argv[])
verbose = 1;
break;
case 'h':
+   usage();
+   exit(EXIT_SUCCESS);
+   break;
case '?':
default:
usage();
+   exit(EXIT_FAILURE);
break;
}
}
 
+   if (optind  argc){
+   fprintf(stderr, Invalid non-option: \n);
+   while (optind  argc)
+   fprintf(stderr, %s \n, argv[optind++]);
+   fprintf(stderr, Try '%s -h' for more information. \n, 
argv[0]);
+   exit(EXIT_FAILURE);
+   }
+
error = saNtfInitialize(ntfHandle, ntfCallbacks, version);
if (SA_AIS_OK != error) {
fprintf(stderr, saNtfInitialize failed - %s\n, 
error_output(error));

--
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 1 of 1] LOG: log_stream_config_change() renames files successfully, but makes return (-1) [#1366]

2015-05-04 Thread Vu Minh Nguyen
 osaf/services/saf/logsv/lgs/lgs_stream.c |  6 +-
 1 files changed, 5 insertions(+), 1 deletions(-)


Callers will invoke log_stream_config_chang() @ lgs_stream.c in two cases:
1. Request for old file closing and creating new files if create_files_f 
parameter sets to TRUE.
2. Just request for closing old files if create_files_f parameter sets to FALSE.

In second case, that is correct to have fd closed (-1).
So, make a value-returned judgment based on fd for all cases is not suitabe.

diff --git a/osaf/services/saf/logsv/lgs/lgs_stream.c 
b/osaf/services/saf/logsv/lgs/lgs_stream.c
--- a/osaf/services/saf/logsv/lgs/lgs_stream.c
+++ b/osaf/services/saf/logsv/lgs/lgs_stream.c
@@ -1507,7 +1507,11 @@ int log_stream_config_change(bool create
*stream-p_fd = log_file_open(stream, 
stream-logFileCurrent,NULL);
}
 
-   if (*stream-p_fd == -1) {
+   /* Fix bug - this function makes return (-1) when create_files_f = 
false */
+   if (create_files_f == !LGS_STREAM_CREATE_FILES){
+   rc = 0;
+   }
+   else if (*stream-p_fd == -1) {
rc = -1;
} else {
rc = 0;

--
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0 of 1] Review Request for LOG: log_stream_config_change() renames files successfully, but makes return (-1) [#1366]

2015-05-04 Thread Vu Minh Nguyen
Summary: LOG: log_stream_config_change() renames files successfully, but makes 
return (-1) [#1366]
Review request for Trac Ticket(s): #1366
Peer Reviewer(s): mathi.naic...@oracle.com
Pull request to: lennart.l...@ericsson.com
Affected branch(es): 4.5, 4.6, default
Development branch: IF ANY GIVE THE REPO URL


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each y above):
-
 

changeset 61c1f53421e75072237ccde88fac3331dd058cf4
Author: Vu Minh Nguyen vu.m.nguyu...@dektech.com.au
Date:   Mon, 04 May 2015 09:34:12 +0100

LOG: log_stream_config_change() renames files successfully, but makes 
return
(-1) [#1366]

Callers will invoke log_stream_config_chang() @ lgs_stream.c in two 
cases:
1. Request for old file closing and creating new files if create_files_f
parameter sets to TRUE. 2. Just request for closing old files if
create_files_f parameter sets to FALSE.

In second case, that is correct to have fd closed (-1). So, make a 
value-
returned judgment based on fd for all cases is not suitabe.


Complete diffstat:
--
 osaf/services/saf/logsv/lgs/lgs_stream.c |  6 +-
 1 files changed, 5 insertions(+), 1 deletions(-)


Testing Commands:
-
 Change logRootDirectory attribute, using immcfg command as below example:
immcfg -a logRootDirectory=/repl_opensaf/saflog_1 
logConfig=1,safApp=safLogService


Testing, Expected Results:
--
 The following output is not found in trace log (e.g: osaflogd)
ER Old log files could not be renamed and closed for stream:


Conditions of Submission:
-
 HOW MANY DAYS BEFORE PUSHING, CONSENSUS ETC


Arch  Built StartedLinux distro
---
mipsn  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.


--
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports

[devel] [PATCH 1 of 1] ntftools: fix ntfsend says --help option is not recognized [#1352]

2015-05-04 Thread Vu Minh Nguyen
 osaf/tools/safntf/ntfsend/ntfsend.c |  10 --
 1 files changed, 8 insertions(+), 2 deletions(-)


The command ntfsend says the --help option is not recognized,
even though it actually does print a help text when given this option.

This defect occurs as there is no options [--help|-h] supported.

Add [--help|-h] to support the option.

diff --git a/osaf/tools/safntf/ntfsend/ntfsend.c 
b/osaf/tools/safntf/ntfsend/ntfsend.c
--- a/osaf/tools/safntf/ntfsend/ntfsend.c
+++ b/osaf/tools/safntf/ntfsend/ntfsend.c
@@ -928,6 +928,7 @@ int main(int argc, char *argv[])
{eventTime, required_argument, 0, 'E'},
{burstTimeout, required_argument, 0, 'b'},
{additionalInfo, required_argument, 0, 'i'},
+   {help, no_argument, 0, 'h'},
{0, 0, 0, 0}
};
 
@@ -943,7 +944,7 @@ int main(int argc, char *argv[])
 
if (argc = 1) {
/* Check options */
-   while ((current_option = getopt_long(argc, argv, 
a:c:e:E:N:n:p:r:s:b:T:i:, long_options, NULL)) != -1) {
+   while ((current_option = getopt_long(argc, argv, 
a:c:e:E:N:n:p:r:s:b:T:i:h, long_options, NULL)) != -1) {
optionFlag = SA_TRUE;
switch (current_option) {
case 'a':
@@ -1055,15 +1056,20 @@ int main(int argc, char *argv[])
(void)printf(Invalid Option\n);
usage();
break;
+   case 'h':
+   usage();
+   exit(EXIT_SUCCESS);
+   break;
default:
usage();
break;
}
}
if (optind  argc) {
-   fprintf(stderr, non-option ARGV-elements: );
+   fprintf(stderr, Invalid option: \n);
while (optind  argc)
fprintf(stderr, %s \n, argv[optind++]);
+   fprintf(stderr, Try '%s -h' for more information. \n, 
argv[0]);
exit(EXIT_FAILURE);
}
if ((optionFlag == SA_FALSE)  (argc = 3)) {

--
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0 of 1] Review Request for ntftools: ntfsend says --help option is not recognized [#1352]

2015-05-04 Thread Vu Minh Nguyen
Summary: ntftools: ntfsend says --help option is not recognized [#1352]
Review request for Trac Ticket(s): #1352
Peer Reviewer(s): praveen.malv...@oracle.com, minh.c...@dektech.com.au, 
lennart.l...@ericsson.com
Pull request to: lennart.l...@ericsson.com
Affected branch(es): 4.5, 4.6, default 
Development branch: IF ANY GIVE THE REPO URL


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each y above):
-

changeset 2099a928d026d5540e9287ee5eb666ec24678a6e
Author: Vu Minh Nguyen vu.m.nguyu...@dektech.com.au
Date:   Tue, 05 May 2015 03:04:31 +0100

ntftools: fix ntfsend says --help option is not recognized [#1352]

The command ntfsend says the --help option is not recognized, even 
though it
actually does print a help text when given this option.

This defect occurs as there is no options [--help|-h] supported.

Add [--help|-h] to show the command usage.


Complete diffstat:
--
 osaf/tools/safntf/ntfsend/ntfsend.c |  10 --
 1 files changed, 8 insertions(+), 2 deletions(-)


Testing Commands:
-
 Enter following commands:
 ntfsend -h
 ntfsend --help


Testing, Expected Results:
--
ntfsend -h

NAME
ntfsend - send notification(s)

SYNOPSIS
ntfsend [-s  perceivedSeverity]

DESCRIPTION
ntfsend is a SAF NTF client used to send a notification.


Conditions of Submission:
-
 Ack from peer reviewers 


Arch  Built StartedLinux distro
---
mipsn  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.


--
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
___
Opensaf-devel mailing list
Opensaf

<    2   3   4   5   6   7