[devel] Announcement: OpenSAF policy on limits

2013-06-25 Thread Anders Widell
 the OpenSAF limits have been configured to be larger
than default.

Fixed-size buffers
-

Prefer to use dynamically allocated buffers of variable size instead
of fixed-size buffers. In C++, this is easy: use std::string or
std::vector. In C, you can use malloc() to dynamically allocate a
buffer. A fixed-size buffer may be sufficient for internal data that
is only used within OpenSAF, for example as a scratch buffer for
formatting a log message. But if the buffer contains application data,
or if it contains something that can be configured, for example a
path, then it is better to use a variable-size buffer. Using
variable-size buffers will in general also be more memory efficient,
since the buffer will only be as large as needed.

Deprecated operating system interfaces
--

Operating system interfaces can also have limits, and in many cases
there is a new variant of the same interface where the limit has been
removed. Prefer to use these newer variants; it is usually not more
difficult than using the old ones, and sometimes easier. Some
examples:

* Use epoll() or poll() instead of select(). Otherwise we are limited
   to a maximum of 1024 file handles. This is especially important when
   writing code that will be used in an agent library, since it
   executes in the same process as an application program.

* Use thread-safe variants (normally ending with the _r suffix) where
   available. E.g. use localtime_r() instead of localtime(). Otherwise
   we are limited to single-threaded programs. This is especially
   important when writing code that will be used in an agent library,
   since it executes in the same process as an application program.

* Use fseeko() and ftello() instead of fseek() and ftell(). Otherwise
   file size is limited to 2 gigabytes on 32-bit systems. For the same
   reason, also make sure that the macro _LARGEFILE_SOURCE is defined.

* When using functions for IP communication, use the newer variants
   that support both IPv4 and IPv6 instead of the old ones that only
   support IPv4. E.g. use inet_pton() instead inet_aton() or
   inet_addr().  Otherwise we are limited to using IPv4 addresses only.

* Prefer the functions sysconf(), pathconf() and getrlimit() over the
   corresponding macros for reading system limits. E.g. use
   sysconf(_SC_HOST_NAME_MAX) instead of HOST_NAME_MAX, and
   pathconf(_PC_PATH_MAX) instead of PATH_MAX. This is mainly a
   portability issue since POSIX does not require these limit to be
   fixed, and the macros are not required to be defined.

Inefficient algorithms
--

Even though it may not cause a theoretical limit, the use of
inefficient algorithms and data structures may in practice have the
effect that the limits cannot be increased since the system would
become too slow. Prefer to use efficient algorithms and design the
code so that it is scalable. For example, use a tree data structure or
a hash table instead of using linear search in a linked list. In C++,
this is easy: just switch to a different container type. std::set and
std::map provide tree data structures, and std::unordered_set and
std::unordered_map provide provide hash tables.

regards,
Anders Widell


--
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] OpenSAF 4.2.4RC1 and 4.3.1RC1 Tagged and Available for Download

2013-07-26 Thread Anders Widell
OpenSAF 4.2.4RC1 and 4.3.1RC1 have been tagged, and the archives 
http://sourceforge.net/projects/opensaf/files/testing/opensaf-4.2.4RC1.tar.gz/download
 
and 
http://sourceforge.net/projects/opensaf/files/testing/opensaf-4.3.1RC1.tar.gz/download
 
are available for download.

Please test these release candidates and report any problems found. We 
are aiming to release OpenSAF 4.2.4 and 4.3.1 in the beginning of August.

regards,
Anders Widell


--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] AMF static code analysis regression in 4.2.4 and 4.3.1

2013-07-29 Thread Anders Widell
Hi!

I ran some static code analysis on the release candidates for OpenSAF 
4.2.4 and 4.3.1. I got a few regressions towards 4.2.3 and 4.3.0, and I 
need your help to analyze the following in avd_sgproc.c. The warning 
says that i_su-list_of_susi is used after free(). It is freed by 
m_AVD_SU_SI_TRG_DEL(), and then dereferenced by avd_compcsi_delete() in 
the next iteration.

When I look at the code, I don't understand it at all. Does this loop 
below terminate? The loop terminates when i_su-list_of_susi is NULL, 
but it is not modified within the loop body! If the loop terminates, it 
must be because i_su-list_of_susi is somehow modified as a side-effect 
of calling avd_compcsi_delete() or m_AVD_SU_SI_TRG_DEL(). This is a very 
ugly way coding!!!

Line 1398 - 1408 in osaf/services/saf/avsv/avd/avd_sgproc.c on branch 
opensaf-4.3.x (tag 4.3.1RC1):
-
 /* Free all the SU SI assignments for all the SIs on the
  * the SU if there are any.
  */

 while (i_su-list_of_susi != AVD_SU_SI_REL_NULL) {

 /* free all the CSI assignments  */
 avd_compcsi_delete(cb, i_su-list_of_susi, false);
 /* Unassign the SUSI */
 m_AVD_SU_SI_TRG_DEL(cb, i_su-list_of_susi);
 }
-

regards,
Anders Widell


--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] AMF static code analysis regression in 4.2.4 and 4.3.1

2013-07-30 Thread Anders Widell
Hi Nagu, and thanks for your explanation.

Yes I agree now that this looks like a false positive. However, the code 
is fairly complicated and I think it is a good candidate for refactoring 
in the 4.4 branch. ;-)

The initial problem I had with understanding the loop was the unexpected 
side effect:

while (i_su-list_of_susi != AVD_SU_SI_REL_NULL) {

/* free all the CSI assignments  */

avd_compcsi_delete(cb, i_su-list_of_susi, false);

/* Unassign the SUSI */

m_AVD_SU_SI_TRG_DEL(cb, i_su-list_of_susi);

}

If you look at the code above, it is not obvious that it will terminate. 
i_su-list_of_susi is checked in the loop condition, but it is not 
modified anywhere within the loop body. Furthermore, both function calls 
inside the loop body take i_su-list_of_susi as a parameter, and since 
parameters are passed by value in C, I would not expect any of the 
functions to modify the value of the pointer i_su-list_of_susi itself. 
It would have been more natural if the functions had taken i_su as a 
parameter, then I could perfectly well expect the functions to modify 
i_su-list_of_susi. Apparently, the data structures contain back 
pointers that point back to the data structure they belong to, and this 
is how the functions are able to modify i_su. These back-pointers are 
essentially redundant, and I don't think it is a good design - it makes 
the code is hard to follow. Indeed, this is probably the reason why the 
static code analysis tool thinks there is a use-after-free bug here.

regards,
Anders Widell

2013-07-30 06:45, Nagendra Kumar skrev:

 Hi,

 Just briefing it so that we are all on the same page:

 Let us say, SU1 has three SIs(SI1, SI2 and SI3) assigned and 
 i_su-list_of_susi pointer points to



   


 i_su-list_of_susi à NULL

 while (i_su-list_of_susi != AVD_SU_SI_REL_NULL) {

 /* free all the CSI assignments  */

 avd_compcsi_delete(cb, i_su-list_of_susi, false);

 /* Unassign the SUSI */

 m_AVD_SU_SI_TRG_DEL(cb, i_su-list_of_susi);

 }

 First iteration of above code :

 1.avd_compcsi_delete deletes comp csi of SUSI1 from list_of_csicomp.

 2.m_AVD_SU_SI_TRG_DEL calls avd_susi_delete(SUSI1). After below line 
 of execution, p_su_si is null and i_su_si points to SUSI1.

 /* check the SU list to get the prev pointer */

 i_su_si = susi-su-list_of_susi;

 p_su_si = NULL;

 while ((i_su_si != NULL)  (i_su_si != susi)) {

 p_su_si = i_su_si;

 i_su_si = i_su_si-su_next;

 }

 3.Now, the below lines of code executes.

 /* now delete it from the SU list */

 if (p_su_si == NULL) {

  susi-su-list_of_susi = susi-su_next;

 susi-su_next = NULL;

 } else {

 p_su_si-su_next = susi-su_next;

 susi-su_next = NULL;

 }

 After this line of execution, i_su-list_of_susi points to SUSI2. And 
 SUSI1-next is NULL now (Earlier SUSI1-next was set to SUSI2).

 4.After below lines of execution, SUSI1-si is null and SUSI1-su is null.

 susi-si = NULL;

 susi-su = NULL;

 5.The below line free SUSI1.

 free(susi);

 6.At this state the link list is as below:



   


 i_su-list_of_susi à NULL

 Next time, when while loop executes, SUSI2 will be deleted and after 
 third iteration, SUSI3 will be deleted and i_su-list_of_susi will be 
 null and while loop will exit.

 Let me know if any further clarification is needed.

 Thanks

 -Nagu

 -Original Message-
 From: Anders Widell [mailto:anders.wid...@ericsson.com]
 Sent: 29 July 2013 20:16
 To: opensaf-devel@lists.sourceforge.net
 Cc: Nagendra Kumar; Hans Feldt; praveen malviya; UABHANO
 Subject: Re: [devel] AMF static code analysis regression in 4.2.4 and 
 4.3.1

 I assume the side effect that modifies the variable i_su-list_of_susi 
 in the loop conditional happens at the following lines in the code you 
 sent:

  /* now delete it from the SU list */

  if (p_su_si == NULL) {

  susi-su-list_of_susi = susi-su_next;

 This only happens when p_su_si is NULL. What happens if p_su_si is not 
 NULL? Will i_su-list_of_susi have the same value also in the next 
 iteration? free(susi) is executed unconditionally at the end of the

 avd_susi_delete() function, though there are a couple of return 
 statements in some branches in the code above it.

 regards,

 Anders Widell

 The code is

 2013-07-29 14:14, Anders Widell skrev:

  Thanks for your analysis. I still don't understand the code, but if

  you think this warning is a false positive I take your word for it.

  Some additional info from the warning:

 

  The free happens at line 504 in file avd_siass.c:

free(susi);

 

  The dereference happens at line 1070 in file avd_csi.c:

while (susi-list_of_csicomp != NULL

[devel] [PATCH 0 of 1] Review Request for dtm: Don't use NULL pointers or uninitialized data in error paths [#526]

2013-07-31 Thread Anders Widell
Summary: dtm: Don't use NULL pointers or uninitialized data in error paths 
[#526]
Review request for Trac Ticket(s): 526
Peer Reviewer(s): Mahesh
Pull request to: 
Affected branch(es): opensaf-4.2.x, opensaf-4.3.x, default(4.4)
Development branch: default


Impacted area   Impact y/n

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


Comments (indicate scope for each y above):
-

changeset 3c457ee245d95fbb2a0fa1d01658a4f923f5abdc
Author: Anders Widell anders.wid...@ericsson.com
Date:   Wed, 31 Jul 2013 10:51:58 +0200

dtm: Don't use NULL pointers or uninitialized data in error paths [#526]

Fixed two bugs where LOG_ER() was called with illegal parameters in 
error
paths:

* The error path taken when inet_ntop() fails was using the string in 
the
uninitialized result buffer.

* The error path taken when dtm_node_new() returns NULL was 
dereferencing
the returned NULL pointer.


Complete diffstat:
--
 osaf/services/infrastructure/dtms/dtm/dtm_node_sockets.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Testing Commands:
-
Compile and start OpenSAF with TCP transport.


Testing, Expected Results:
--
OpenSAF should compile and start successfully.


Conditions of Submission:
-
Ack from Mahesh


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y
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.


--
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1 of 1] build: add /usr/bin/killall to sudoers list in rpm spec [#451]

2013-07-31 Thread Anders Widell
Ack (not tested).

Note that this does not completely solve the problem reported in ticket 
451. amfwd must check if it is running with user id zero, and if not, 
add the string sudo  to the beginning of the command line when calling 
the killall program.

regards,
Anders Widell

2013-07-31 14:46, mathi.naic...@oracle.com skrev:
   00-README.conf  |  2 +-
   opensaf.spec.in |  2 +-
   2 files changed, 2 insertions(+), 2 deletions(-)


 amfwd uses the killall program to send the ABRT signal to amdnd.
 This works if amfwd is running as root, but not if it is running
 as the opensaf user (since the amfnd process is running as root even if amfwd 
 is not).
 This patch adds killall to the sudoers to the rpm spec.

 diff --git a/00-README.conf b/00-README.conf
 --- a/00-README.conf
 +++ b/00-README.conf
 @@ -13,7 +13,7 @@ From 4.2 onwards, upon a 'make install'
   to be done to configure OpenSAF processes to run as the UNIX system user 
 opensaf:
   
   1) useradd -r -g opensaf -d /usr/local/share/opensaf/ -s /sbin/nologin -c 
 OpenSAF opensaf
 -2) echo opensaf ALL = NOPASSWD: /sbin/reboot, /sbin/tipc-config, 
 /usr/bin/pkill  /etc/sudoers
 +2) echo opensaf ALL = NOPASSWD: /sbin/reboot, /sbin/tipc-config, 
 /usr/bin/pkill, /usr/bin/killall  /etc/sudoers
   3) echo 'Defaults:%opensaf !requiretty'  /etc/sudoers
   4) echo 'Defaults:opensaf !requiretty'  /etc/sudoers
   5) chown opensaf /var/lib/opensaf
 diff --git a/opensaf.spec.in b/opensaf.spec.in
 --- a/opensaf.spec.in
 +++ b/opensaf.spec.in
 @@ -747,7 +747,7 @@ getent group %{opensaf_group}  /dev/nul
   getent passwd %{opensaf_user}  /dev/null || \
  useradd -r -g %{opensaf_user} -d %{_pkgdatadir} -s /sbin/nologin -c 
 OpenSAF %{opensaf_user}
   if ! grep %{opensaf_user} /etc/sudoers  /dev/null; then
 -   echo '%{opensaf_user} ALL = NOPASSWD: /sbin/reboot, /sbin/tipc-config, 
 /usr/bin/pkill'  /etc/sudoers
 +   echo '%{opensaf_user} ALL = NOPASSWD: /sbin/reboot, /sbin/tipc-config, 
 /usr/bin/pkill, /usr/bin/killall'  /etc/sudoers
  echo 'Defaults:%opensaf !requiretty'  /etc/sudoers
  echo 'Defaults:opensaf !requiretty'  /etc/sudoers
   fi


--
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1 of 1] osaf: support killall cmd as non-root user for amfwdog [#451]

2013-08-01 Thread Anders Widell
Ack.

regards,
Anders Widell

2013-07-31 18:50, mathi.naic...@oracle.com skrev:
   00-README.conf|   3 ++-
   opensaf.spec.in   |   2 +-
   osaf/services/saf/avsv/amfwdog/amf_wdog.c |  12 ++--
   3 files changed, 13 insertions(+), 4 deletions(-)


 amfwd uses the killall program to send the ABRT signal to amfnd.
 This works if amfwd is running as root, but not if it is running
 as the opensaf user (since the amfnd process is running as root even if amfwd 
 is not).
 This patch adds killall to the sudoers command in the rpm spec.

 diff --git a/00-README.conf b/00-README.conf
 --- a/00-README.conf
 +++ b/00-README.conf
 @@ -12,8 +12,9 @@ Steps to configure 'opensaf' user after
   From 4.2 onwards, upon a 'make install' the following additional steps have
   to be done to configure OpenSAF processes to run as the UNIX system user 
 opensaf:
   
 +0) groupadd -r opensaf
   1) useradd -r -g opensaf -d /usr/local/share/opensaf/ -s /sbin/nologin -c 
 OpenSAF opensaf
 -2) echo opensaf ALL = NOPASSWD: /sbin/reboot, /sbin/tipc-config, 
 /usr/bin/pkill  /etc/sudoers
 +2) echo opensaf ALL = NOPASSWD: /sbin/reboot, /sbin/tipc-config, 
 /usr/bin/pkill, /usr/bin/killall  /etc/sudoers
   3) echo 'Defaults:%opensaf !requiretty'  /etc/sudoers
   4) echo 'Defaults:opensaf !requiretty'  /etc/sudoers
   5) chown opensaf /var/lib/opensaf
 diff --git a/opensaf.spec.in b/opensaf.spec.in
 --- a/opensaf.spec.in
 +++ b/opensaf.spec.in
 @@ -747,7 +747,7 @@ getent group %{opensaf_group}  /dev/nul
   getent passwd %{opensaf_user}  /dev/null || \
  useradd -r -g %{opensaf_user} -d %{_pkgdatadir} -s /sbin/nologin -c 
 OpenSAF %{opensaf_user}
   if ! grep %{opensaf_user} /etc/sudoers  /dev/null; then
 -   echo '%{opensaf_user} ALL = NOPASSWD: /sbin/reboot, /sbin/tipc-config, 
 /usr/bin/pkill'  /etc/sudoers
 +   echo '%{opensaf_user} ALL = NOPASSWD: /sbin/reboot, /sbin/tipc-config, 
 /usr/bin/pkill, /usr/bin/killall'  /etc/sudoers
  echo 'Defaults:%opensaf !requiretty'  /etc/sudoers
  echo 'Defaults:opensaf !requiretty'  /etc/sudoers
   fi
 diff --git a/osaf/services/saf/avsv/amfwdog/amf_wdog.c 
 b/osaf/services/saf/avsv/amfwdog/amf_wdog.c
 --- a/osaf/services/saf/avsv/amfwdog/amf_wdog.c
 +++ b/osaf/services/saf/avsv/amfwdog/amf_wdog.c
 @@ -39,6 +39,8 @@
   #include libgen.h
   #include time.h
   #include sched.h
 +#include unistd.h
 +#include sys/types.h
   
   #include saAmf.h
   #include ncssysf_def.h
 @@ -219,8 +221,14 @@ int main(int argc, char *argv[])
   ** error. We want to catch that asap and fix it.
   */
   syslog(LOG_ERR, TIMEOUT receiving AMF health check 
 request, generating core for amfnd);
 - if ((status = system(killall -ABRT osafamfnd)) == -1)
 - syslog(LOG_ERR, system(killall) FAILED %x, 
 status);
 +
 + if (getuid() == 0 || geteuid() == 0) { /* running as a 
 root user */
 + if ((status = system(killall -ABRT 
 osafamfnd)) == -1)
 + syslog(LOG_ERR, system(killall -ABRT 
 osafamfnd) FAILED %x, status);
 + } else { /* running as the non-root user, default as 
 the 'opensaf' user */
 + if ((status = system(sudo killall -ABRT 
 osafamfnd)) == -1)
 + syslog(LOG_ERR, system(sudo killall 
 -ABRT osafamfnd) FAILED %x, status);
 + }
   
   syslog(LOG_ERR, %s, latest_healthcheck_trace);
   syslog(LOG_ERR, ordering system reboot);


--
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1 of 1] plm: fix build errors thrown by gcc 4.6 [#527]

2013-08-01 Thread Anders Widell
Ack.

regards,
Anders Widell

2013-08-01 13:45, mathi.naic...@oracle.com skrev:
   osaf/services/saf/plmsv/plms/hpi_intf/plms_epath_util.c |   3 ---
   osaf/services/saf/plmsv/plms/hpi_intf/plms_hrb.c|   7 ---
   osaf/services/saf/plmsv/plms/plms_imm.c |  14 +++---
   osaf/services/saf/plmsv/plms/plms_utils.c   |   3 ---
   4 files changed, 7 insertions(+), 20 deletions(-)


 diff --git a/osaf/services/saf/plmsv/plms/hpi_intf/plms_epath_util.c 
 b/osaf/services/saf/plmsv/plms/hpi_intf/plms_epath_util.c
 --- a/osaf/services/saf/plmsv/plms/hpi_intf/plms_epath_util.c
 +++ b/osaf/services/saf/plmsv/plms/hpi_intf/plms_epath_util.c
 @@ -321,7 +321,6 @@ static SaUint32T convert_entity_types(Sa
   SaUint32T  index_array[SAHPI_MAX_ENTITY_PATH])
   {
   SaUint32T i = 0;
 - SaUint32T index = 0;
   SaUint32T count;
   SaUint32T rc = NCSCC_RC_SUCCESS;
   
 @@ -332,8 +331,6 @@ static SaUint32T convert_entity_types(Sa
   
   for(i = 0; i  SAHPI_MAX_ENTITY_PATH; i++)
   {
 - index = entity_path-Entry[i].EntityLocation;
 -
   memcpy(ent_path_str,hpi_ent_type_list[index_array[i]].etype_str,
   strlen(hpi_ent_type_list[index_array[i]].etype_str));
   
 diff --git a/osaf/services/saf/plmsv/plms/hpi_intf/plms_hrb.c 
 b/osaf/services/saf/plmsv/plms/hpi_intf/plms_hrb.c
 --- a/osaf/services/saf/plmsv/plms/hpi_intf/plms_hrb.c
 +++ b/osaf/services/saf/plmsv/plms/hpi_intf/plms_hrb.c
 @@ -276,7 +276,6 @@ static SaUint32T hrb_process_hpi_req( PL
   PLMS_INV_DATA  inv_data;
   SaHpiRptEntryT rpt_entry;
   SaUint32T  rc = NCSCC_RC_SUCCESS;
 - SaHpiSessionIdTsession_id;
   
   TRACE_ENTER();
   
 @@ -297,12 +296,6 @@ static SaUint32T hrb_process_hpi_req( PL
   rpt_entry,resourceid))
   return NCSCC_RC_FAILURE;
   
 -
 - /* Get the session_id */
 - pthread_mutex_lock(cb-mutex);
 - session_id = cb-session_id;
 - pthread_mutex_unlock(cb-mutex);
 - 
   response = (PLMS_HPI_RSP *)malloc(sizeof(PLMS_HPI_RSP));
   if(NULL == response){
   LOG_ER(HRB:PLMS_HPI_RSP memory alloc failed error val:%s,
 diff --git a/osaf/services/saf/plmsv/plms/plms_imm.c 
 b/osaf/services/saf/plmsv/plms/plms_imm.c
 --- a/osaf/services/saf/plmsv/plms/plms_imm.c
 +++ b/osaf/services/saf/plmsv/plms/plms_imm.c
 @@ -1093,7 +1093,7 @@ static SaAisErrorT plms_imm_ccb_obj_modi
   PLMS_ENTITY *plm_ent, *dep_node;
   SaUint8T j, k;
   SaUint32T parent_dn_len, *attr_value;
 - SaStringT rdn_val, rdn, parent_dn;
 + SaStringT rdn_val, parent_dn;
   SaNameT key_dn, *dep_name;
   SaAisErrorT rc;
   SaUint8T dep_names_num=0, dep_min_num=0, cur_names_num=0;
 @@ -1260,7 +1260,7 @@ static SaAisErrorT plms_imm_ccb_obj_modi
   /* This object can be modified only if the associated HE/EE
  is out-of-service. */
   /* Get the parent DN and parent object in patricia tree */
 - rdn = strtok(dn_name, ,);
 + strtok(dn_name, ,);
   parent_dn = strtok(NULL, \0);
   parent_dn_len = strlen(parent_dn);
   memset(key_dn, 0, sizeof(SaNameT));
 @@ -1778,7 +1778,7 @@ static SaAisErrorT validate_deletion_of_
   {
   CcbUtilOperationData_t *opdata = NULL;
   PLMS_ENTITY *plm_ent;
 - SaStringT parent_dn, tmp;
 + SaStringT parent_dn;
   SaUint8T j;
   SaNameT *attr_val;
   SaImmAttrValuesT_2 **attr;
 @@ -1794,7 +1794,7 @@ static SaAisErrorT validate_deletion_of_
   strncpy(ee_type, (SaInt8T *)plm_ent-entity.ee_entity.
   saPlmEEType.value, plm_ent-entity.ee_entity.
   saPlmEEType.length);
 - tmp = strtok(ee_type, ,);
 + strtok(ee_type, ,);
   parent_dn = strtok(NULL, \0);
   if ((obj_name-length == strlen(parent_dn)) 
   (memcmp(parent_dn, obj_name-value, obj_name-
 @@ -1828,7 +1828,7 @@ static SaAisErrorT validate_deletion_of_
   memset(ee_type,0,SA_MAX_NAME_LENGTH+1);
   strncpy(ee_type, (SaInt8T *)attr_val-
   value, attr_val-length);
 - tmp = strtok(ee_type, ,);
 + strtok(ee_type, ,);
   parent_dn = strtok(NULL, \0);
   if((obj_name-length == strlen(
   parent_dn))  (memcmp(parent_dn,
 @@ -3904,14 +3904,14 @@ static void plms_free_ee_type_obj(PLMS_E
   }
   static void plms_delete_dep_obj(SaNameT *obj_name)
   {
 - SaStringT rdn, parent_dn;
 + SaStringT parent_dn

Re: [devel] [PATCH 1 of 1] plm: fix build errors thrown by gcc 4.6 [#527]

2013-08-01 Thread Anders Widell
It is possible to add (void) in front of strtok(), but it's not 
necessary in order to get rid of the compiler warnings.

You can't remove the calls to strtok(), if that is what you mean. 
strtok() has side effects!

regards,
Anders Widell

2013-08-01 13:52, Mathivanan Naickan Palanivelu skrev:
 Perhaps, its better to cast out the strotk() calls wherever the return values 
 are ignored!
 Thanks,
 Mathi.

 -Original Message-
 From: Mathivanan Naickan Palanivelu
 Sent: Thursday, August 01, 2013 5:15 PM
 To: anders.wid...@ericsson.com
 Cc: opensaf-devel@lists.sourceforge.net
 Subject: [devel] [PATCH 1 of 1] plm: fix build errors thrown by gcc  4.6 
 [#527]

   osaf/services/saf/plmsv/plms/hpi_intf/plms_epath_util.c |   3 ---
   osaf/services/saf/plmsv/plms/hpi_intf/plms_hrb.c|   7 ---
   osaf/services/saf/plmsv/plms/plms_imm.c |  14 
 +++---
   osaf/services/saf/plmsv/plms/plms_utils.c   |   3 ---
   4 files changed, 7 insertions(+), 20 deletions(-)


 diff --git a/osaf/services/saf/plmsv/plms/hpi_intf/plms_epath_util.c
 b/osaf/services/saf/plmsv/plms/hpi_intf/plms_epath_util.c
 --- a/osaf/services/saf/plmsv/plms/hpi_intf/plms_epath_util.c
 +++ b/osaf/services/saf/plmsv/plms/hpi_intf/plms_epath_util.c
 @@ -321,7 +321,6 @@ static SaUint32T convert_entity_types(Sa
  SaUint32T
 index_array[SAHPI_MAX_ENTITY_PATH])
   {
  SaUint32T i = 0;
 -SaUint32T index = 0;
  SaUint32T count;
  SaUint32T rc = NCSCC_RC_SUCCESS;

 @@ -332,8 +331,6 @@ static SaUint32T convert_entity_types(Sa

   for(i = 0; i  SAHPI_MAX_ENTITY_PATH; i++)
   {
 -index = entity_path-Entry[i].EntityLocation;
 -

  memcpy(ent_path_str,hpi_ent_type_list[index_array[i]].etype_str,
  strlen(hpi_ent_type_list[index_array[i]].etype_str));

 diff --git a/osaf/services/saf/plmsv/plms/hpi_intf/plms_hrb.c
 b/osaf/services/saf/plmsv/plms/hpi_intf/plms_hrb.c
 --- a/osaf/services/saf/plmsv/plms/hpi_intf/plms_hrb.c
 +++ b/osaf/services/saf/plmsv/plms/hpi_intf/plms_hrb.c
 @@ -276,7 +276,6 @@ static SaUint32T hrb_process_hpi_req( PL
  PLMS_INV_DATA  inv_data;
  SaHpiRptEntryT rpt_entry;
  SaUint32T  rc = NCSCC_RC_SUCCESS;
 -SaHpiSessionIdTsession_id;

  TRACE_ENTER();

 @@ -297,12 +296,6 @@ static SaUint32T hrb_process_hpi_req( PL
  rpt_entry,resourceid))
  return NCSCC_RC_FAILURE;

 -
 -/* Get the session_id */
 -pthread_mutex_lock(cb-mutex);
 -session_id = cb-session_id;
 -pthread_mutex_unlock(cb-mutex);
 -
  response = (PLMS_HPI_RSP *)malloc(sizeof(PLMS_HPI_RSP));
  if(NULL == response){
  LOG_ER(HRB:PLMS_HPI_RSP memory alloc failed error
 val:%s, diff --git a/osaf/services/saf/plmsv/plms/plms_imm.c
 b/osaf/services/saf/plmsv/plms/plms_imm.c
 --- a/osaf/services/saf/plmsv/plms/plms_imm.c
 +++ b/osaf/services/saf/plmsv/plms/plms_imm.c
 @@ -1093,7 +1093,7 @@ static SaAisErrorT plms_imm_ccb_obj_modi
  PLMS_ENTITY *plm_ent, *dep_node;
  SaUint8T j, k;
  SaUint32T parent_dn_len, *attr_value;
 -SaStringT rdn_val, rdn, parent_dn;
 +SaStringT rdn_val, parent_dn;
  SaNameT key_dn, *dep_name;
  SaAisErrorT rc;
  SaUint8T dep_names_num=0, dep_min_num=0,
 cur_names_num=0; @@ -1260,7 +1260,7 @@ static SaAisErrorT
 plms_imm_ccb_obj_modi
  /* This object can be modified only if the associated HE/EE
 is out-of-service. */
  /* Get the parent DN and parent object in patricia tree */
 -rdn = strtok(dn_name, ,);
 +strtok(dn_name, ,);
  parent_dn = strtok(NULL, \0);
  parent_dn_len = strlen(parent_dn);
  memset(key_dn, 0, sizeof(SaNameT));
 @@ -1778,7 +1778,7 @@ static SaAisErrorT validate_deletion_of_  {
  CcbUtilOperationData_t *opdata = NULL;
  PLMS_ENTITY *plm_ent;
 -SaStringT parent_dn, tmp;
 +SaStringT parent_dn;
  SaUint8T j;
  SaNameT *attr_val;
  SaImmAttrValuesT_2 **attr;
 @@ -1794,7 +1794,7 @@ static SaAisErrorT validate_deletion_of_
  strncpy(ee_type, (SaInt8T *)plm_ent-
 entity.ee_entity.
  saPlmEEType.value, plm_ent-
 entity.ee_entity.
  saPlmEEType.length);
 -tmp = strtok(ee_type, ,);
 +strtok(ee_type, ,);
  parent_dn = strtok(NULL, \0);
  if ((obj_name-length == strlen(parent_dn)) 
  (memcmp(parent_dn, obj_name-value,
 obj_name- @@ -1828,7 +1828,7 @@ static SaAisErrorT
 validate_deletion_of_

  memset(ee_type,0,SA_MAX_NAME_LENGTH+1);
  strncpy(ee_type, (SaInt8T *)attr_val-
  value, attr_val-length);
 -tmp = strtok(ee_type

Re: [devel] [PATCH 1 of 1] leap: ncs_os_process_execute_timed child process takes too long time before exec (#514)

2013-08-09 Thread Anders Widell
Looks like we are in the need of a new non-blocking logging API. Maybe a 
solution that can also be used to solve the MDS logging issue (where it 
writes to a while while holding a lock).

regards,
Anders Widell

2013-08-09 09:03, Hans Nordebäck skrev:
 Hi, we got feedback from one site with the alarm patch applied (#532). 
 In this case it hangs when calling syslog:

 #0  0x7f03b0b9db35 in raise () from /lib64/libc.so.6
 #0  0x7f03b0b9db35 in raise () from /lib64/libc.so.6
 #1  0x7f03b0b9f111 in abort () from /lib64/libc.so.6
 #2  0x7f03b1e1dd99 in sigalrm_handler (sig=5928) at os_defs.c:79
 #3  signal handler called
 #4  0x7f03b0c51dac in __lll_lock_wait_private () from 
 /lib64/libc.so.6
 #5  0x7f03b0c04e0d in _L_lock_1598 () from /lib64/libc.so.6
 #6  0x7f03b0c04bc6 in __tz_convert () from /lib64/libc.so.6
 #7  0x7f03b0c40f6a in __vsyslog_chk () from /lib64/libc.so.6
 #8  0x7f03b0c415b0 in syslog () from /lib64/libc.so.6
 #9  0x7f03b1e1e992 in ncs_os_process_execute_timed 
 (req=0x7fff10644ef0) at os_defs.c:1086
 #10 0x00416d03 in avnd_comp_clc_cmd_execute (cb=0x6578c0, 
 comp=0x67f680, cmd_type=AVND_COMP_CLC_CMD_TYPE_INSTANTIATE) at 
 avnd_clc.c:2702
 #11 0x0041a810 in avnd_comp_clc_uninst_inst_hdler 
 (cb=0x6578c0, comp=0x67f680) at avnd_clc.c:1384
 #12 0x004187fb in avnd_comp_clc_fsm_run (cb=0x6578c0, 
 comp=0x67f680, ev=AVND_COMP_CLC_PRES_FSM_EV_INST) at avnd_clc.c:874
 #13 0x0043438f in avnd_su_pres_insting_compinst_hdler 
 (cb=0x6578c0, su=0x676380, comp=0x680750) at avnd_susm.c:1759
 #14 0x00435bc4 in avnd_su_pres_fsm_run (cb=0x6578c0, 
 su=0x676380, comp=0x680750, ev=AVND_SU_PRES_FSM_EV_COMP_INSTANTIATED) 
 at avnd_susm.c:1293
 #15 0x004175cb in avnd_comp_clc_st_chng_prc (cb=0x6578c0, 
 comp=0x680750, prv_st=SA_AMF_PRESENCE_INSTANTIATING, 
 final_st=SA_AMF_PRESENCE_INSTANTIATED) at avnd_clc.c:1313
 #16 0x0041888f in avnd_comp_clc_fsm_run (cb=0x6578c0, 
 comp=0x680750, ev=AVND_COMP_CLC_PRES_FSM_EV_INST_SUCC) at avnd_clc.c:897
 #17 0x0041adb8 in avnd_evt_clc_resp_evh (cb=0x6578c0, 
 evt=0x67d0e0) at avnd_clc.c:446
 #18 0x004300e0 in avnd_evt_process (evt=optimized out) at 
 avnd_proc.c:278
 #19 avnd_main_process () at avnd_proc.c:219
 #20 0x00408815 in main (argc=1, argv=0x7fff10645988) at 
 amfnd_main.c:61


 /HansN

 On 08/06/13 09:34, praveen malviya wrote:
 Hi,
 I added a new syslog entry(to debug) before execv and was 
 able to reproduce the problem.
 The reason for the time out seems to be that syslog was *hung*, but 
 *after* writing the new log message into /var/log/messages.
 So, there is a high possibility that the child process gets hung in 
 syslog or other file operations.
 See bt below:
 Thread 1 (Thread 0x7f030a16f700 (LWP 16331)):

 #0  0x7f0308de4b1e in __lll_lock_wait_private () from 
 /lib64/libc.so.6
 #1  0x7f0308dd4398 in _L_lock_634 () from /lib64/libc.so.6
 #2  0x7f0308dd3e62 in __vsyslog_chk () from /lib64/libc.so.6
 #3  0x7f0308dd4320 in syslog () from /lib64/libc.so.6
 #4  0x7f0309d38feb in ncs_os_process_execute_timed 
 (req=0x7fffdcc52770, flag=false) at os_defs.c:1059
 #5  0x00416bd6 in avnd_comp_clc_cmd_execute (cb=0x6578a0, 
 comp=0x673840, cmd_type=AVND_COMP_CLC_CMD_TYPE_INSTANTIATE)
 at avnd_clc.c:2687
 #6  0x0041a630 in avnd_comp_clc_uninst_inst_hdler 
 (cb=0x6578a0, comp=0x673840) at avnd_clc.c:1384
 #7  0x0041865b in avnd_comp_clc_fsm_run (cb=0x6578a0, 
 comp=0x673840, ev=AVND_COMP_CLC_PRES_FSM_EV_INST)
 at avnd_clc.c:874
 #8  0x00433f5f in avnd_su_pres_insting_compinst_hdler 
 (cb=0x6578a0, su=0x66fc70, comp=0x674e10) at avnd_susm.c:1759
 #9  0x00435764 in avnd_su_pres_fsm_run (cb=0x6578a0, 
 su=0x66fc70, comp=0x674e10,
 ev=AVND_SU_PRES_FSM_EV_COMP_INSTANTIATED) at avnd_susm.c:1293
 #10 0x0041748b in avnd_comp_clc_st_chng_prc (cb=0x6578a0, 
 comp=0x674e10, prv_st=SA_AMF_PRESENCE_INSTANTIATING,
 final_st=SA_AMF_PRESENCE_INSTANTIATED) at avnd_clc.c:1313
 #11 0x004186ef in avnd_comp_clc_fsm_run (cb=0x6578a0, 
 comp=0x674e10, ev=AVND_COMP_CLC_PRES_FSM_EV_INST_SUCC)
 at avnd_clc.c:897
 #12 0x0041f400 in avnd_comp_reg_prc (cb=0x6578a0, 
 comp=0x674e10, pxy_comp=optimized out, reg=0x677528,
 dest=0x677518) at avnd_comp.c:709
 #13 0x0041fbd7 in avnd_evt_ava_comp_reg_evh (cb=0x6578a0, 
 evt=0x683530) at avnd_comp.c:212
 #14 0x0042fcc8 in avnd_evt_process (evt=optimized out) at 
 avnd_proc.c:278
 #15 avnd_main_process () at avnd_proc.c:219
 #16 0x00408835 in main (argc=2, argv=0x7fffdcc53588) at 
 amfnd_main.c:53


 Thanks,
 Praveen.


 On 03-Aug-13 9:47 PM, Hans Nordebäck wrote:
 Hi,

 I think the problem with child before exec hangs and the problem 
 where child at cleanup times out instantly, even though a 10 sec. 
 timeout is set, are related.

 Some reasons why the child seems to hang could be:

 1. Not run

Re: [devel] [PATCH 1 of 1] leap: ncs_os_process_execute_timed child process takes too long time before exec (#514)

2013-08-09 Thread Anders Widell
Wow, this was news to me. Ok then we must go through all functions we 
use after fork() and check that they are safe.

So do we know if syslog() in general can block (if we disregard the case 
when it is used after fork(), which apparently is a illegal).

regards,
Anders Widell

2013-08-09 09:17, Hans Feldt skrev:
 Yeah it seems that syslog in a child between fork() and exec() is unsecure. 
 Googling reveals this:

 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=454183

 In search for #514 a syslog entry was added  between fork() and exec() that 
 increased the likeliness of this to happen. The remaining syslogs between 
 fork() and exec() are for error cases. I guess those need to be stderr 
 prints. The problem is that stderr is closed in the child...
 We need to come up with a way to have stderr available in some trouble 
 shooting scenarios

 /HansF

 -Original Message-
 From: Hans Nordebäck
 Sent: den 9 augusti 2013 09:04
 To: praveen malviya; Nagendra Kumar; Ramesh Babu Betham; Hans Feldt
 Cc: opensaf-devel@lists.sourceforge.net; Anders Widell
 Subject: Re: SV: [PATCH 1 of 1] leap: ncs_os_process_execute_timed child 
 process takes too long time before exec (#514)

 Hi, we got feedback from one site with the alarm patch applied (#532).
 In this case it hangs when calling syslog:

 #0  0x7f03b0b9db35 in raise () from /lib64/libc.so.6
 #0  0x7f03b0b9db35 in raise () from /lib64/libc.so.6
 #1  0x7f03b0b9f111 in abort () from /lib64/libc.so.6
 #2  0x7f03b1e1dd99 in sigalrm_handler (sig=5928) at os_defs.c:79
 #3  signal handler called
 #4  0x7f03b0c51dac in __lll_lock_wait_private () from /lib64/libc.so.6
 #5  0x7f03b0c04e0d in _L_lock_1598 () from /lib64/libc.so.6
 #6  0x7f03b0c04bc6 in __tz_convert () from /lib64/libc.so.6
 #7  0x7f03b0c40f6a in __vsyslog_chk () from /lib64/libc.so.6
 #8  0x7f03b0c415b0 in syslog () from /lib64/libc.so.6
 #9  0x7f03b1e1e992 in ncs_os_process_execute_timed (req=0x7fff10644ef0) 
 at os_defs.c:1086
 #10 0x00416d03 in avnd_comp_clc_cmd_execute (cb=0x6578c0, 
 comp=0x67f680,
 cmd_type=AVND_COMP_CLC_CMD_TYPE_INSTANTIATE) at avnd_clc.c:2702
 #11 0x0041a810 in avnd_comp_clc_uninst_inst_hdler (cb=0x6578c0, 
 comp=0x67f680) at avnd_clc.c:1384
 #12 0x004187fb in avnd_comp_clc_fsm_run (cb=0x6578c0, comp=0x67f680, 
 ev=AVND_COMP_CLC_PRES_FSM_EV_INST) at
 avnd_clc.c:874
 #13 0x0043438f in avnd_su_pres_insting_compinst_hdler (cb=0x6578c0, 
 su=0x676380, comp=0x680750) at avnd_susm.c:1759
 #14 0x00435bc4 in avnd_su_pres_fsm_run (cb=0x6578c0, su=0x676380, 
 comp=0x680750,
 ev=AVND_SU_PRES_FSM_EV_COMP_INSTANTIATED) at avnd_susm.c:1293
 #15 0x004175cb in avnd_comp_clc_st_chng_prc (cb=0x6578c0, 
 comp=0x680750,
 prv_st=SA_AMF_PRESENCE_INSTANTIATING, final_st=SA_AMF_PRESENCE_INSTANTIATED) 
 at avnd_clc.c:1313
 #16 0x0041888f in avnd_comp_clc_fsm_run (cb=0x6578c0, comp=0x680750,
 ev=AVND_COMP_CLC_PRES_FSM_EV_INST_SUCC) at avnd_clc.c:897
 #17 0x0041adb8 in avnd_evt_clc_resp_evh (cb=0x6578c0, evt=0x67d0e0) 
 at avnd_clc.c:446
 #18 0x004300e0 in avnd_evt_process (evt=optimized out) at 
 avnd_proc.c:278
 #19 avnd_main_process () at avnd_proc.c:219
 #20 0x00408815 in main (argc=1, argv=0x7fff10645988) at 
 amfnd_main.c:61


 /HansN

 On 08/06/13 09:34, praveen malviya wrote:
 Hi,
  I added a new syslog entry(to debug) before execv and was able
 to reproduce the problem.
 The reason for the time out seems to be that syslog was *hung*, but
 *after* writing the new log message into /var/log/messages.
 So, there is a high possibility that the child process gets hung in
 syslog or other file operations.
 See bt below:
 Thread 1 (Thread 0x7f030a16f700 (LWP 16331)):

 #0  0x7f0308de4b1e in __lll_lock_wait_private () from
 /lib64/libc.so.6
 #1  0x7f0308dd4398 in _L_lock_634 () from /lib64/libc.so.6
 #2  0x7f0308dd3e62 in __vsyslog_chk () from /lib64/libc.so.6
 #3  0x7f0308dd4320 in syslog () from /lib64/libc.so.6
 #4  0x7f0309d38feb in ncs_os_process_execute_timed
 (req=0x7fffdcc52770, flag=false) at os_defs.c:1059
 #5  0x00416bd6 in avnd_comp_clc_cmd_execute (cb=0x6578a0,
 comp=0x673840, cmd_type=AVND_COMP_CLC_CMD_TYPE_INSTANTIATE)
  at avnd_clc.c:2687
 #6  0x0041a630 in avnd_comp_clc_uninst_inst_hdler
 (cb=0x6578a0, comp=0x673840) at avnd_clc.c:1384
 #7  0x0041865b in avnd_comp_clc_fsm_run (cb=0x6578a0,
 comp=0x673840, ev=AVND_COMP_CLC_PRES_FSM_EV_INST)
  at avnd_clc.c:874
 #8  0x00433f5f in avnd_su_pres_insting_compinst_hdler
 (cb=0x6578a0, su=0x66fc70, comp=0x674e10) at avnd_susm.c:1759
 #9  0x00435764 in avnd_su_pres_fsm_run (cb=0x6578a0,
 su=0x66fc70, comp=0x674e10,
  ev=AVND_SU_PRES_FSM_EV_COMP_INSTANTIATED) at avnd_susm.c:1293
 #10 0x0041748b in avnd_comp_clc_st_chng_prc (cb=0x6578a0,
 comp=0x674e10, prv_st=SA_AMF_PRESENCE_INSTANTIATING,
  final_st=SA_AMF_PRESENCE_INSTANTIATED

Re: [devel] [PATCH 0 of 3] Review Request for logsv: Fix hanging main thread when file i/o dont return [#9]

2013-08-16 Thread Anders Widell
Hi!

I have some comments:

* Time-out limits shall be configurable (according to our new policy on 
limits)

* I think the use code for killing and re-starting the slave thread is 
overkill and should be removed. Unless we know (and have seen) that this 
solves a real problem that can happen in practice.

regards,
Anders Widell

2013-08-09 15:20, Lennart Lund skrev:
 Summary: logsv: Fix hanging main thread when file i/o don't return
 Review request for Trac Ticket(s): #9
 Peer Reviewer(s): Madhurika Koppula, (Anders Widell, Hans Feldt)
 Pull request to: NA
 Affected branch(es): devel (4.4)
 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):
 -
 In order to protect the log server main thread (MT) from hanging if a file 
 operation
 like write, mkdir etc. does not return, all such operations are done in a 
 separate
 file thread (FT).
 Functions running in the Main Thread (MT) that needs file system operations
 handle over the execution to the FT when file handling has to be done. 
 Execution
 is then given back to the MT again. If a file operation does not return FT 
 will hang but
 MT will time out the FT and resume. A timeout will be handled as a file 
 operation fail.
 The MT can detect if the FT is hanging and new requests for file operations 
 will be failed.

 Note1: This is an add on to the patches sent out in prevoius review requests.
 Note2: The last patch (part 11); The non block handling of log files that was 
 suggested by Madhurika
 is contained in its' own patch.


 changeset 43a3e4173f05a01aa595b3d770a1464a3338f32e
 Author:   Lennart Lund lennart.l...@ericsson.com
 Date: Fri, 09 Aug 2013 13:46:36 +0200

   logsv: Fix hanging main thread when file i/o don't return. [#9]. Part 9

   - Remove unnecessary data copying in log_file_api() and 
 file_hndl_thread()
   - Return SA_AIS_ERR_TIMEOUT if the write operation time out when a log
   record shall be written. If the file thread is already hanging when a
   write is requested no attempt to write is made and SA_AIS_ERR_TRY_AGAIN 
 is
   returned as before.
   - Try to recover file thread by recreating it if it hangs for a long 
 time.
   - Recover if bad file descriptor or stale NFS handle.

 changeset d3d78dc3ad87e083e411e0ce5436bcca511d54d6
 Author:   Lennart Lund lennart.l...@ericsson.com
 Date: Fri, 09 Aug 2013 13:46:36 +0200

   logsv: Fix hanging main thread when file i/o don't return. [#9]. Part 10

   - Always reinitialize/reopen log files if a write operation fails, 
 timeout
   of file thread (hanging file system) included.
   - Handle synchronization between nodes when log files cannot be created 
 before
   a switch over without using any new flag that has to be checkpointed
   (remove files_initialized flag)
   - Incorrect handling of partial write is fixed. See #536

 changeset b8a2060ff5fd6d2685f95757d422addeca1ebdb0
 Author:   Lennart Lund lennart.l...@ericsson.com
 Date: Fri, 09 Aug 2013 13:46:36 +0200

   logsv: Fix hanging main thread when file i/o don't return. [#9]. Part 11

   - Open log files with O_NONBLOCK. Answer client with AIS_ERR_TIMEOUT if
   EWOULDBLOCK/EAGAIN (record may be parially written)


 Complete diffstat:
 --
   osaf/services/saf/logsv/lgs/lgs_evt.c |   11 ++--
   osaf/services/saf/logsv/lgs/lgs_file.c|  197 
 +++-
   osaf/services/saf/logsv/lgs/lgs_filehdl.c |2 +-
   osaf/services/saf/logsv/lgs/lgs_imm.c |1 -
   osaf/services/saf/logsv/lgs/lgs_mbcsv.c   |7 ---
   osaf/services/saf/logsv/lgs/lgs_mbcsv.h   |3 -
   osaf/services/saf/logsv/lgs/lgs_stream.c  |  115 
 +--
   osaf/services/saf/logsv/lgs/lgs_stream.h  |1 -
   8 files changed, 196 insertions(+), 141 deletions(-)


 Testing Commands:
 -
 See previous review


 Testing, Expected Results:
 --
   PASTE COMMAND OUTPUTS / TEST RESULTS


 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

Re: [devel] [PATCH 0 of 3] Review Request for logsv: Fix hanging main thread when file i/o dont return [#9]

2013-08-16 Thread Anders Widell
One more comment:

* saf_logger.c needs to be updated to handle the error code 
SA_AIS_ERR_TIMEOUT

regards,
Anders Widell

2013-08-16 12:16, Lennart Lund skrev:
 Hi,

 See my comments to Anders W below

 Thanks'
 Lennart

 -Original Message-
 From: Anders Widell [mailto:anders.wid...@ericsson.com]
 Sent: den 16 augusti 2013 10:47
 To: opensaf-devel@lists.sourceforge.net
 Subject: Re: [devel] [PATCH 0 of 3] Review Request for logsv: Fix hanging
 main thread when file i/o dont return [#9]

 Hi!

 I have some comments:

 * Time-out limits shall be configurable (according to our new policy on
 limits)
 Already done. See patch, part 12

 * I think the use code for killing and re-starting the slave thread is 
 overkill and
 should be removed. Unless we know (and have seen) that this solves a real
 problem that can happen in practice.
 Ok, I will remove it

 regards,
 Anders Widell

 2013-08-09 15:20, Lennart Lund skrev:
 Summary: logsv: Fix hanging main thread when file i/o don't return
 Review request for Trac Ticket(s): #9 Peer Reviewer(s): Madhurika
 Koppula, (Anders Widell, Hans Feldt) Pull request to: NA Affected
 branch(es): devel (4.4) 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):
 -
 In order to protect the log server main thread (MT) from hanging if
 a file operation like write, mkdir etc. does not return, all such
 operations are done in a separate file thread (FT).
 Functions running in the Main Thread (MT) that needs file system
 operations handle over the execution to the FT when file handling has
 to be done. Execution is then given back to the MT again. If a file
 operation does not return FT will hang but MT will time out the FT and
 resume. A timeout will be handled as a file operation fail.
 The MT can detect if the FT is hanging and new requests for file operations
 will be failed.
 Note1: This is an add on to the patches sent out in prevoius review
 requests.
 Note2: The last patch (part 11); The non block handling of log files that 
 was
 suggested by Madhurika
  is contained in its' own patch.


 changeset 43a3e4173f05a01aa595b3d770a1464a3338f32e
 Author: Lennart Lund lennart.l...@ericsson.com
 Date:   Fri, 09 Aug 2013 13:46:36 +0200

 logsv: Fix hanging main thread when file i/o don't return. [#9]. Part
 9

 - Remove unnecessary data copying in log_file_api() and
 file_hndl_thread()
 - Return SA_AIS_ERR_TIMEOUT if the write operation time out when
 a log
 record shall be written. If the file thread is already hanging when a
 write is requested no attempt to write is made and
 SA_AIS_ERR_TRY_AGAIN is
 returned as before.
 - Try to recover file thread by recreating it if it hangs for a long 
 time.
 - Recover if bad file descriptor or stale NFS handle.

 changeset d3d78dc3ad87e083e411e0ce5436bcca511d54d6
 Author: Lennart Lund lennart.l...@ericsson.com
 Date:   Fri, 09 Aug 2013 13:46:36 +0200

 logsv: Fix hanging main thread when file i/o don't return. [#9]. Part
 10

 - Always reinitialize/reopen log files if a write operation fails, 
 timeout
 of file thread (hanging file system) included.
 - Handle synchronization between nodes when log files cannot be
 created before
 a switch over without using any new flag that has to be checkpointed
 (remove files_initialized flag)
 - Incorrect handling of partial write is fixed. See #536

 changeset b8a2060ff5fd6d2685f95757d422addeca1ebdb0
 Author: Lennart Lund lennart.l...@ericsson.com
 Date:   Fri, 09 Aug 2013 13:46:36 +0200

 logsv: Fix hanging main thread when file i/o don't return. [#9]. Part
 11

 - Open log files with O_NONBLOCK. Answer client with
 AIS_ERR_TIMEOUT if
 EWOULDBLOCK/EAGAIN (record may be parially written)


 Complete diffstat:
 --
osaf/services/saf/logsv/lgs/lgs_evt.c |   11 ++--
osaf/services/saf/logsv/lgs/lgs_file.c|  197
 ++
 +-
osaf/services/saf/logsv/lgs/lgs_filehdl.c |2 +-
osaf/services/saf/logsv/lgs/lgs_imm.c |1 -
osaf/services/saf/logsv/lgs/lgs_mbcsv.c   |7 ---
osaf/services/saf/logsv/lgs/lgs_mbcsv.h   |3 -
osaf/services/saf/logsv/lgs/lgs_stream.c  |  115
 +--
osaf/services/saf/logsv/lgs/lgs_stream.h  |1 -
8 files changed, 196 insertions(+), 141 deletions(-)


 Testing Commands

Re: [devel] [PATCH 0 of 7] Review Request for logsv: Fix hanging main thread when file i/o dont return

2013-08-19 Thread Anders Widell
Yes, I can look into that. We used to have on the wiki, but the wiki has 
not yet been moved to SourceForge (though the old wiki should still be 
accessible).

regards,
Anders Widell

2013-08-19 10:28, Hans Feldt skrev:
 The first one liner of the commit message should describe what the 
 patch is doing. Now all patches have the same message.

 Anders: can we fix some commit message rules asap? Preferably added in 
 the code/repo under a directory Documentation as in other known 
 projects...

 /Hans

 On 08/19/2013 10:07 AM, Lennart Lund wrote:
 Summary: logsv: Fix hanging main thread when file i/o don't return
 Review request for Trac Ticket(s): #9
 Peer Reviewer(s): Madhurika Koppula, (Anders Widell, Hans Feldt)
 Pull request to: NA
 Affected branch(es): devel (4.4)
 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):
 -
 In order to protect the log server main thread (MT) from hanging if 
 a file operation
 like write, mkdir etc. does not return, all such operations are done 
 in a separate
 file thread (FT).
 Functions running in the Main Thread (MT) that needs file system 
 operations
 handle over the execution to the FT when file handling has to be 
 done. Execution
 is then given back to the MT again. If a file operation does not 
 return FT will hang but
 MT will time out the FT and resume. A timeout will be handled as a 
 file operation fail.
 The MT can detect if the FT is hanging and new requests for file 
 operations will be failed.

 Note:
 This review request contains all patches. Some of the old patches 
 are concatenated (qfold)
 Old patches   New patch
 1 - 7 1
 8 2
 9 - 113
 124
 135
 146
 157

 Patch 5 - 7 are new for this review.


 changeset b32ee924b9716330c8d7b54f5556fc235c31fbab
 Author:Lennart Lund lennart.l...@ericsson.com
 Date:Mon, 19 Aug 2013 09:12:30 +0200

 logsv: Fix hanging main thread when file i/o don't return. [#9] 
 Part 1

 Generic thread handling:
 - Generic thread handling
 - Convert functions to use threaded file handling
 - Handling of object implementer rejects
 - Invalidate stream fd if errno EBADF when writing log record
 - Fix Error handling for too long path ( PATH_MAX)
 - Functions that uses a handler in file thread has got extension _h

 changeset ed70f6043029ad9c7ea5f55439130023acea13bc
 Author:Lennart Lund lennart.l...@ericsson.com
 Date:Mon, 19 Aug 2013 09:13:22 +0200

 logsv: Fix hanging main thread when file i/o don't return. [#9] 
 part 2

 - Fix review remarks and some findings from test
 - Fix some findings found when using code analyze tool
 - Cleanup of TRACE and LOG
 - Add information for contributors/maintainers about file system 
 handling in
 the Log-service README file

 changeset 1ab74048f572d3ecb843651dea627399e77a0afc
 Author:Lennart Lund lennart.l...@ericsson.com
 Date:Mon, 19 Aug 2013 09:13:56 +0200

 logsv: Fix hanging main thread when file i/o don't return. [#9] 
 Part 3

 - Remove unnecessary data copying in log_file_api() and 
 file_hndl_thread()
 - Return SA_AIS_ERR_TIMEOUT if the write operation time out when 
 a log
 record shall be written. If the file thread is already hanging 
 when a
 write is requested no attempt to write is made and 
 SA_AIS_ERR_TRY_AGAIN is
 returned as before.
 - Try to recover file thread by recreating it if it hangs for a 
 long time.
 - Recover if bad file descriptor or stale NFS handle.

 - Always reinitialize/reopen log files if a write operation 
 fails, timeout
 of file thread (hanging file system) included.
 - Handle synchronization between nodes when log files cannot be 
 created before
 a switch over without using any new flag that has to be checkpointed
 (remove files_initialized flag)
 - Incorrect handling of partial write is fixed. See #536

 - Open log files with O_NONBLOCK. Answer client with 
 AIS_ERR_TIMEOUT if
 EWOULDBLOCK/EAGAIN (record may be parially written)

 changeset 9891f1e38d7c32cb5be4f929101548dc466c79b9
 Author:Lennart Lund lennart.l...@ericsson.com
 Date:Mon, 19 Aug 2013 09:18:18 +0200

 logsv: Fix hanging main thread when file i/o don't return. [#9] 
 Part 4

 - Make timeouts for file hdl configurable in Log service 
 configuration
 object

 changeset dd80bd737715084537c0affe959ba619d0752fba
 Author:Lennart

Re: [devel] [PATCH 0 of 7] Review Request for logsv: Fix hanging main thread when file i/o dont return

2013-08-19 Thread Anders Widell
One more comment:

It would be good if the error code SA_AIS_ERR_TIMEOUT could be avoided. 
I think it can: by modifying the slave thread so that it undoes a write 
operation if the master thread timed out before the write was finished. 
Then the slave thread can use lseek() and ftruncate() to undo the write.

regards,
Anders Widell

2013-08-19 10:07, Lennart Lund skrev:
 Summary: logsv: Fix hanging main thread when file i/o don't return
 Review request for Trac Ticket(s): #9
 Peer Reviewer(s): Madhurika Koppula, (Anders Widell, Hans Feldt)
 Pull request to: NA
 Affected branch(es): devel (4.4)
 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):
 -
 In order to protect the log server main thread (MT) from hanging if a file 
 operation
 like write, mkdir etc. does not return, all such operations are done in a 
 separate
 file thread (FT).
 Functions running in the Main Thread (MT) that needs file system operations
 handle over the execution to the FT when file handling has to be done. 
 Execution
 is then given back to the MT again. If a file operation does not return FT 
 will hang but
 MT will time out the FT and resume. A timeout will be handled as a file 
 operation fail.
 The MT can detect if the FT is hanging and new requests for file operations 
 will be failed.

 Note:
 This review request contains all patches. Some of the old patches are 
 concatenated (qfold)
 Old patches   New patch
 1 - 7 1
 8 2
 9 - 113
 124
 135
 146
 157

 Patch 5 - 7 are new for this review.


 changeset b32ee924b9716330c8d7b54f5556fc235c31fbab
 Author:   Lennart Lund lennart.l...@ericsson.com
 Date: Mon, 19 Aug 2013 09:12:30 +0200

   logsv: Fix hanging main thread when file i/o don't return. [#9] Part 1

   Generic thread handling:
   - Generic thread handling
   - Convert functions to use threaded file handling
   - Handling of object implementer rejects
   - Invalidate stream fd if errno EBADF when writing log record
   - Fix Error handling for too long path ( PATH_MAX)
   - Functions that uses a handler in file thread has got extension _h

 changeset ed70f6043029ad9c7ea5f55439130023acea13bc
 Author:   Lennart Lund lennart.l...@ericsson.com
 Date: Mon, 19 Aug 2013 09:13:22 +0200

   logsv: Fix hanging main thread when file i/o don't return. [#9] part 2

   - Fix review remarks and some findings from test
   - Fix some findings found when using code analyze tool
   - Cleanup of TRACE and LOG
   - Add information for contributors/maintainers about file system 
 handling in
   the Log-service README file

 changeset 1ab74048f572d3ecb843651dea627399e77a0afc
 Author:   Lennart Lund lennart.l...@ericsson.com
 Date: Mon, 19 Aug 2013 09:13:56 +0200

   logsv: Fix hanging main thread when file i/o don't return. [#9] Part 3

   - Remove unnecessary data copying in log_file_api() and 
 file_hndl_thread()
   - Return SA_AIS_ERR_TIMEOUT if the write operation time out when a log
   record shall be written. If the file thread is already hanging when a
   write is requested no attempt to write is made and SA_AIS_ERR_TRY_AGAIN 
 is
   returned as before.
   - Try to recover file thread by recreating it if it hangs for a long 
 time.
   - Recover if bad file descriptor or stale NFS handle.

   - Always reinitialize/reopen log files if a write operation fails, 
 timeout
   of file thread (hanging file system) included.
   - Handle synchronization between nodes when log files cannot be created 
 before
   a switch over without using any new flag that has to be checkpointed
   (remove files_initialized flag)
   - Incorrect handling of partial write is fixed. See #536

   - Open log files with O_NONBLOCK. Answer client with AIS_ERR_TIMEOUT if
   EWOULDBLOCK/EAGAIN (record may be parially written)

 changeset 9891f1e38d7c32cb5be4f929101548dc466c79b9
 Author:   Lennart Lund lennart.l...@ericsson.com
 Date: Mon, 19 Aug 2013 09:18:18 +0200

   logsv: Fix hanging main thread when file i/o don't return. [#9] Part 4

   - Make timeouts for file hdl configurable in Log service configuration
   object

 changeset dd80bd737715084537c0affe959ba619d0752fba
 Author:   Lennart Lund lennart.l...@ericsson.com
 Date: Mon, 19 Aug 2013 09:19:03 +0200

   logsv: Fix hanging main thread when file i/o don't

[devel] New BASE component for common code

2013-08-26 Thread Anders Widell
Hi!

I would like to announce that we have renamed the LEAP component to BASE 
in the ticket system. I will soon also update the documentation to 
reflect this change.

The idea with this name change is to emphasize that we no longer have a 
portability layer (since we only support LSB-compliant Linux systems), 
but rather we have a collection of common code and utility functions 
shared by all the OpenSAF services.

To make it possible to have common code written in C++, we will also 
create a new shared library alongside libopensaf_core. C++ code cannot 
be put in libopensaf_core, since the agent libraries are linked with 
that library.

regards,
Anders Widell

--
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] Ticket Planning

2013-09-03 Thread Anders Widell
Hi!

As you may already have noticed, I have experimented with a slight 
change of the backlog buttons on the left panel in the ticket system. 
They now only show tickets that have been planned for a specific 
release, i.e. not tickets that have the default future milestone. This 
is an attempt to encourage better planning of tickets into the upcoming 
releases. To support this, there is now also a new milestone 4.5.FC.

The AMF backlog went down from 224 tickets to 1 as a result of this 
change. Similar results were seen for most other services, with the 
exception of CLM and IMM that have more tickets planned. I think there 
is room for improvement in many services! There is no commitment 
involved in setting the milestone for a ticket - if there is not enough 
time to implement the ticket for the intended release we simply move it 
to the next one, or even back to the future milestone. So please, when 
possible, set the milestone field of the tickets you intend to 
implement within the next few OpenSAF releases.

thanks,
Anders Widell

PS if you wish to see all open tickets for a service (including the 
unplanned ones), you can still do so by clicking on the links at the top 
of the ticket page.


--
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] Build error on 32-bit architecture

2013-09-07 Thread Anders Widell
Hi!

I get the following build error on the default branch when building on a 
32-bit machine:

avnd_mds.c: In function 'avnd_mds_flat_ava_dec':
avnd_mds.c:1139:3: error: format '%lu' expects argument of type 'long 
unsigned int', but argument 7 has type 'unsigned int' [-Werror=format=]
LOG_NO(%s: wrong number of bytes to decode (%u vs %lu),
^
cc1: all warnings being treated as errors

It seems the sizeof(AVSV_NDA_AVA_MSG) needs to be casted to (unsigned long).

regards,
Anders Widell


--
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58041391iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 0 of 2] Review Request for opensaf:make MDS/TCP as the default opensaf transport[#232]

2013-10-03 Thread Anders Widell
I think it looks like you require IP addresses to be configured 
correctly in /etc/opensaf/dtmd.conf even when I am running with TIPC. Is 
this neccessary? It was not necessary before this patch...

regards,
Anders Widell

2013-10-03 05:53, A V Mahesh skrev:
 Hi Anders Widell ,

 I didn't tested TIPC enabled in UML , But the below Syslog says 
 indicates a configuration issue .

 `--enable-tipc` configuration option will only builds  both TCP  TIPC 
 binaries , but  by default OpenSAF is configured (nid.conf ) to uses 
 MDS/TCP as  messaging protocol.
 If we want bring up OpenSAF  with MDS/TIPC messaging protocol  ,we 
 need to enable MDS/TIPC configuration  ( please see the instruction 8 
 below) .

 
  

 8) Enabling OpenSAF MDS to use TIPC transport protocol :
 ==
  

  # export MDS_TRANSPORT=TIPC orChange MDS_TRANSPORT to 
 TIPC in nid.conf file
  # Change TIPC_ETH_IF to your network interface name, e.g. eth3
  # Change TIPC_NET_ID to your TIPC net-id ,e.g 4711
 
  


 - AVM

 On 10/1/2013 7:09 PM, Anders Widell wrote:
 Hi!

 Did you test this with TIPC enabled in UML? I don't get the system up 
 and running. Syslog says:

 Oct  1 15:35:29 SC-1 user.notice opensafd: Starting OpenSAF Services
 Oct  1 15:35:30 SC-1 local0.notice osafdtmd[341]: Started
 Oct  1 15:35:30 SC-1 local0.err osafdtmd[341]: ER DTM: Validation of  
 IP address failed : 10.130.100.114
 Oct  1 15:35:30 SC-1 local0.err osafdtmd[341]: ER DTM: ip_addr cannot 
 match available network interfaces with IPs of node specified in the 
 dtm.conf file
 Oct  1 15:35:30 SC-1 local0.err osafdtmd[341]: ER DTM:Error reading 
 /etc/opensaf/dtmd.conf.  errno : -1
 Oct  1 15:35:30 SC-1 local0.err opensafd[336]: ER Failed DESC:TRANSPORT
 Oct  1 15:35:30 SC-1 local0.err opensafd[336]: ER Going for recovery
 Oct  1 15:35:30 SC-1 local0.err opensafd[336]: ER Trying To RESPAWN 
 /usr/local/lib/opensaf/clc-cli/osaf-transport attempt #1
 Oct  1 15:35:30 SC-1 local0.err opensafd[336]: ER Sending SIGKILL to 
 TRANSPORT, pid=337
 Oct  1 15:35:30 SC-1 local0.err opensafd[345]: ER Failed to exec 
 while forking script, err=No such file or directory
 Oct  1 15:35:31 SC-1 user.notice osafdtmd: osafdtmd Process down, 
 Rebooting the node
 Oct  1 15:35:31 SC-1 user.notice opensaf_reboot: Rebooting local 
 node; timeout=60

 I configured it with:

 ./configure --enable-tipc CFLAGS=-O2 -DRUNASROOT CXXFLAGS=-O2 
 -DRUNASROOT

 regards,
 Anders Widell

 2013-09-26 05:54, mahesh.va...@oracle.com skrev:
 Summary:opensaf:make MDS/TCP as the default opensaf transport[#232]
 Review request for Trac Ticket(s): #232
 Peer Reviewer(s): Hans  Mathi
 Pull request to: LIST THE PERSON WITH PUSH ACCESS HERE
 Affected branch(es): defualt
 Development branch: IF ANY GIVE THE REPO URL

 
 Impacted area   Impact y/n
 
   Docsn
   Build systemy
   RPM/packaging   y
   Configuration files y
   Startup scripts y
   SAF servicesn
   OpenSAF servicesn
   Core libraries  n
   Samples n
   Tests   n
   Other   n


 Comments (indicate scope for each y above):
 -
 Before re-publishing this MDS/TCP the default patch, following has 
 been addressed compare to previously published patch :
- Fixed some quality issues in TCP to improve performance and 
 stability (#273,#1799,#1993,#3116,#2707,#3113,#306,#2845,#2875).
  - 70 node setup bring up and switchover and fail-over are 
 tested ,test performance results are close to TIPC.
  - Addressed comments give by Hans in previously published patch.
 Following are the changes :
 1) Now no configuration change required in nodeinit.conf . The 
 nodeinit.conf contains a single osaf-transport entry ,
  in the MDS/TCP case, it calls osaf-dtm start and in MDS/TIPC 
 case, it calls configure_tipc ( nid_tipc renamed ).
 2) sed command of nodeinit.conf from the opensafd start script 
 is removed .
 3) Now all  configuration related to osaf-transport consolidated 
 in nid.conf, such as choosing
   MDS transport protocol (TIPC or TCP), when MDS_TRANSPORT is 
 chosen the TIPC the network interface name configuration
  (e.g. eth0/eth1/eth3) and TIPC net-id (e.g. 1234) has to be 
 configured appropriately.
 4) The old nid_tipc script  renamed to configure_tipc .
 5) mds log

[devel] [PATCH 1 of 1] uml: Support both TCP and TIPC transports in UML environment [#587]

2013-10-04 Thread Anders Widell
 tools/cluster_sim_uml/archive/scripts/40opensaf.rc |  1 +
 tools/cluster_sim_uml/build_uml|  5 +
 2 files changed, 6 insertions(+), 0 deletions(-)


Add support for the TCP transport in the UML environment. Select TIPC
transport when OpenSAF was built with TIPC enabled.

diff --git a/tools/cluster_sim_uml/archive/scripts/40opensaf.rc 
b/tools/cluster_sim_uml/archive/scripts/40opensaf.rc
--- a/tools/cluster_sim_uml/archive/scripts/40opensaf.rc
+++ b/tools/cluster_sim_uml/archive/scripts/40opensaf.rc
@@ -60,6 +60,7 @@ fi
 rm -f /etc/opensaf/slot_id
 rm -f /etc/opensaf/node_id
 echo $hostnumber  /etc/opensaf/slot_id 
+sed -i s/DTM_NODE_IP=.*/DTM_NODE_IP=192.168.0.$hostnumber/ 
/etc/opensaf/dtmd.conf
 
 # Generate node unique node_name  node_id files
 rm -f /etc/opensaf/node_name /etc/opensaf/node_id
diff --git a/tools/cluster_sim_uml/build_uml b/tools/cluster_sim_uml/build_uml
--- a/tools/cluster_sim_uml/build_uml
+++ b/tools/cluster_sim_uml/build_uml
@@ -191,6 +191,11 @@ cmd_create_rootfs()
 sed -i '/export\ OPENSAF_GROUP/d' etc/opensaf/nid.conf
 sed -i '/export\ OPENSAF_USER/d' etc/opensaf/nid.conf
 
+# Select TIPC transport if OpenSAF was configured with it.
+if grep -q define ENABLE_TIPC_TRANSPORT 1 ../../../config.h; then
+   sed -i 's/MDS_TRANSPORT=TCP/MDS_TRANSPORT=TIPC/g' etc/opensaf/nid.conf
+fi
+
 # The var directory structure is setup from within each UML
 rm -rf var/*
 

--
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register 
http://pubads.g.doubleclick.net/gampad/clk?id=60134791iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 0 of 2] Review Request for opensaf:make MDS/TCP as the default opensaf transport[#232]

2013-10-04 Thread Anders Widell
Hi!

Ack from me, with comments:

The pkill command should be replaced with killall, since killall is 
included in LSB. pkill and killall work nearly the same, except that 
killall by default does not take a regular expression as default (though 
there is an option for this).

So the following command:

pkill -9 osaf-transport /dev/null 21

can be replaced with (note the added -monitor part, which is needed 
since it's not a regexp):

killall -s KILL osaf-transport-monitor /dev/null 21

Also, please don't push until ticket [#587] has been pushed, since 
otherwise the UML environment will be broken (or at least it won't work 
out of the box).

regards,
Anders Widell

2013-09-26 05:54, mahesh.va...@oracle.com skrev:
 Summary:opensaf:make MDS/TCP as the default opensaf transport[#232]
 Review request for Trac Ticket(s): #232
 Peer Reviewer(s): Hans  Mathi
 Pull request to: LIST THE PERSON WITH PUSH ACCESS HERE
 Affected branch(es): defualt
 Development branch: IF ANY GIVE THE REPO URL

 
 Impacted area   Impact y/n
 
   Docsn
   Build systemy
   RPM/packaging   y
   Configuration files y
   Startup scripts y
   SAF servicesn
   OpenSAF servicesn
   Core libraries  n
   Samples n
   Tests   n
   Other   n


 Comments (indicate scope for each y above):
 -
 Before re-publishing this MDS/TCP the default patch, following has been 
 addressed compare to previously published patch :
   
  - Fixed some quality issues in TCP to improve performance and stability 
 (#273,#1799,#1993,#3116,#2707,#3113,#306,#2845,#2875).
  - 70 node setup bring up and switchover and fail-over are tested ,test 
 performance results are close to TIPC.
  - Addressed comments give by Hans in previously published patch.
   
   Following are the changes :
   
   1) Now no configuration change required in nodeinit.conf . The 
 nodeinit.conf contains a single osaf-transport entry ,
  in the MDS/TCP case, it calls osaf-dtm start and in MDS/TIPC case, it 
 calls configure_tipc ( nid_tipc renamed ).
   
   2) sed command of nodeinit.conf from the opensafd start script is removed .
   
   3) Now all  configuration related to osaf-transport consolidated in 
 nid.conf, such as choosing
   MDS transport protocol (TIPC or TCP), when  MDS_TRANSPORT is chosen the 
 TIPC the network interface name configuration
  (e.g. eth0/eth1/eth3) and TIPC net-id (e.g. 1234) has to be configured 
 appropriately.
   
   4) The old nid_tipc script  renamed to configure_tipc .
   
   5) mds log rotation is moved to nodeinit.conf common osaf-transport 
 script .
   
   6) Then dh_monitoring is renamed to osaf-transport-monitor to match  osaf 
 prefix.
   
   7) Build options  :
   
i ) OpenSAF Build with  Only TCP Binaries  configuration.
   
  By default OpenSAFuses MDS/TCP as messaging protocol. That 
 simplifies things on Nodes where TIPC is
  NOT enabled in kernels .
   
   ==
#./bootstrap.sh
#./configure (TIPC [default=no] )
# make rpm
   ==
   
ii)  OpenSAF Build with TCP  TIPC Binaries  and with default TCP is 
 configured
   
Even though both TCP  TIPC binaries Build , by default 
 OpenSAFconfigured to uses MDS/TCP as  messaging protocol.
If user need to enable  TIPC Binaries need to enable and use the  
 feature MDS/TIPC.
   
   ==
#./bootstrap.sh
#./configure --enable-tipc   (TIPC [enable=yes] )
# make rpm
   ==
   
   8) Enabling OpenSAF MDS to use TIPC transport protocol :
   
   
 ==
  # export MDS_TRANSPORT=TIPC orChange MDS_TRANSPORT to TIPC 
 in nid.conf file
  # Change TIPC_ETH_IF to your network interface name, e.g. eth3
  # Change TIPC_NET_ID to your TIPC net-id ,e.g 4711
   
   
 ==
   
   9) OPENSAF_MANAGE_TIPC  check has been introduced in osaf-transport 
 before invoking nid_tipc.sh (new name configure_tipc start )
   when acting upon insmod/rmmod of TIPC ,to fulfill 
 OPENSAF_MANAGE_TIPC=no functionality complete (flag ) .
   
   10) Updated README ,INSTALL, 00-README.conf  00-README.debug accordingly.
   
   11) As an impact of point 3 , The Online installation SMF script has to 
 customized backup and restore of  TIPC Network interface name
  and TIPC net-id from  nodeinit.conf

[devel] OpenSAF presentation at LinuxCON Europe

2013-10-04 Thread Anders Widell
The OpenSAF project will give a presentation at LinuxCON Europe on 
October 21. We will present an overview of OpenSAF, the current status 
of the project and the roadmap for the future.

Don't miss out on this presentation if you are attending the LinuxCON!

For more information about LinuxCON Europe, please see the link below:

http://events.linuxfoundation.org/events/linuxcon-europe

regards,
Anders Widell


--
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register 
http://pubads.g.doubleclick.net/gampad/clk?id=60134791iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1 of 1] opensaf: change daemon_exit to call exit() [#581]

2013-10-09 Thread Anders Widell
Ack from me.

I guess we should also go through the code and make sure we follow this 
rule from the Google C++ Style guide:

Static and Global Variables

Static or global variables of class type are forbidden: they cause 
hard-to-find bugs due to indeterminate order of construction and 
destruction. However, such variables are allowed if they are constexpr: 
they have no dynamic initialization or destruction.

regards,
Anders Widell

2013-10-03 14:54, Hans Feldt skrev:
   osaf/libs/core/common/daemon.c |  9 ++---
   1 files changed, 6 insertions(+), 3 deletions(-)


 By calling exit() instead of _Exit() registered exit functions are called. 
 This
 enabled for example flushing of gcov data.

 diff --git a/osaf/libs/core/common/daemon.c b/osaf/libs/core/common/daemon.c
 --- a/osaf/libs/core/common/daemon.c
 +++ b/osaf/libs/core/common/daemon.c
 @@ -355,13 +355,16 @@ static void sigterm_handler(int sig)
   }
   
   /**
 - * Exit process with a standard syslog message
 - * To be called after the service has cleaned up per service specific things
 + * Exit calling process with exit(0) using a standard syslog message.
 + * This function should be called from the main thread of a server process in
 + * a safe context for calling exit(). Any service specific thing should be
 + * cleaned up before calling this function. By calling exit(), registered 
 exit
 + * functions are called before the process is terminated.
*/
   void daemon_exit(void)
   {
   syslog(LOG_NOTICE, exiting on signal %d, SIGTERM);
 - _Exit(EXIT_SUCCESS);
 + exit(0);
   }
   
   /**


--
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register 
http://pubads.g.doubleclick.net/gampad/clk?id=60134071iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1 of 1] opensaf: change daemon_exit to call exit() [#581]

2013-10-09 Thread Anders Widell
Wasn't it IMM that got into trouble last time we played with exit() :-)

These objects will be destroyed when we call exit(). Are they accessed 
by any thread besides the main thread?

Anyway, I suppose it wouldn't be too hard to change these variables into 
pointers, and initialize them the first thing we do in main() ?

regards,
Anders Widell

2013-10-09 16:12, Anders Björnerstedt skrev:
 The imm uses static global (non-pointer) variables for a number of C++ STL 
 objects.
 Maps, Sets, Vectors etc.

 I have never seen any problems with this.

 /AndersBj

 -Original Message-
 From: Anders Widell [mailto:anders.wid...@ericsson.com]
 Sent: den 9 oktober 2013 15:52
 To: Hans Feldt; mathi.naic...@oracle.com
 Cc: opensaf-devel@lists.sourceforge.net
 Subject: Re: [devel] [PATCH 1 of 1] opensaf: change daemon_exit to call 
 exit() [#581]

 Ack from me.

 I guess we should also go through the code and make sure we follow this rule 
 from the Google C++ Style guide:

 Static and Global Variables

 Static or global variables of class type are forbidden: they cause 
 hard-to-find bugs due to indeterminate order of construction and destruction. 
 However, such variables are allowed if they are constexpr:
 they have no dynamic initialization or destruction.

 regards,
 Anders Widell

 2013-10-03 14:54, Hans Feldt skrev:
osaf/libs/core/common/daemon.c |  9 ++---
1 files changed, 6 insertions(+), 3 deletions(-)


 By calling exit() instead of _Exit() registered exit functions are
 called. This enabled for example flushing of gcov data.

 diff --git a/osaf/libs/core/common/daemon.c
 b/osaf/libs/core/common/daemon.c
 --- a/osaf/libs/core/common/daemon.c
 +++ b/osaf/libs/core/common/daemon.c
 @@ -355,13 +355,16 @@ static void sigterm_handler(int sig)
}

/**
 - * Exit process with a standard syslog message
 - * To be called after the service has cleaned up per service specific
 things
 + * Exit calling process with exit(0) using a standard syslog message.
 + * This function should be called from the main thread of a server
 + process in
 + * a safe context for calling exit(). Any service specific thing
 + should be
 + * cleaned up before calling this function. By calling exit(),
 + registered exit
 + * functions are called before the process is terminated.
 */
void daemon_exit(void)
{
  syslog(LOG_NOTICE, exiting on signal %d, SIGTERM);
 -_Exit(EXIT_SUCCESS);
 +exit(0);
}

/**

 --
 October Webinars: Code for Performance
 Free Intel webinars can help you accelerate application performance.
 Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
 the latest Intel processors and coprocessors. See abstracts and register  
 http://pubads.g.doubleclick.net/gampad/clk?id=60134071iu=/4140/ostg.clktrk
 ___
 Opensaf-devel mailing list
 Opensaf-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/opensaf-devel



--
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register 
http://pubads.g.doubleclick.net/gampad/clk?id=60134071iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 09 of 15] log: Replace select() with osaf_poll() to avoid 1024 fd limit [#452]

2013-10-31 Thread Anders Widell
 osaf/libs/agents/saf/lga/lga_api.c   |  2 +-
 osaf/libs/agents/saf/lga/lga_util.c  |  7 ++-
 osaf/tools/saflog/saflogger/saf_logger.c |  1 -
 tests/logsv/Makefile.am  |  6 --
 4 files changed, 7 insertions(+), 9 deletions(-)


The select() function cannot handle file descriptors larger than 1023. To avoid
this limitation, we replace all usages of select() with poll().

diff --git a/osaf/libs/agents/saf/lga/lga_api.c 
b/osaf/libs/agents/saf/lga/lga_api.c
--- a/osaf/libs/agents/saf/lga/lga_api.c
+++ b/osaf/libs/agents/saf/lga/lga_api.c
@@ -224,7 +224,7 @@ SaAisErrorT saLogInitialize(SaLogHandleT
  * allows a process to avoid repeated invoking saLogDispatch() to see if
  * there is a new event, thus, needlessly consuming CPU time. In a POSIX
  * environment the system handle could be a file descriptor that is used with
- * the poll() or select() system calls to detect incoming callbacks.
+ * the poll() system call to detect incoming callbacks.
  *
  *
  * Parameters
diff --git a/osaf/libs/agents/saf/lga/lga_util.c 
b/osaf/libs/agents/saf/lga/lga_util.c
--- a/osaf/libs/agents/saf/lga/lga_util.c
+++ b/osaf/libs/agents/saf/lga/lga_util.c
@@ -18,6 +18,7 @@
 #include stdlib.h
 #include syslog.h
 #include lga.h
+#include osaf_poll.h
 
 /* Variables used during startup/shutdown only */
 static pthread_mutex_t lga_lock = PTHREAD_MUTEX_INITIALIZER;
@@ -30,14 +31,10 @@ static unsigned int lga_use_count;
  */
 static unsigned int lga_create(void)
 {
-   unsigned int timeout = 3000;
-   NCS_SEL_OBJ_SET set;
unsigned int rc = NCSCC_RC_SUCCESS;
 
/* create and init sel obj for mds sync */
m_NCS_SEL_OBJ_CREATE(lga_cb.lgs_sync_sel);
-   m_NCS_SEL_OBJ_ZERO(set);
-   m_NCS_SEL_OBJ_SET(lga_cb.lgs_sync_sel, set);
lga_cb.lgs_sync_awaited = 1;
 
/* register with MDS */
@@ -47,7 +44,7 @@ static unsigned int lga_create(void)
}
 
/* Block and wait for indication from MDS meaning LGS is up */
-   m_NCS_SEL_OBJ_SELECT(lga_cb.lgs_sync_sel, set, 0, 0, timeout);
+   osaf_poll_one_fd(m_GET_FD_FROM_SEL_OBJ(lga_cb.lgs_sync_sel), 3);
 
pthread_mutex_lock(lga_cb.cb_lock);
lga_cb.lgs_sync_awaited = 0;
diff --git a/osaf/tools/saflog/saflogger/saf_logger.c 
b/osaf/tools/saflog/saflogger/saf_logger.c
--- a/osaf/tools/saflog/saflogger/saf_logger.c
+++ b/osaf/tools/saflog/saflogger/saf_logger.c
@@ -29,7 +29,6 @@
 #include getopt.h
 #include sys/types.h
 #include sys/socket.h
-#include sys/select.h
 #include sys/un.h
 #include sys/time.h
 #include fcntl.h
diff --git a/tests/logsv/Makefile.am b/tests/logsv/Makefile.am
--- a/tests/logsv/Makefile.am
+++ b/tests/logsv/Makefile.am
@@ -51,11 +51,13 @@ logtest_SOURCES = \
 logtest_LDADD = \
$(top_builddir)/osaf/libs/saf/libSaLog/libSaLog.la \
$(top_builddir)/osaf/libs/saf/libSaImm/libSaImmOi.la \
-   $(top_builddir)/osaf/libs/saf/libSaImm/libSaImmOm.la
+   $(top_builddir)/osaf/libs/saf/libSaImm/libSaImmOm.la \
+   $(top_builddir)/osaf/libs/core/libopensaf_core.la
 
 saflogtest_SOURCES = \
saflogtest.c
 
 saflogtest_LDADD = \
-   $(top_builddir)/osaf/libs/saf/libSaLog/libSaLog.la
+   $(top_builddir)/osaf/libs/saf/libSaLog/libSaLog.la \
+   $(top_builddir)/osaf/libs/core/libopensaf_core.la
 

--
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 01 of 15] amf: Replace select() with osaf_poll() to avoid 1024 fd limit [#452]

2013-10-31 Thread Anders Widell
 osaf/libs/agents/saf/amfa/ava_init.c |  8 +++-
 1 files changed, 3 insertions(+), 5 deletions(-)


The select() function cannot handle file descriptors larger than 1023. To avoid
this limitation, we replace all usages of select() with poll().

diff --git a/osaf/libs/agents/saf/amfa/ava_init.c 
b/osaf/libs/agents/saf/amfa/ava_init.c
--- a/osaf/libs/agents/saf/amfa/ava_init.c
+++ b/osaf/libs/agents/saf/amfa/ava_init.c
@@ -34,6 +34,7 @@
 #include ava.h
 #include pthread.h
 #include osaf_utility.h
+#include osaf_poll.h
 
 /* global cb handle */
 uint32_t gl_ava_hdl = 0;
@@ -117,8 +118,7 @@ uint32_t ava_lib_req(NCS_LIB_REQ_INFO *r
 uint32_t ava_create(NCS_LIB_CREATE *create_info)
 {
AVA_CB *cb = 0;
-   NCS_SEL_OBJ_SET set;
-   uint32_t rc = NCSCC_RC_SUCCESS, timeout = 300;
+   uint32_t rc = NCSCC_RC_SUCCESS;
EDU_ERR err;
TRACE_ENTER();
 
@@ -181,8 +181,6 @@ uint32_t ava_create(NCS_LIB_CREATE *crea
}
TRACE(AVA Handles DB created successfully);
 
-   m_NCS_SEL_OBJ_ZERO(set);
-   m_NCS_SEL_OBJ_SET(cb-sel_obj, set);
m_AVA_FLAG_SET(cb, AVA_FLAG_FD_VALID);
 
/* register with MDS */
@@ -195,7 +193,7 @@ uint32_t ava_create(NCS_LIB_CREATE *crea
 
TRACE_1(Waiting on select till AMF Node Director is up);
/* block until mds detects avnd */
-   m_NCS_SEL_OBJ_SELECT(cb-sel_obj, set, 0, 0, timeout);
+   osaf_poll_one_fd(m_GET_FD_FROM_SEL_OBJ(cb-sel_obj), 3000);
 
/* reset the fd validity flag  */
m_NCS_LOCK(cb-lock, NCS_LOCK_WRITE);

--
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 11 of 15] msg: Replace select() with osaf_poll() to avoid 1024 fd limit [#452]

2013-10-31 Thread Anders Widell
 osaf/libs/agents/saf/mqa/mqa_init.c |  13 +++--
 1 files changed, 3 insertions(+), 10 deletions(-)


The select() function cannot handle file descriptors larger than 1023. To avoid
this limitation, we replace all usages of select() with poll().

diff --git a/osaf/libs/agents/saf/mqa/mqa_init.c 
b/osaf/libs/agents/saf/mqa/mqa_init.c
--- a/osaf/libs/agents/saf/mqa/mqa_init.c
+++ b/osaf/libs/agents/saf/mqa/mqa_init.c
@@ -31,6 +31,7 @@
 #include mqa.h
 #include pthread.h
 #include osaf_utility.h
+#include osaf_poll.h
 
 /* global cb handle */
 uint32_t gl_mqa_hdl = 0;
@@ -104,8 +105,6 @@ uint32_t mqa_lib_req(NCS_LIB_REQ_INFO *r
 **/
 static void mqa_sync_with_mqd(MQA_CB *cb)
 {
-   NCS_SEL_OBJ_SET set;
-   uint32_t timeout = 3000;
TRACE_ENTER();
 
m_NCS_LOCK(cb-mqd_sync_lock, NCS_LOCK_WRITE);
@@ -121,9 +120,7 @@ static void mqa_sync_with_mqd(MQA_CB *cb
m_NCS_UNLOCK(cb-mqd_sync_lock, NCS_LOCK_WRITE);
 
/* Await indication from MDS saying MQND is up */
-   m_NCS_SEL_OBJ_ZERO(set);
-   m_NCS_SEL_OBJ_SET(cb-mqd_sync_sel, set);
-   m_NCS_SEL_OBJ_SELECT(cb-mqd_sync_sel, set, 0, 0, timeout);
+   osaf_poll_one_fd(m_GET_FD_FROM_SEL_OBJ(cb-mqd_sync_sel), 3);
 
/* Destroy the sync - object */
m_NCS_LOCK(cb-mqd_sync_lock, NCS_LOCK_WRITE);
@@ -145,8 +142,6 @@ static void mqa_sync_with_mqd(MQA_CB *cb
 **/
 static void mqa_sync_with_mqnd(MQA_CB *cb)
 {
-   NCS_SEL_OBJ_SET set;
-   uint32_t timeout = 3000;
TRACE_ENTER();
 
m_NCS_LOCK(cb-mqnd_sync_lock, NCS_LOCK_WRITE);
@@ -162,9 +157,7 @@ static void mqa_sync_with_mqnd(MQA_CB *c
m_NCS_UNLOCK(cb-mqnd_sync_lock, NCS_LOCK_WRITE);
 
/* Await indication from MDS saying MQND is up */
-   m_NCS_SEL_OBJ_ZERO(set);
-   m_NCS_SEL_OBJ_SET(cb-mqnd_sync_sel, set);
-   m_NCS_SEL_OBJ_SELECT(cb-mqnd_sync_sel, set, 0, 0, timeout);
+   osaf_poll_one_fd(m_GET_FD_FROM_SEL_OBJ(cb-mqnd_sync_sel), 3);
 
/* Destroy the sync - object */
m_NCS_LOCK(cb-mqnd_sync_lock, NCS_LOCK_WRITE);

--
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 05 of 15] dtm: Replace select() with osaf_poll() to avoid 1024 fd limit [#452]

2013-10-31 Thread Anders Widell
 osaf/services/infrastructure/dtms/dtm/dtm_main.c |  12 +++-
 1 files changed, 3 insertions(+), 9 deletions(-)


The select() function cannot handle file descriptors larger than 1023. To avoid
this limitation, we replace all usages of select() with poll().

diff --git a/osaf/services/infrastructure/dtms/dtm/dtm_main.c 
b/osaf/services/infrastructure/dtms/dtm/dtm_main.c
--- a/osaf/services/infrastructure/dtms/dtm/dtm_main.c
+++ b/osaf/services/infrastructure/dtms/dtm/dtm_main.c
@@ -27,6 +27,7 @@
 #include ncs_main_papi.h
 #include dtm.h
 #include dtm_node.h
+#include osaf_poll.h
 
 #include stdlib.h
 #include sched.h
@@ -240,8 +241,6 @@ int main(int argc, char *argv[])
int rc = -1;
uint8_t send_bcast_buffer[255];
int bcast_buf_len = 0;
-   fd_set rfds1;
-   struct timeval bcast_freq;
long int dis_time_out_usec = 0;
long int dis_elapsed_time_usec = 0;
DTM_INTERNODE_CB *dtms_cb = dtms_gl_cb;
@@ -337,14 +336,9 @@ int main(int argc, char *argv[])
 
do {
/* Wait up to bcast_msg_freq seconds. */
-   bcast_freq.tv_sec = 0;
-   bcast_freq.tv_usec = (dtms_cb-bcast_msg_freq * 1000);
/* Check if stdin has input. */
-   FD_ZERO(rfds1);
-   FD_SET(dtms_cb-dgram_sock_sndr, rfds1);
-
-   if (select(dtms_cb-dgram_sock_sndr + 1, rfds1, NULL, NULL, 
bcast_freq)  0) {
-   LOG_ER(DTM: select failed);
+   if (osaf_poll_one_fd(dtms_cb-dgram_sock_sndr, 
dtms_cb-bcast_msg_freq)  0) {
+   LOG_ER(DTM: poll failed);
goto done1;
 
}

--
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 06 of 15] evt: Replace select() with osaf_poll() to avoid 1024 fd limit [#452]

2013-10-31 Thread Anders Widell
 osaf/libs/agents/saf/eda/eda_mds.c |  10 +++---
 osaf/libs/agents/saf/eda/eda_saf_api.c |   2 +-
 2 files changed, 4 insertions(+), 8 deletions(-)


The select() function cannot handle file descriptors larger than 1023. To avoid
this limitation, we replace all usages of select() with poll().

diff --git a/osaf/libs/agents/saf/eda/eda_mds.c 
b/osaf/libs/agents/saf/eda/eda_mds.c
--- a/osaf/libs/agents/saf/eda/eda_mds.c
+++ b/osaf/libs/agents/saf/eda/eda_mds.c
@@ -15,7 +15,8 @@
  *
  */
 
-#include logtrace.h
+#include logtrace.h
+#include osaf_poll.h
 
 #include eda.h
 
@@ -1520,9 +1521,6 @@ uint32_t eda_mds_init(EDA_CB *cb)
 **/
 void eda_sync_with_eds(EDA_CB *cb)
 {
-   NCS_SEL_OBJ_SET set;
-   uint32_t timeout = 3000;
-
m_NCS_LOCK(cb-eds_sync_lock, NCS_LOCK_WRITE);
 
if (cb-eds_intf.eds_up) {
@@ -1535,9 +1533,7 @@ void eda_sync_with_eds(EDA_CB *cb)
m_NCS_UNLOCK(cb-eds_sync_lock, NCS_LOCK_WRITE);
 
/* Await indication from MDS saying EDS is up */
-   m_NCS_SEL_OBJ_ZERO(set);
-   m_NCS_SEL_OBJ_SET(cb-eds_sync_sel, set);
-   m_NCS_SEL_OBJ_SELECT(cb-eds_sync_sel, set, 0, 0, timeout);
+   osaf_poll_one_fd(m_GET_FD_FROM_SEL_OBJ(cb-eds_sync_sel), 3);
 
/* Destroy the sync - object */
m_NCS_LOCK(cb-eds_sync_lock, NCS_LOCK_WRITE);
diff --git a/osaf/libs/agents/saf/eda/eda_saf_api.c 
b/osaf/libs/agents/saf/eda/eda_saf_api.c
--- a/osaf/libs/agents/saf/eda/eda_saf_api.c
+++ b/osaf/libs/agents/saf/eda/eda_saf_api.c
@@ -225,7 +225,7 @@ SaAisErrorT saEvtInitialize(SaEvtHandleT
  * allows a process to avoid repeated invoking saEvtDispatch() to see if
  * there is a new event, thus, needlessly consuming CPU time. In a POSIX
  * environment the system handle could be a file descriptor that is used with
- * the poll() or select() system calls to detect incoming callbacks.
+ * the poll() system call to detect incoming callbacks.
  *
  *
  * Parameters

--
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 02 of 15] base: Replace select() with osaf_poll() to avoid 1024 fd limit [#452]

2013-10-31 Thread Anders Widell
 osaf/libs/core/include/ncs_osprm.h |  142 +-
 osaf/libs/core/include/os_defs.h   |1 -
 osaf/libs/core/leap/os_defs.c  |  203 +---
 osaf/libs/core/leap/sysf_ipc.c |9 +-
 osaf/libs/core/leap/sysf_tmr.c |   68 ++--
 5 files changed, 23 insertions(+), 400 deletions(-)


The select() function cannot handle file descriptors larger than 1023. To avoid
this limitation, we replace all usages of select() with poll().

The following APIs were based on select() and have been removed from BASE:

m_SET_FD_IN_SEL_OBJ()
m_GET_HIGHER_SEL_OBJ()
ncs_sel_obj_select()
m_NCS_SEL_OBJ_SELECT()
ncs_sel_obj_poll_single_obj()
m_NCS_SEL_OBJ_POLL_SINGLE_OBJ()
m_NCS_SEL_OBJ_ZERO()
m_NCS_SEL_OBJ_SET()
m_NCS_SEL_OBJ_ISSET()
m_NCS_SEL_OBJ_CLR()
NCS_SEL_OBJ_SET

diff --git a/osaf/libs/core/include/ncs_osprm.h 
b/osaf/libs/core/include/ncs_osprm.h
--- a/osaf/libs/core/include/ncs_osprm.h
+++ b/osaf/libs/core/include/ncs_osprm.h
@@ -29,7 +29,6 @@
 #define NCS_OSPRM_H
 
 #include stdlib.h
-#include sys/select.h
 #include logtrace.h
 #include ncsgl_defs.h
 
@@ -635,27 +634,10 @@ uint32_t ncs_os_posix_mq(NCS_OS_POSIX_MQ
 in future if we wish to change the data-type of
 NCS_SEL_OBJ, without effecting user code)
 
-  m_SET_FD_IN_SEL_OBJ:  This API is provided for the purpose of mixing
-FDs generated by means external to these primitives
-with selection-objects generated by these primitives.
-Such a mixing of FDs and selection-objects is only
-useful while making a m_NCS_SEL_OBJ_SELECT call.
-
-  m_GET_HIGHER_SEL_OBJ: This API returns the higher selection-object (in a
-sense that is meaningful for the m_NCS_SEL_OBJ_SELECT
-call.) It is required in determining the highest
-selection-object that needs to be provided for
-an m_NCS_SEL_OBJ_SELECT call.
 \/
 #define m_GET_FD_FROM_SEL_OBJ(sel_obj)   \
 (sel_obj.rmv_obj)
 
-#define m_SET_FD_IN_SEL_OBJ(fd, sel_obj) \
-(sel_obj.raise_obj=-1,sel_obj.rmv_obj=fd)
-
-#define m_GET_HIGHER_SEL_OBJ(sel_obj1, sel_obj2) \
-((sel_obj1).rmv_obj  (sel_obj2).rmv_obj? (sel_obj1):(sel_obj2))
-
 /\
 
ncs_sel_obj_create:  Returns a selection-object pair. It internally may 
@@ -670,7 +652,7 @@ uint32_t ncs_os_posix_mq(NCS_OS_POSIX_MQ
 o_sel_obj   :   A selection-object which can be used to pass
 indications from one task to another. It contains
 a POSIX style file-descriptor on which a 
-POSIX select() can be invoked. 
+   POSIX poll() can be invoked.
 
 (This is an OUT argument and is set to a valid value
 if the return value is success)
@@ -803,128 +785,6 @@ uint32_t ncs_os_posix_mq(NCS_OS_POSIX_MQ
 #define m_NCS_SEL_OBJ_RMV_IND(sel_obj, noblock_flag, rmv_only_one_flag)\
 ncs_sel_obj_rmv_ind(sel_obj, noblock_flag,  rmv_only_one_flag)
 
-/\ 
-   ncs_sel_obj_select:  Identical to POSIX select except for the data types
-of the argument and return values
-
-  RETURN VALUE  :   Identical to POSIX select
--1 = in case of an error 
-0  = if select() returns due to timeout
-n  = No. of objects set in the bitmasks.
-
-  ARGUMENTS :   
-   
-  highest_sel_obj:  Highest selection-object present in the 
-sel-obj-sets provided (viz. io_readfds,
-io_writefds, io_exceptfds)
-
-NOTE : POSIX select() API expects highest-fd 
-plus 1. But this API is happy even with a
-highest-fd.
-
-(Highest selection-object should be determined
-using the m_GET_HIGHER_SEL_OBJ() macro)
-  
-  io_readfds:   Similar to readfds in a POSIX select call
-  io_writefds:  Similar to writefds in a POSIX select call
-  io_exceptfds: Similar to exceptfds in a POSIX select call
-  
-  io_timeout:   Similar to timeout  in a POSIX select call. But
-instead of a struct timeval it is a timeout
-in multiples of 10-milliseconds (can be
-called centisecond units?) ('io_timeout will
-return time elapsed since m_NCS_SEL_OBJ_SELECT
-invocation, if supported by 

[devel] [PATCH 00 of 15] Review Request for osaf: Replace select() with osaf_poll() to avoid 1024 fd limit [#452]

2013-10-31 Thread Anders Widell
Summary: osaf: Replace select() with osaf_poll() to avoid 1024 fd limit [#452]
Review request for Trac Ticket(s): 452
Peer Reviewer(s): Mathi, Ramesh
Pull request to:
Affected branch(es): default(4.4)
Development branch: default


Impacted area   Impact y/n

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


Comments (indicate scope for each y above):
-
This set of patches replace usages of select() with the new osaf_poll() API
introduced in ticket [#580]. Stricly speaking, not all of them have to be
replaced in order to solve the problem described in ticket [#452], but to
ensure that no select() that should have been replaced is forgotten, we
replace all occurrences of select(). This way, it is easy to check that
select() is not used, e.g. by running the grep command on the source tree.

Note that the java bindings have not yet been fixed. They will be fixed in
a patch that will be sent out later.

changeset 8bd7a81783f17268607be9ad703bc7978e1df7ff
Author: Anders Widell anders.wid...@ericsson.com
Date:   Thu, 31 Oct 2013 14:13:50 +0100

amf: Replace select() with osaf_poll() to avoid 1024 fd limit [#452]

The select() function cannot handle file descriptors larger than 1023. 
To
avoid this limitation, we replace all usages of select() with poll().

changeset 7a3af5d1b0464b7cb2b2c1b749f6e0a8530f8f34
Author: Anders Widell anders.wid...@ericsson.com
Date:   Thu, 31 Oct 2013 14:13:50 +0100

base: Replace select() with osaf_poll() to avoid 1024 fd limit [#452]

The select() function cannot handle file descriptors larger than 1023. 
To
avoid this limitation, we replace all usages of select() with poll().

The following APIs were based on select() and have been removed from 
BASE:

m_SET_FD_IN_SEL_OBJ() m_GET_HIGHER_SEL_OBJ() ncs_sel_obj_select()
m_NCS_SEL_OBJ_SELECT() ncs_sel_obj_poll_single_obj()
m_NCS_SEL_OBJ_POLL_SINGLE_OBJ() m_NCS_SEL_OBJ_ZERO() m_NCS_SEL_OBJ_SET()
m_NCS_SEL_OBJ_ISSET() m_NCS_SEL_OBJ_CLR() NCS_SEL_OBJ_SET

changeset 7738c5ed214580b07dabf9519e87b3e78b8f9745
Author: Anders Widell anders.wid...@ericsson.com
Date:   Thu, 31 Oct 2013 14:13:50 +0100

ckpt: Replace select() with osaf_poll() to avoid 1024 fd limit [#452]

The select() function cannot handle file descriptors larger than 1023. 
To
avoid this limitation, we replace all usages of select() with poll().

changeset 68977bc498106e797d31c530e944641741911ac8
Author: Anders Widell anders.wid...@ericsson.com
Date:   Thu, 31 Oct 2013 14:13:50 +0100

clm: Replace select() with osaf_poll() to avoid 1024 fd limit [#452]

The select() function cannot handle file descriptors larger than 1023. 
To
avoid this limitation, we replace all usages of select() with poll().

changeset 6fdf5ea8d207c1ca7e26952fa4432504c305a244
Author: Anders Widell anders.wid...@ericsson.com
Date:   Thu, 31 Oct 2013 14:13:50 +0100

dtm: Replace select() with osaf_poll() to avoid 1024 fd limit [#452]

The select() function cannot handle file descriptors larger than 1023. 
To
avoid this limitation, we replace all usages of select() with poll().

changeset fecc4ff2bab5c0fc232dd93b1d80c15014423719
Author: Anders Widell anders.wid...@ericsson.com
Date:   Thu, 31 Oct 2013 14:13:50 +0100

evt: Replace select() with osaf_poll() to avoid 1024 fd limit [#452]

The select() function cannot handle file descriptors larger than 1023. 
To
avoid this limitation, we replace all usages of select() with poll().

changeset 74935cb76deeba539d1dc4b0f9136014b1f5bf94
Author: Anders Widell anders.wid...@ericsson.com
Date:   Thu, 31 Oct 2013 14:13:50 +0100

imm: Replace select() with osaf_poll() to avoid 1024 fd limit [#452]

The select() function cannot handle file descriptors larger than 1023. 
To
avoid this limitation, we replace all usages of select() with poll().

changeset 28b843a756325cc0f04de0015fc4e30887e8b2dc
Author: Anders Widell anders.wid...@ericsson.com
Date:   Thu, 31 Oct 2013 14:13:50 +0100

lck: Replace select() with osaf_poll() to avoid 1024 fd limit [#452]

The select() function cannot handle file descriptors larger than 1023. 
To
avoid this limitation, we replace all usages of select() with poll().

changeset e90ead796c0c3ea134c764c188cafcecc925a07f
Author: Anders Widell anders.wid...@ericsson.com
Date:   Thu, 31 Oct 2013 14:13:50 +0100

log: Replace select() with osaf_poll() to avoid 1024 fd limit [#452]

The select() function cannot handle file descriptors larger than 1023

[devel] [PATCH 15 of 15] rde: Replace select() with osaf_poll() to avoid 1024 fd limit [#452]

2013-10-31 Thread Anders Widell
 osaf/libs/agents/infrastructure/rda/rda_papi.c |  36 +
 1 files changed, 7 insertions(+), 29 deletions(-)


The select() function cannot handle file descriptors larger than 1023. To avoid
this limitation, we replace all usages of select() with poll().

diff --git a/osaf/libs/agents/infrastructure/rda/rda_papi.c 
b/osaf/libs/agents/infrastructure/rda/rda_papi.c
--- a/osaf/libs/agents/infrastructure/rda/rda_papi.c
+++ b/osaf/libs/agents/infrastructure/rda/rda_papi.c
@@ -32,9 +32,10 @@
 /*
 ** Includes
 */
-#include rda.h
-
+#include rda.h
 #include sched.h
+#include logtrace.h
+#include osaf_poll.h
 
 /*
 ** Global data
@@ -654,35 +655,12 @@ static uint32_t rda_write_msg(int sockfd
 */
 static uint32_t rda_read_msg(int sockfd, char *msg, int size)
 {
-   int rc = PCSRDA_RC_SUCCESS;
+   int rc;
int msg_size = 0;
-   int retry_cnt = 0;
-   fd_set readfds;
-   struct timeval tv;
 
- RDE_SELECT:
-   FD_ZERO(readfds);
-
-   /* 
-* Set timeout value
-*/
-   tv.tv_sec = 30;
-   tv.tv_usec = 0;
-
-   /*
-* Set RDA interface socket fd
-*/
-   FD_SET(sockfd, readfds);
-
-   rc = select(sockfd + 1, readfds, NULL, NULL, tv);
+   rc = osaf_poll_one_fd(sockfd, 3);
if (rc  0) {
-   if (errno == 4) {   /* EINTR */
-   printf(select: PCSRDA_RC_IPC_RECV_FAILED: rc=%d-%s\n, 
errno, strerror(errno));
-   if (retry_cnt  5) {
-   retry_cnt++;
-   goto RDE_SELECT;
-   }
-   }
+   LOG_ER(poll: PCSRDA_RC_IPC_RECV_FAILED: rc=%d-%s\n, errno, 
strerror(errno));
return PCSRDA_RC_IPC_RECV_FAILED;
}
 
@@ -698,7 +676,7 @@ static uint32_t rda_read_msg(int sockfd,
 */
msg_size = recv(sockfd, msg, size, 0);
if (msg_size  0) {
-   printf(recv: PCSRDA_RC_IPC_RECV_FAILED: rc=%d-%s\n, errno, 
strerror(errno));
+   LOG_ER(recv: PCSRDA_RC_IPC_RECV_FAILED: rc=%d-%s\n, errno, 
strerror(errno));
return PCSRDA_RC_IPC_RECV_FAILED;
}
 

--
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 13 of 15] ntf: Replace select() with osaf_poll() to avoid 1024 fd limit [#452]

2013-10-31 Thread Anders Widell
 osaf/libs/agents/saf/ntfa/ntfa_api.c  |  2 +-
 osaf/libs/agents/saf/ntfa/ntfa_util.c |  8 +++-
 osaf/tools/safntf/ntfread/ntfread.c   |  1 -
 osaf/tools/safntf/ntfsend/ntfsend.c   |  1 -
 osaf/tools/safntf/ntfsubscribe/ntfsubscribe.c |  1 -
 tests/ntfsv/Makefile.am   |  3 ++-
 6 files changed, 6 insertions(+), 10 deletions(-)


The select() function cannot handle file descriptors larger than 1023. To avoid
this limitation, we replace all usages of select() with poll().

diff --git a/osaf/libs/agents/saf/ntfa/ntfa_api.c 
b/osaf/libs/agents/saf/ntfa/ntfa_api.c
--- a/osaf/libs/agents/saf/ntfa/ntfa_api.c
+++ b/osaf/libs/agents/saf/ntfa/ntfa_api.c
@@ -809,7 +809,7 @@ SaAisErrorT saNtfInitialize(SaNtfHandleT
  * allows a process to avoid repeated invoking saNtfDispatch() to see if
  * there is a new event, thus, needlessly consuming CPU time. In a POSIX
  * environment the system handle could be a file descriptor that is used with
- * the poll() or select() system calls to detect incoming callbacks.
+ * the poll() system call to detect incoming callbacks.
  *
  *
  * Parameters
diff --git a/osaf/libs/agents/saf/ntfa/ntfa_util.c 
b/osaf/libs/agents/saf/ntfa/ntfa_util.c
--- a/osaf/libs/agents/saf/ntfa/ntfa_util.c
+++ b/osaf/libs/agents/saf/ntfa/ntfa_util.c
@@ -20,6 +20,8 @@
 #include ntfa.h
 #include ntfsv_enc_dec.h
 #include ntfsv_mem.h
+#include osaf_utility.h
+#include osaf_poll.h
 
 /* Variables used during startup/shutdown only */
 static pthread_mutex_t ntfa_lock = PTHREAD_MUTEX_INITIALIZER;
@@ -32,14 +34,10 @@ static unsigned int ntfa_use_count;
  */
 static unsigned int ntfa_create(void)
 {
-   unsigned int timeout = 3000;
-   NCS_SEL_OBJ_SET set;
unsigned int rc = NCSCC_RC_SUCCESS;
 
/* create and init sel obj for mds sync */
m_NCS_SEL_OBJ_CREATE(ntfa_cb.ntfs_sync_sel);
-   m_NCS_SEL_OBJ_ZERO(set);
-   m_NCS_SEL_OBJ_SET(ntfa_cb.ntfs_sync_sel, set);
pthread_mutex_lock(ntfa_cb.cb_lock);
ntfa_cb.ntfs_sync_awaited = 1;
pthread_mutex_unlock(ntfa_cb.cb_lock);
@@ -51,7 +49,7 @@ static unsigned int ntfa_create(void)
}
 
/* Block and wait for indication from MDS meaning NTFS is up */
-   m_NCS_SEL_OBJ_SELECT(ntfa_cb.ntfs_sync_sel, set, 0, 0, timeout);
+   osaf_poll_one_fd(m_GET_FD_FROM_SEL_OBJ(ntfa_cb.ntfs_sync_sel), 3);
 
pthread_mutex_lock(ntfa_cb.cb_lock);
ntfa_cb.ntfs_sync_awaited = 0;
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
@@ -27,7 +27,6 @@
 #include getopt.h
 #include sys/types.h
 #include sys/socket.h
-#include sys/select.h
 #include sys/un.h
 #include time.h
 #include fcntl.h
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
@@ -26,7 +26,6 @@
 #include getopt.h
 #include sys/types.h
 #include sys/socket.h
-#include sys/select.h
 #include sys/un.h
 #include time.h
 #include fcntl.h
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
@@ -28,7 +28,6 @@
 #include getopt.h
 #include sys/types.h
 #include sys/socket.h
-#include sys/select.h
 #include sys/un.h
 #include time.h
 #include fcntl.h
diff --git a/tests/ntfsv/Makefile.am b/tests/ntfsv/Makefile.am
--- a/tests/ntfsv/Makefile.am
+++ b/tests/ntfsv/Makefile.am
@@ -80,4 +80,5 @@ endif
 ntftest_LDADD = \
$(top_builddir)/osaf/libs/saf/libSaNtf/libSaNtf.la \
$(top_builddir)/osaf/libs/saf/libSaImm/libSaImmOi.la \
-   $(top_builddir)/osaf/libs/saf/libSaImm/libSaImmOm.la
+   $(top_builddir)/osaf/libs/saf/libSaImm/libSaImmOm.la \
+   $(top_builddir)/osaf/libs/core/libopensaf_core.la

--
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] ACTION: Accept your tickets for OpenSAF 4.4.FC

2013-10-31 Thread Anders Widell
Hi all!

The feature freeze for OpenSAF 4.4 is approaching. We will tag OpenSAF 
4.4.FC in the beginning of January - a bit more than two months from 
now. After 4.4.FC has been tagged, we will only accept bug fixes to go 
into the 4.4 branch.

To help us plan the release, I urge you to accept all enhancement 
tickets that you are planning to implement for the 4.4 release as soon 
as possible. Please accept your enhancement tickets by the end of next 
week (2013-11-10).

You can use the 4.4 Enhancements search button in the ticket system at 
SourceForge to check if your enhancements are going into the 4.4 
release. Currently, the following enhancements are listed as work in 
progress (accepted or under review) for 4.4:

581 OpenSAF daemons should terminate by calling exit()
580 base: Add utilility functions for poll() and time handling
569 AMF: make saAmfSGSuHostNodeGroup WRITEABLE
452 osaf: Allow us to use more than 1024 file descriptors
228 Add support for saClmNodeAddress and saClmNodeCurrAddress
220 CLM should use CLMNA service DOWN event as additional evidence for 
node eviction
152 LOG: remove dependency to shared file system
94 Convert AMF to C++
90 In nway model, quiesced callbacks are generated for sponser SI first 
then dependent SIs after payload node lock
85 AMF: admin ops should return error strings
49 IMM: Support reference integrity checking
21 IMM: Allow imm-pbe to be configured without shared file system

The following enhancements are marked as already implemented in the 4.4 
branch:

589 mds: configurable TIPC importance
586 DOC: Clarify handling of token @Cd, @CD, @Nd and @Nd
578 DOC: Add description of new logFileIoTimeout attribute
577 LOG: use CCB error strings
576 LOG: add support for admin op result strings
566 DOC: Extensions document NTF IMCN needs more information
558 mds: Porting of MDS test cases to unit test framework
534 amf: remove destroy functionality
533 rename AMF dirs/​files
460 SMF: ETF and Campaign schemas are not matching each other
450 SMF: Updates to code after running Coverity tool
429 amf: amfnd should generate core file if the director /​ agent failed 
with csi set callback timeout or other failures
280 IMM: Bypassing the checkpointing of IMMD when both conrollers are 
loading simultaneously
232 MDS/​TCP should be the default once TIPC management is moved out
156 LOG: All LOG test suites should pass
151 IMMTOOLS: immadm should support the extended admin-operation API.
111 Enhancing traces in AMF
98 AMF: support for saAmfSUFailover
91 AMFND crashed when SU containing components with different 
compcstype, is unlocked
86 AMF: invalid config changes should use IMM CCB error strings
76 AMF: if all nodes have joined the cluster, cancel the assignment 
timer and assign anyway
20 IMMTOOLS: immcfg support for mixed changes in a transaction (CCB)
17 IMM: IMMND should send its file configuration to IMMD when attaching
9 LOG: decouple from file system characteristics

If your enhancements are not in the list, check that you have set the 
correct milestone and accepted them.

thanks,
Anders Widell



--
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] ACTION: Accept your tickets for OpenSAF 4.4.FC

2013-11-11 Thread Anders Widell
Hi all!

Below is the list of enhancement tickets that are marked as 
work-in-progress (accepted or under review) for OpenSAF 4.4. If you 
intend to get some additional enhancement into OpenSAF 4.4, please 
accept the ticket ASAP. Enhancements with the 4.4.FC milestone that have 
not been accepted will be moved to the OpenSAF 4.5.FC milestone.

Anders Widell
191 IMM: SaNameT 256 byte size limit and RDN 64 byte size limit.
452 osaf: Allow us to use more than 1024 file descriptors
580 base: Add utilility functions for poll() and time handling

Anders Bjornerstedt
21 IMM: Allow imm-pbe to be configured without shared file system

A V Mahesh (AVM)
561 CKPT: add CkptArrivalCallback as part of the CKPT API

elunlen
152 LOG: remove dependency to shared file system

Hans Feldt
569 AMF: make saAmfSGSuHostNodeGroup WRITEABLE
581 OpenSAF daemons should terminate by calling exit()

Mathi Naickan
220 CLM should use CLMNA service DOWN event as additional evidence 
for node eviction
228 Add support for saClmNodeAddress and saClmNodeCurrAddress

Nagendra Kumar
85 AMF: admin ops should return error strings
97 AVSv: AMF framework needs to support SAF_CLC_NO_RETRY (200) error 
code from clc-cli command

Praveen
90 In nway model, quiesced callbacks are generated for sponser SI 
first then dependent SIs after payload node lock

Zoran Milinkovic
49 IMM: Support reference integrity checking

(no ticket owner!!!)
81 SU un-instantiation should be supported in specified order.
94 Convert AMF to C++
617 Internal mds/​base function/​api to read ipaddress of the local node

regards,
Anders Widell



--
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] Build problem on default branch

2013-11-13 Thread Anders Widell
Hi!

I get the following build problem with the latest on the default branch:

osafimmpbed-immpbe_daemon.o: In function `sqlite_prepare_ccb':
/home/user/opensaf-staging/osaf/services/saf/immsv/immpbed/immpbe_daemon.cc:88: 
undefined reference to `pbeTransStarted()'
osafimmpbed-immpbe_daemon.o: In function `saImmOiCcbCompletedCallback':
/home/user/opensaf-staging/osaf/services/saf/immsv/immpbed/immpbe_daemon.cc:1344:
 
undefined reference to `pbeTransStarted()'
osafimmpbed-immpbe_daemon.o: In function `saImmOiAdminOperationCallback':
/home/user/opensaf-staging/osaf/services/saf/immsv/immpbed/immpbe_daemon.cc:656:
 
undefined reference to `pbeTransStarted()'
/home/user/opensaf-staging/osaf/services/saf/immsv/immpbed/immpbe_daemon.cc:665:
 
undefined reference to `pbeTransStarted()'
/home/user/opensaf-staging/osaf/services/saf/immsv/immpbed/immpbe_daemon.cc:782:
 
undefined reference to `pbeTransStarted()'
osafimmpbed-immpbe_daemon.o:/home/user/opensaf-staging/osaf/services/saf/immsv/immpbed/immpbe_daemon.cc:791:
 
more undefined references to `pbeTransStarted()' follow
collect2: ld returned 1 exit status
make[6]: *** [osafimmpbed] Error 1

This happens if I don't specify the option --enable-imm-pbe when 
configuring OpenSAF.

regards,
Anders Widell


--
DreamFactory - Open Source REST  JSON Services for HTML5  Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1 of 1] base: Add osaf_poll.h and osaf_time.h APIs [#580]

2013-11-29 Thread Anders Widell
Ok, I will add error loggings and push this later today.

regards,
Anders Widell

2013-11-29 09:53, Mathivanan Naickan Palanivelu skrev:
 Ack.
 Good that you were able to work on this ticket, would be a good value add.
 One comment is that, we should log the fd and strerror(errno) in the cases
 when poll returned 1.
 In the absence of this information, it would be a big cycle of time loss 
 going back to the field
 to collect debug information.

 So basically, after the below condition
 +   result = osaf_poll(set, 1, i_timeout);
 +   if (result == 1) {

 Just print fd, revents, strerror(errno)

 Cheers,
 Mathi.

 -Original Message-
 From: Anders Widell [mailto:anders.wid...@ericsson.com]
 Sent: Tuesday, October 08, 2013 3:51 PM
 To: Ramesh Babu Betham
 Cc: opensaf-devel@lists.sourceforge.net
 Subject: [devel] [PATCH 1 of 1] base: Add osaf_poll.h and osaf_time.h APIs
 [#580]

   osaf/libs/core/common/Makefile.am |2 +
   osaf/libs/core/common/include/osaf_poll.h |   97 +++
   osaf/libs/core/common/include/osaf_time.h |  371
 ++
   osaf/libs/core/common/osaf_poll.c |  130 ++
   osaf/libs/core/common/osaf_time.c |   52 
   5 files changed, 652 insertions(+), 0 deletions(-)


 Add new utility and convenience APIs, declared in osaf_poll.h and
 osaf_time.h, respectively.

 osaf_poll.h contains utility functions that work in a similar way as the 
 Linux
 function poll() and ppoll(), except that they handle errors themselves 
 instead
 of returning -1. The errno value EINTR is handled with a loop, and the
 functions keep track of time so that the time-out will happen at the same
 time no matter if the functions were interrupted by a signal or not. Other
 errno values will cause the process to be aborted, since they indicate the
 presence of a software bug and the program cannot continue in a safe way.

 osaf_time.h contains utility functions for reading the time and sleeping, 
 that
 work in a similar way as the Linux functions clock_gettime() and nanosleep(),
 except that they abort the process instead of returning -1. There are also
 utilty functions for manipulating struct timespec times. struct timespec is
 used for representing a time in many POSIX functions, and the reason for
 having a structure is that a 64-bit integer is not sufficient for 
 representing the
 full time.

 diff --git a/osaf/libs/core/common/Makefile.am
 b/osaf/libs/core/common/Makefile.am
 --- a/osaf/libs/core/common/Makefile.am
 +++ b/osaf/libs/core/common/Makefile.am
 @@ -32,6 +32,8 @@ libopensaf_common_la_SOURCES = \
  ncs_sprr.c \
  logtrace.c \
  osaf_utility.c \
 +osaf_poll.c \
 +osaf_time.c \
  nid_start_util.c \
  saf_edu.c \
  daemon.c \
 diff --git a/osaf/libs/core/common/include/osaf_poll.h
 b/osaf/libs/core/common/include/osaf_poll.h
 new file mode 100644
 --- /dev/null
 +++ b/osaf/libs/core/common/include/osaf_poll.h
 @@ -0,0 +1,97 @@
 +/*  -*- OpenSAF  -*-
 + *
 + * (C) Copyright 2013 The OpenSAF Foundation
 + *
 + * This program is distributed in the hope that it will be useful, but
 + * WITHOUT ANY WARRANTY; without even the implied warranty of
 +MERCHANTABILITY
 + * or FITNESS FOR A PARTICULAR PURPOSE. This file and program are
 +licensed
 + * under the GNU Lesser General Public License Version 2.1, February 1999.
 + * The complete license can be accessed from the following location:
 + * http://opensource.org/licenses/lgpl-license.php
 + * See the Copying file included with the OpenSAF distribution for full
 + * licensing terms.
 + *
 + * Author(s): Ericsson AB
 + *
 + */
 +
 +/** @file
 + *
 + * This file contains an OpenSAF replacement of the POSIX function
 +poll(). The
 + * definitions in this file are for internal use within OpenSAF only.
 + */
 +
 +#ifndef OPENSAF_BASE_OSAF_POLL_H_
 +#define OPENSAF_BASE_OSAF_POLL_H_
 +
 +#include poll.h
 +#include time.h
 +#include signal.h
 +
 +#ifdef  __cplusplus
 +extern C {
 +#endif
 +
 +/**
 + * @brief Wait for events on file descriptors
 + *
 + * This is a convenience function that behaves exactly like the POSIX
 +function
 + * poll(3P), except that it will abort the process instead of returning
 +an error
 + * code in case of a failure. It handles the EINTR case internally with
 +a loop,
 + * and ensures that the function will time out at the same time no
 +matter if the
 + * system call was interrupted by a signal or not.
 + *
 + * The return value will always be in the range [0, i_nfds].
 + */
 +extern unsigned osaf_poll(struct pollfd* io_fds, nfds_t i_nfds, int
 +i_timeout);
 +
 +/**
 + * @brief Wait for events on file descriptors
 + *
 + * This is a convenience function that behaves exactly like the Linux
 +function
 + * ppoll(3), except that it will abort the process instead of returning
 +an error
 + * code in case of a failure. It handles the EINTR case internally with
 +a loop,
 + * and ensures that the function will time out at the same

[devel] Reminder: Upcoming OpenSAF 4.4 feature freeze in January

2013-11-29 Thread Anders Widell
Hi all!

I just wanted to remind you that we are planning to tag OpenSAF 4.4.FC 
in the beginning of January. This means that if you are taking a holiday 
over Christmas, there is effectively only three weeks left for 
implementing enhancements that will go into OpenSAF 4.4. After 4.4.FC 
has been tagged, only bug fixes are supposed to go into the 4.4 branch.

One other thing that we are planing to do in conjunction with the 4.4.FC 
tagging is to run a script that reindents the code. This will fix things 
like wrong indentation, wrong use of tabs vs. spaces, and trailing white 
space at the end of the lines. The idea of doing it at this point in 
time is that most big patches should have been pushed by then, and thus 
we are minimizing the work of re-basing patches. If you have a patch 
that has not been pushed, it should however still be possible to apply 
it using the --ignore-whitespace option to the patch command.

Finally, I noted that there are a lot of defect tickets that have the 
4.4.FC milestone. Normally, a defect ticket should be fixed on all 
applicable branches that we are still supporting. So one would expect 
that most defects should have the 4.2.5 milestone. Please check your 
tickets and make sure that the only defect tickets with the 4.4.FC 
milestone are defects for new functionality that is not present on 
earlier branches.

regards,
Anders Widell


--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET,  PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349351iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] make rpm is failing: ticket# 580

2013-12-02 Thread Anders Widell
Oops, forgot about that one. It is fixed now.

thanks,
Anders Widell

2013-12-02 07:43, Ramesh Betham skrev:
 Hi Anders,

 make rpm fails, please check. (osaf_poll.h, osaf_time.h should add in 
 ../osaf/libs/core/common/includeMakefile.am)

 Thanks,
 Ramesh.

 libopensaf_common_la-osaf_poll.lo -MD -MP -MF 
 .deps/libopensaf_common_la-osaf_poll.Tpo -c osaf_poll.c  -fPIC -DPIC 
 -o .libs/libopensaf_common_la-osaf_poll.o
 osaf_poll.c:18:23: error: osaf_poll.h: No such file or directory
 osaf_poll.c:21:23: error: osaf_time.h: No such file or directory
 osaf_poll.c:25: error: expected declaration specifiers or â...â before 
 ânfds_tâ
 cc1: warnings being treated as errors
 osaf_poll.c:25: error: âstruct pollfdâ declared inside parameter list
 osaf_poll.c:25: error: its scope is only this definition or 
 declaration, which is probably not what you want
 osaf_poll.c:27: error: expected declaration specifiers or â...â before 
 ânfds_tâ
 osaf_poll.c:27: error: âstruct pollfdâ declared inside parameter list
 osaf_poll.c:27: error: conflicting types for âosaf_poll_no_timeoutâ
 osaf_poll.c:25: error: previous declaration of âosaf_poll_no_timeoutâ 
 was here
 osaf_poll.c: In function âosaf_poll_no_timeoutâ:
 osaf_poll.c:31: error: implicit declaration of function âpollâ
 osaf_poll.c:31: error: âi_nfdsâ undeclared (first use in this function)
 osaf_poll.c:31: error: (Each undeclared identifier is reported only once
 osaf_poll.c:31: error: for each function it appears in.)
 osaf_poll.c: At top level:
 osaf_poll.c:38: error: expected declaration specifiers or â...â before 
 ânfds_tâ
 osaf_poll.c:38: error: âstruct pollfdâ declared inside parameter list
 osaf_poll.c: In function âosaf_pollâ:
 osaf_poll.c:41: error: âi_nfdsâ undeclared (first use in this function)
 osaf_poll.c:41: error: passing argument 1 of âosaf_poll_no_timeoutâ 
 from incompatible pointer type
 osaf_poll.c:41: error: too many arguments to function 
 âosaf_poll_no_timeoutâ
 osaf_poll.c:42: error: implicit declaration of function 
 âosaf_millis_to_timespecâ
 osaf_poll.c:43: error: implicit declaration of function âosaf_ppollâ
 osaf_poll.c: At top level:
 osaf_poll.c:46: error: expected declaration specifiers or â...â before 
 ânfds_tâ
 osaf_poll.c:47: error: âstruct pollfdâ declared inside parameter list
 osaf_poll.c:46: error: conflicting types for âosaf_ppollâ
 osaf_poll.c:43: error: previous implicit declaration of âosaf_ppollâ 
 was here
 osaf_poll.c: In function âosaf_ppollâ:
 osaf_poll.c:59: error: âkNanosPerSecâ undeclared (first use in this 
 function)
 osaf_poll.c:59: error: âkMillisPerSecâ undeclared (first use in this 
 function)
 osaf_poll.c:78: error: âi_nfdsâ undeclared (first use in this function)
 osaf_poll.c:78: error: passing argument 1 of âosaf_poll_no_timeoutâ 
 from incompatible pointer type
 osaf_poll.c:78: error: too many arguments to function 
 âosaf_poll_no_timeoutâ
 osaf_poll.c:80: error: implicit declaration of function 
 âosaf_clock_gettimeâ
 osaf_poll.c:91: error: implicit declaration of function 
 âosaf_timespec_addâ
 osaf_poll.c:94: error: implicit declaration of function 
 âosaf_timespec_compareâ
 osaf_poll.c:96: error: implicit declaration of function 
 âosaf_timespec_to_millisâ
 osaf_poll.c:110: error: implicit declaration of function 
 âosaf_timespec_subtractâ
 osaf_poll.c: In function âosaf_poll_one_fdâ:
 osaf_poll.c:132: error: storage size of âsetâ isnât known
 osaf_poll.c:135: error: âPOLLINâ undeclared (first use in this function)
 osaf_poll.c:136: error: too many arguments to function âosaf_pollâ
 osaf_poll.c:138: error: âPOLLNVALâ undeclared (first use in this 
 function)
 osaf_poll.c:138: error: âPOLLERRâ undeclared (first use in this function)
 osaf_poll.c:138: error: âPOLLHUPâ undeclared (first use in this function)
 osaf_poll.c:132: error: unused variable âsetâ
 make[7]: *** [libopensaf_common_la-osaf_poll.lo] Error 1
 make[7]: Leaving directory 
 `/ramesh/opensaf-staging-new/rpms/BUILD/opensaf-4.4.M0/osaf/libs/core/common'
 make[6]: *** [all-recursive] Error 1
 make[6]: Leaving directory 
 `/ramesh/opensaf-staging-new/rpms/BUILD/opensaf-4.4.M0/osaf/libs/core/common'
 make[5]: *** [all-recursive] Error 1
 make[5]: Leaving directory 
 `/ramesh/opensaf-staging-new/rpms/BUILD/opensaf-4.4.M0/osaf/libs/core'
 make[4]: *** [all-recursive] Error 1
 make[4]: Leaving directory 
 `/ramesh/opensaf-staging-new/rpms/BUILD/opensaf-4.4.M0/osaf/libs'
 make[3]: *** [all-recursive] Error 1
 make[3]: Leaving directory 
 `/ramesh/opensaf-staging-new/rpms/BUILD/opensaf-4.4.M0/osaf'
 make[2]: *** [all-recursive] Error 1
 make[2]: Leaving directory 
 `/ramesh/opensaf-staging-new/rpms/BUILD/opensaf-4.4.M0'
 make[1]: *** [all] Error 2
 make[1]: Leaving directory 
 `/ramesh/opensaf-staging-new/rpms/BUILD/opensaf-4.4.M0'
 error: Bad exit status from 
 /ramesh/opensaf-staging-new/rpms/tmp/rpm-tmp.1908 (%build)


 RPM build errors:
 Bad exit status from 
 /ramesh/opensaf-staging-new/rpms/tmp/rpm-tmp.1908 (%build)
 make: *** [rpm

Re: [devel] [PATCH 1 of 1] base: Add osaf_poll.h and osaf_time.h APIs [#580]

2013-12-02 Thread Anders Widell
The POLLHUP seems to happen quite frequently (revents=17), so I will 
filter the log messages in that case.

regards,
Anders Widell

2013-11-29 09:53, Mathivanan Naickan Palanivelu skrev:
 Ack.
 Good that you were able to work on this ticket, would be a good value add.
 One comment is that, we should log the fd and strerror(errno) in the cases
 when poll returned 1.
 In the absence of this information, it would be a big cycle of time loss 
 going back to the field
 to collect debug information.

 So basically, after the below condition
 +   result = osaf_poll(set, 1, i_timeout);
 +   if (result == 1) {

 Just print fd, revents, strerror(errno)

 Cheers,
 Mathi.

 -Original Message-
 From: Anders Widell [mailto:anders.wid...@ericsson.com]
 Sent: Tuesday, October 08, 2013 3:51 PM
 To: Ramesh Babu Betham
 Cc: opensaf-devel@lists.sourceforge.net
 Subject: [devel] [PATCH 1 of 1] base: Add osaf_poll.h and osaf_time.h APIs
 [#580]

   osaf/libs/core/common/Makefile.am |2 +
   osaf/libs/core/common/include/osaf_poll.h |   97 +++
   osaf/libs/core/common/include/osaf_time.h |  371
 ++
   osaf/libs/core/common/osaf_poll.c |  130 ++
   osaf/libs/core/common/osaf_time.c |   52 
   5 files changed, 652 insertions(+), 0 deletions(-)


 Add new utility and convenience APIs, declared in osaf_poll.h and
 osaf_time.h, respectively.

 osaf_poll.h contains utility functions that work in a similar way as the 
 Linux
 function poll() and ppoll(), except that they handle errors themselves 
 instead
 of returning -1. The errno value EINTR is handled with a loop, and the
 functions keep track of time so that the time-out will happen at the same
 time no matter if the functions were interrupted by a signal or not. Other
 errno values will cause the process to be aborted, since they indicate the
 presence of a software bug and the program cannot continue in a safe way.

 osaf_time.h contains utility functions for reading the time and sleeping, 
 that
 work in a similar way as the Linux functions clock_gettime() and nanosleep(),
 except that they abort the process instead of returning -1. There are also
 utilty functions for manipulating struct timespec times. struct timespec is
 used for representing a time in many POSIX functions, and the reason for
 having a structure is that a 64-bit integer is not sufficient for 
 representing the
 full time.

 diff --git a/osaf/libs/core/common/Makefile.am
 b/osaf/libs/core/common/Makefile.am
 --- a/osaf/libs/core/common/Makefile.am
 +++ b/osaf/libs/core/common/Makefile.am
 @@ -32,6 +32,8 @@ libopensaf_common_la_SOURCES = \
  ncs_sprr.c \
  logtrace.c \
  osaf_utility.c \
 +osaf_poll.c \
 +osaf_time.c \
  nid_start_util.c \
  saf_edu.c \
  daemon.c \
 diff --git a/osaf/libs/core/common/include/osaf_poll.h
 b/osaf/libs/core/common/include/osaf_poll.h
 new file mode 100644
 --- /dev/null
 +++ b/osaf/libs/core/common/include/osaf_poll.h
 @@ -0,0 +1,97 @@
 +/*  -*- OpenSAF  -*-
 + *
 + * (C) Copyright 2013 The OpenSAF Foundation
 + *
 + * This program is distributed in the hope that it will be useful, but
 + * WITHOUT ANY WARRANTY; without even the implied warranty of
 +MERCHANTABILITY
 + * or FITNESS FOR A PARTICULAR PURPOSE. This file and program are
 +licensed
 + * under the GNU Lesser General Public License Version 2.1, February 1999.
 + * The complete license can be accessed from the following location:
 + * http://opensource.org/licenses/lgpl-license.php
 + * See the Copying file included with the OpenSAF distribution for full
 + * licensing terms.
 + *
 + * Author(s): Ericsson AB
 + *
 + */
 +
 +/** @file
 + *
 + * This file contains an OpenSAF replacement of the POSIX function
 +poll(). The
 + * definitions in this file are for internal use within OpenSAF only.
 + */
 +
 +#ifndef OPENSAF_BASE_OSAF_POLL_H_
 +#define OPENSAF_BASE_OSAF_POLL_H_
 +
 +#include poll.h
 +#include time.h
 +#include signal.h
 +
 +#ifdef  __cplusplus
 +extern C {
 +#endif
 +
 +/**
 + * @brief Wait for events on file descriptors
 + *
 + * This is a convenience function that behaves exactly like the POSIX
 +function
 + * poll(3P), except that it will abort the process instead of returning
 +an error
 + * code in case of a failure. It handles the EINTR case internally with
 +a loop,
 + * and ensures that the function will time out at the same time no
 +matter if the
 + * system call was interrupted by a signal or not.
 + *
 + * The return value will always be in the range [0, i_nfds].
 + */
 +extern unsigned osaf_poll(struct pollfd* io_fds, nfds_t i_nfds, int
 +i_timeout);
 +
 +/**
 + * @brief Wait for events on file descriptors
 + *
 + * This is a convenience function that behaves exactly like the Linux
 +function
 + * ppoll(3), except that it will abort the process instead of returning
 +an error
 + * code in case of a failure. It handles the EINTR case internally with
 +a loop

[devel] Build problem in AMFD

2013-12-06 Thread Anders Widell
Hi!

I get the following build problem with the latest on the default branch:

sg.cc: In function ‘void sg_admin_op_cb(SaImmOiHandleT, SaInvocationT, 
const SaNameT*, SaImmAdminOperationIdT, const 
SaImmAdminOperationParamsT_2**)’:
sg.cc:1084:17: error: ‘rc’ was not declared in this scope

regards,
Anders Widell



--
Sponsored by Intel(R) XDK 
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 11 of 16] base: Removed unused macros from ncs_osprm.h, ncssysf_def.h and os_defs.h files [#537]

2013-12-06 Thread Anders Widell
I get the following build error in PLM:

plms_dbg_utils.c: In function ‘plms_cb_dump_routine’:
plms_dbg_utils.c:50:2: error: implicit declaration of function 
‘m_GET_ASCII_DATE_TIME_STAMP’ [-Werror=implicit-function-declaration]

regards,
Anders Widell

2013-12-05 13:51, ramesh.bet...@oracle.com skrev:
   osaf/libs/agents/saf/cpa/cpa_init.c   |2 +-
   osaf/libs/agents/saf/mqa/mqa_init.c   |2 +-
   osaf/libs/agents/saf/plma/plma_init.c |2 +-
   osaf/libs/core/include/ncs_osprm.h|   26 +
   osaf/libs/core/include/ncssysf_def.h  |  103 
 +
   osaf/libs/core/include/os_defs.h  |   48 +-
   osaf/libs/core/leap/sysf_def.c|  122 
 
   osaf/libs/core/mds/include/mds_dt.h   |1 -
   osaf/services/infrastructure/dtms/dtm/dtm_intra.c |1 -
   osaf/services/infrastructure/dtms/include/dtm.h   |1 -
   osaf/services/saf/cpsv/cpd/cpd_main.c |2 +-
   osaf/services/saf/cpsv/cpnd/cpnd_main.c   |2 +-
   osaf/services/saf/mqsv/mqd/mqd_main.c |2 +-
   osaf/services/saf/mqsv/mqnd/mqnd_main.c   |2 +-
   14 files changed, 14 insertions(+), 302 deletions(-)


 diff --git a/osaf/libs/agents/saf/cpa/cpa_init.c 
 b/osaf/libs/agents/saf/cpa/cpa_init.c
 --- a/osaf/libs/agents/saf/cpa/cpa_init.c
 +++ b/osaf/libs/agents/saf/cpa/cpa_init.c
 @@ -297,7 +297,7 @@ unsigned int ncs_cpa_startup(void)
   osaf_mutex_unlock_ordie(s_agent_startup_mutex);
   return m_LEAP_DBG_SINK(NCSCC_RC_FAILURE);
   } else {
 - m_NCS_DBG_PRINTF(\nCPSV:CPA:ON);
 + printf(\nCPSV:CPA:ON);
   cpa_use_count = 1;
   }
   
 diff --git a/osaf/libs/agents/saf/mqa/mqa_init.c 
 b/osaf/libs/agents/saf/mqa/mqa_init.c
 --- a/osaf/libs/agents/saf/mqa/mqa_init.c
 +++ b/osaf/libs/agents/saf/mqa/mqa_init.c
 @@ -988,7 +988,7 @@ unsigned int ncs_mqa_startup(void)
   osaf_mutex_unlock_ordie(s_agent_startup_mutex);
   return m_LEAP_DBG_SINK(NCSCC_RC_FAILURE);
   } else {
 - m_NCS_DBG_PRINTF(\nMQSV:MQA:ON);
 + printf(\nMQSV:MQA:ON);
   mqa_use_count = 1;
   }
   
 diff --git a/osaf/libs/agents/saf/plma/plma_init.c 
 b/osaf/libs/agents/saf/plma/plma_init.c
 --- a/osaf/libs/agents/saf/plma/plma_init.c
 +++ b/osaf/libs/agents/saf/plma/plma_init.c
 @@ -355,7 +355,7 @@ uint32_t ncs_plma_startup()
   return m_LEAP_DBG_SINK(NCSCC_RC_FAILURE);
   }else{
   /** Initialize the library for the first time */
 - m_NCS_DBG_PRINTF(\nPLMSV:PLMA:ON);
 + printf(\nPLMSV:PLMA:ON);
   plma_use_count = 1;
   }
   osaf_mutex_unlock_ordie(s_agent_startup_mutex);
 diff --git a/osaf/libs/core/include/ncs_osprm.h 
 b/osaf/libs/core/include/ncs_osprm.h
 --- a/osaf/libs/core/include/ncs_osprm.h
 +++ b/osaf/libs/core/include/ncs_osprm.h
 @@ -143,22 +143,15 @@ extern C {
   } NCS_OS_TASK_REQUEST;
   
   
 /
 - 
 - 
 - 
 - ****
**
 **
** Lock Interface Primitives  
 **
**
 **
** This interface is used by the client to control access to data or  
 **
 - ** other shared resources. The interface utilizes the typedef NCS_OS_LOCK  
 **
 - ** for processing object access requests. The NCS_OS_LOCK typedef is   
 **
 + ** other shared resources. The interface utilizes the typedef NCS_OS_LOCK **
 + ** for processing object access requests. The NCS_OS_LOCK typedef is  **
** DEFINED BY THE TARGET SYSTEM in any manner necessary to carry the  
 **
** information needed to implement the interface. 
 **
**
 **
 - 
 - 
 - 

 ***/
   
   
 /
 @@ -805,21 +798,6 @@ uint32_t ncs_os_posix_mq(NCS_OS_POSIX_MQ

 /
   #define m_NCS_OS_GET_TIME_STAMP

Re: [devel] [PATCH 1 of 1] CORE: use _exit instead of exit in daemon_exit #651

2013-12-09 Thread Anders Widell
Ack with comments.

1) In the commit message:

* The component name should be base:, not CORE:

* The ticket number should be surrounded with square brackets so that 
SourceForge recognizes it as a ticket reference.

* The commit message should have a longer description explaining why 
this change was done (i.e. that we wish to dump coverage data on 
termination, but that exit() cannot be used since it is not thread-safe).

2) I usually prefer to use _Exit() over _exit() since the former one is 
declared as nothrow.

regards,
Anders Widell

2013-12-09 09:23, Hans Nordeback skrev:
   osaf/libs/core/common/daemon.c |  8 +++-
   1 files changed, 7 insertions(+), 1 deletions(-)


 use _exit instead of exit in daemon_exit

 diff --git a/osaf/libs/core/common/daemon.c b/osaf/libs/core/common/daemon.c
 --- a/osaf/libs/core/common/daemon.c
 +++ b/osaf/libs/core/common/daemon.c
 @@ -43,6 +43,8 @@
   
   #define DEFAULT_RUNAS_USERNAME  opensaf
   
 +extern  void __gcov_flush(void) __attribute__((weak));
 +
   static char __pidfile[NAME_MAX];
   static char __tracefile[NAME_MAX];
   static char __runas_username[UT_NAMESIZE];
 @@ -364,7 +366,11 @@ static void sigterm_handler(int sig)
   void daemon_exit(void)
   {
   syslog(LOG_NOTICE, exiting on signal %d, SIGTERM);
 - exit(0);
 +
 + if (__gcov_flush) {
 + __gcov_flush();
 + }
 + _exit(0);
   }
   
   /**


--
Sponsored by Intel(R) XDK 
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 1 of 1] build: Add extra GCC hardening compilation flags [#650]

2013-12-09 Thread Anders Widell
 00-README.conf   |   2 +-
 Makefile.common  |   4 ++--
 README   |  16 
 configure.ac |  18 ++
 tools/cluster_sim_uml/README |   2 +-
 5 files changed, 34 insertions(+), 8 deletions(-)


By default, build with the extra hardening flags -D_FORTIFY_SOURCE=2
-fstack-protector for improved security and enhanced run-time error
detection. The flags can be overridden by setting the environment variable
OSAF_HARDEN_FLAGS when building OpenSAF.

Note that -D_FORTIFY_SOURCE=2 is only enabled in optimized builds. To reduce the
risk that a user accidentally builds without optimization by overriding the
default CFLAGS and/or CXXFLAGS, the README files have been updated to recommend
passing preprocessor definitions using CPPFLAGS instead of CFLAGS.

diff --git a/00-README.conf b/00-README.conf
--- a/00-README.conf
+++ b/00-README.conf
@@ -85,7 +85,7 @@ file does not have to be changed unless:
 - OpenSAF should run as a different UNIX group and user than the default 
'opensaf'
   group/user.
 
-   If OpenSAF was built with the flags CFLAGS=-DRUNASROOT, then
+   If OpenSAF was built with the flags CPPFLAGS=-DRUNASROOT, then
change OPENSAF_GROUP and OPENSAF_USER to root i.e. for old (4.2) 
behaviour.
 
For any other user, change OPENSAF_GROUP and OPENSAF_USER accordingly
diff --git a/Makefile.common b/Makefile.common
--- a/Makefile.common
+++ b/Makefile.common
@@ -12,8 +12,8 @@ AM_CPPFLAGS = \
$(CORE_INCLUDES) \
$(all_includes)
 
-AM_CFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC
-AM_CXXFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC -D__STDC_FORMAT_MACROS
+AM_CFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC @OSAF_HARDEN_FLAGS@
+AM_CXXFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC -D__STDC_FORMAT_MACROS 
@OSAF_HARDEN_FLAGS@
 AM_LDFLAGS = -ldl -lrt -lpthread
 
 #
diff --git a/README b/README
--- a/README
+++ b/README
@@ -293,7 +293,7 @@ 1.1.1, 1.1.2 etc.
 To re-enable the old (pre 4.3) non flat addressing, configure the constant
 MDS_USE_SUBSLOT_ID=1 at configure time as in:
 
-% ./configure CFLAGS=-DMDS_USE_SUBSLOT_ID=1 ...
+% ./configure CPPFLAGS=-DMDS_USE_SUBSLOT_ID=1 ...
 
 In the non flat scheme, the slot ID is shifted up 4 bits and subslot ID is 
 added in the 4 LSB. The consequence of this is reduced number of
@@ -308,7 +308,7 @@ 2) Run as root (optional)
 If the old (4.2) behaviour of running all processes as root is desired, use
 the following configure command:
 
-% ./configure CFLAGS=-DRUNASROOT
+% ./configure CPPFLAGS=-DRUNASROOT
 
 
 3) Configure TIPC importance (optional)
@@ -317,13 +317,21 @@ The default TIPC importance is LOW for a
 In some cases the default importance must be changed if e.g. an application 
starves the LOW importance communication level.
 To change the default importance, use the following configure command
 
-   % ./configure CFLAGS=-DTIPCIMPORTANCE=level
+   % ./configure CPPFLAGS=-DTIPCIMPORTANCE=level
where level is any of TIPC_LOW_IMPORTANCE, TIPC_MEDIUM_IMPORTANCE or 
TIPC_HIGH_IMPORTANCE
-   e.g. configure CFLAGS=-DTIPCIMPORTANCE=TIPC_HIGH_IMPORTANCE
+   e.g. configure CPPFLAGS=-DTIPCIMPORTANCE=TIPC_HIGH_IMPORTANCE
 
 Note: Giving same importance to AVND  all other Opensaf models is not 
preferred option. The behavior is unsupported.
 
 
+4) Configure GCC hardening options (optional)
+
+By default, the options -fstack-protector -D_FORTIFY_SOURCE=2 are passed to
+GCC for improved security. You can override these options by setting the
+OSAF_HARDEN_FLAGS when configuring OpenSAF. For example:
+
+   % ./configure OSAF_HARDEN_FLAGS=-fstack-protector-all -D_FORTIFY_SOURCE=2
+
 If you are using a released archive (dist tarball) follow the simple common
 steps:
 
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -545,6 +545,22 @@ if test $enable_imm_pbe = yes; then
PKG_CHECK_MODULES([SQLITE3], [sqlite3])
 fi
 
+if test -z $OSAF_HARDEN_FLAGS; then
+   # _FORTIFY_SOURCE requires optimization, so only enable it in optimized
+   # builds, i.e. when -O is present in both CFLAGS and CXXFLAGS.
+   if echo ${CFLAGS} | grep -q -- -O; then
+   if echo ${CXXFLAGS} | grep -q -- -O; then
+   OSAF_HARDEN_FLAGS=-D_FORTIFY_SOURCE=2
+   fi
+   fi
+   # Also check for -O0 (which explicitly disables optimisation)
+   if echo ${CFLAGS} ${CXXFLAGS} | grep -q -- -O0; then
+   OSAF_HARDEN_FLAGS=
+   fi
+   OSAF_HARDEN_FLAGS=${OSAF_HARDEN_FLAGS} -fstack-protector
+fi
+AC_SUBST(OSAF_HARDEN_FLAGS)
+
 #
 # Checks for header files.
 #
@@ -925,8 +941,10 @@ echo 
 echo  Compiling Options:
 echo ${ECHO_T}  C Compiler: ${CC}
 echo ${ECHO_T}  C++ Compiler: ${CXX}
+echo ${ECHO_T}  CPPFLAGS: ${CPPFLAGS} ${AM_CPPFLAGS}
 echo ${ECHO_T}  CFLAGS: ${CFLAGS} 

Re: [devel] [PATCH 1 of 1] Additional patch for PLM compilation error, for patch-11 (#537)

2013-12-10 Thread Anders Widell
And it is only used at one place in PLM, so the macro can be removed and 
code inserted at that place.

regards,
Anders Widell

2013-12-09 16:13, Hans Feldt skrev:
 If PLM is now the only user of this please change PLM instead.
 /Hans

 On 12/09/2013 08:31 AM, ramesh.bet...@oracle.com wrote:
   osaf/libs/core/include/ncs_osprm.h |  8 
   1 files changed, 8 insertions(+), 0 deletions(-)


 diff --git a/osaf/libs/core/include/ncs_osprm.h 
 b/osaf/libs/core/include/ncs_osprm.h
 --- a/osaf/libs/core/include/ncs_osprm.h
 +++ b/osaf/libs/core/include/ncs_osprm.h
 @@ -798,6 +798,14 @@ uint32_t ncs_os_posix_mq(NCS_OS_POSIX_MQ
 /
   #define m_NCS_OS_GET_TIME_STAMP(timestamp) timestamp=time((time_t*)0)

 +#ifndef m_GET_ASCII_DATE_TIME_STAMP
 +#define m_GET_ASCII_DATE_TIME_STAMP(timestamp, asc_timestamp) \
 +{ \
 +timestamp=(time_t) (time((time_t *) 0)); \
 +strftime((char *)(asc_timestamp), 40, %d%b%Y_%H.%M.%S, 
 localtime(timestamp)); \
 +}
 +#endif
 +

 /
 ** **

 --
  

 Sponsored by Intel(R) XDK
 Develop, test and display web and hybrid apps with a single code base.
 Download it for free now!
 http://pubads.g.doubleclick.net/gampad/clk?id=111408631iu=/4140/ostg.clktrk 

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




--
Sponsored by Intel(R) XDK 
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 07 of 16] base: Deleted patricia.h file [#537]

2013-12-10 Thread Anders Widell
The macro definitions of m_KEY_CMP and m_GET_BIT are wrong: macro 
parameters must always be surrounded with parentheses in the macro 
expression:

#define m_KEY_CMP(t, k1, k2) memcmp(k1, k2, (size_t)(t)-params.key_size)
#define m_GET_BIT(key, bit) ((bit  0) ? 0 : ((int)((*((key) + (bit  
3)))  (7 - (bit  0x07)))  0x01))

should be:

#define m_KEY_CMP(t, k1, k2) memcmp((k1), (k2), 
(size_t)(t)-params.key_size)
#define m_GET_BIT(key, bit) (((bit)  0) ? 0 : ((int)((*((key) + ((bit) 
  3)))  (7 - ((bit)  0x07)))  0x01))

On the other hand, why not convert them to inline functions instead? 
Also, they are only used in patricia.c, so I suggest removing m_KEY_CMP 
and m_GET_BIT from ncspatricia.h and instead adding the following inline 
functions in patricia.c (they should also be given better names, but I 
haven't done that here):

#include stdint.h
#include string.h

static inline int m_KEY_CMP(const NCS_PATRICIA_TREE* t, const uint8_t* 
k1, const uint8_t* k2)
{
 return memcmp(k1, k2, t-params.key_size);
}

static inline int m_GET_BIT(const uint8_t* key, int bit)
{
 return (bit  0) ? 0 : ((int) ((*(key + (bit  3)))  (7 - (bit  
0x07)))  0x01);
}

regards,
Anders Widell

2013-12-05 13:51, ramesh.bet...@oracle.com skrev:
   osaf/libs/core/common/saf_edu.c |   2 +-
   osaf/libs/core/include/ncspatricia.h|   3 +++
   osaf/libs/core/leap/hj_edp.c|   2 +-
   osaf/libs/core/leap/hj_edu.c|   2 +-
   osaf/libs/core/leap/include/Makefile.am |   1 -
   osaf/libs/core/leap/include/patricia.h  |  39 
 ---
   osaf/libs/core/leap/patricia.c  |   2 +-
   osaf/libs/core/mds/mds_main.c   |   2 +-
   8 files changed, 8 insertions(+), 45 deletions(-)


 diff --git a/osaf/libs/core/common/saf_edu.c b/osaf/libs/core/common/saf_edu.c
 --- a/osaf/libs/core/common/saf_edu.c
 +++ b/osaf/libs/core/common/saf_edu.c
 @@ -30,7 +30,7 @@
   
   #include ncsgl_defs.h
   
 -#include patricia.h
 +#include ncspatricia.h
   #include ncsencdec_pub.h
   
   #include saAis.h
 diff --git a/osaf/libs/core/include/ncspatricia.h 
 b/osaf/libs/core/include/ncspatricia.h
 --- a/osaf/libs/core/include/ncspatricia.h
 +++ b/osaf/libs/core/include/ncspatricia.h
 @@ -47,6 +47,9 @@ extern C {
   
   #include ncsgl_defs.h
   
 +#define m_KEY_CMP(t, k1, k2) memcmp(k1, k2, (size_t)(t)-params.key_size)
 +#define m_GET_BIT(key, bit)  ((bit  0) ? 0 : ((int)((*((key) + (bit  3))) 
  (7 - (bit  0x07)))  0x01))
 +
   typedef struct ncs_patricia_params {
   int key_size;   /* 1..NCS_PATRICIA_MAX_KEY_SIZE - in OCTETS */
   int info_size;  /* NOT USED!  Present for 
 backward-compatibility only! */
 diff --git a/osaf/libs/core/leap/hj_edp.c b/osaf/libs/core/leap/hj_edp.c
 --- a/osaf/libs/core/leap/hj_edp.c
 +++ b/osaf/libs/core/leap/hj_edp.c
 @@ -28,7 +28,7 @@
   
   #include ncsgl_defs.h
   #include ncs_osprm.h
 -#include patricia.h
 +#include ncspatricia.h
   #include ncssysf_mem.h
   #include ncsencdec_pub.h
   #include ncs_edu.h
 diff --git a/osaf/libs/core/leap/hj_edu.c b/osaf/libs/core/leap/hj_edu.c
 --- a/osaf/libs/core/leap/hj_edu.c
 +++ b/osaf/libs/core/leap/hj_edu.c
 @@ -31,7 +31,7 @@
   #include ncssysf_def.h
   #include ncssysf_mem.h
   #include sysf_def.h
 -#include patricia.h
 +#include ncspatricia.h
   #include ncssysfpool.h
   #include ncsencdec_pub.h
   #include ncs_edu.h
 diff --git a/osaf/libs/core/leap/include/Makefile.am 
 b/osaf/libs/core/leap/include/Makefile.am
 --- a/osaf/libs/core/leap/include/Makefile.am
 +++ b/osaf/libs/core/leap/include/Makefile.am
 @@ -22,7 +22,6 @@ noinst_HEADERS = \
   ncsdlib.h \
   ncs_edu.h \
   ncs_hdl.h \
 - patricia.h \
   sysf_def.h \
   sysf_exc_scr.h \
   sysf_ipc.h \
 diff --git a/osaf/libs/core/leap/include/patricia.h 
 b/osaf/libs/core/leap/include/patricia.h
 deleted file mode 100644
 --- a/osaf/libs/core/leap/include/patricia.h
 +++ /dev/null
 @@ -1,39 +0,0 @@
 -/*  -*- OpenSAF  -*-
 - *
 - * (C) Copyright 2008 The OpenSAF Foundation
 - *
 - * This program is distributed in the hope that it will be useful, but
 - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 - * or FITNESS FOR A PARTICULAR PURPOSE. This file and program are licensed
 - * under the GNU Lesser General Public License Version 2.1, February 1999.
 - * The complete license can be accessed from the following location:
 - * http://opensource.org/licenses/lgpl-license.php
 - * See the Copying file included with the OpenSAF distribution for full
 - * licensing terms.
 - *
 - * Author(s): Emerson Network Power
 - *
 - */
 -
 -/*
 -
 -  DESCRIPTION:
 -
 -  This module contains declarations pertaining to implementation of
 -  patricia tree search/add/delete functions.
 -
 -**
 -*/
 -
 -/*
 - * Module Inclusion Control

Re: [devel] [PATCH 11 of 16] base: Removed unused macros from ncs_osprm.h, ncssysf_def.h and os_defs.h files [#537]

2013-12-10 Thread Anders Widell
There are printf() and fprintf() calls in this code:

2013-12-05 13:51, ramesh.bet...@oracle.com skrev:
 + printf(\nMQSV:MQD:ON);
   if (mqd_lib_req(lib_create) != NCSCC_RC_SUCCESS) {
   fprintf(stderr, mqd_lib_req FAILED\n);
Since stdout and stderr are redirected to /dev/null in all OpenSAF 
services, these should be removed. Or if they are relevant, the printf's 
can be converted to TRACE() and the fprintf's to LOG_ER().

regards,
Anders Widell


--
Sponsored by Intel(R) XDK 
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 0 of 1] Review Request for base: use _Exit instead of exit in daemon_exit #581

2013-12-10 Thread Anders Widell
Ack with comment. The ticket number is still not surrounded with square 
brackets [#581] in the first line of the commit message.

regards,
Anders Widell

2013-12-10 10:37, Hans Nordeback skrev:
 Summary: base: use _Exit instead of exit in daemon_exit [#581]
 Review request for Trac Ticket(s): 581
 Peer Reviewer(s): AndersW,HansF,Ramesh
 Pull request to:
 Affected branch(es): default(4.4)
 Development branch: default

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


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

 changeset 8d36c7f02507201c39204ad7afc7574bb6cdc4a0
 Author:   Hans Nordeback hans.nordeb...@ericsson.com
 Date: Tue, 10 Dec 2013 10:24:37 +0100

   base: use _Exit instead of exit in daemon_exit #581

   use _Exit instead of exit in daemon_exit. The change was done due to 
 that
   exit() is not thread safe, see e.g. ticket #651. To make it possible to 
 dump
   e.g. coverage data on termination a weak reference to __gcov_flush has 
 been
   added.


 Complete diffstat:
 --
   osaf/libs/core/common/daemon.c |  8 +++-
   1 files changed, 7 insertions(+), 1 deletions(-)


 Testing Commands:
 -
   LIST THE COMMAND LINE TOOLS/STEPS TO TEST YOUR CHANGES


 Testing, Expected Results:
 --
   PASTE COMMAND OUTPUTS / TEST RESULTS


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


 Arch  Built StartedLinux distro
 ---
 mipsn  n
 mips64  n  n
 x86 n  n
 x86_64  y  y
 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.



--
Sponsored by Intel(R) XDK 
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https

Re: [devel] [PATCH 00 of 16] Review Request for Clean up of dead code in base [#537]

2013-12-10 Thread Anders Widell
Ack with the comments I sent out in earlier mails.

Good work, this code is in need of some clean-up and this is a step in 
the right direction!

regards,
Anders Widell

2013-12-05 13:51, ramesh.bet...@oracle.com skrev:
 Summary: Clean up unused code in base [#537]
 Review request for Trac Ticket(s): 537
 Peer Reviewer(s): Mathi, Anders Widell
 Pull request to:
 Affected branch(es): default
 Development branch: default

 
 Impacted area   Impact y/n
 
   Docsn
   Build systemy
   RPM/packaging   n
   Configuration files n
   Startup scripts n
   SAF servicesn
   OpenSAF servicesn
   Core libraries  y
   Samples n
   Tests   n
   Other   n


 Comments (indicate scope for each y above):
 -
 This patch deletes the unused/dead code to in base.


 changeset b0d56871186d8a97f2131f83fcf827048c107cd2
 Author:   Ramesh ramesh.bet...@oracle.com
 Date: Thu, 05 Dec 2013 17:49:32 +0530

   base: Deleted ncs_stack.h ncs_stack_pub.h hj_stack.c files[#537]

 changeset 7be2759a1023bf915aa10fcc0221cc9e889a28b0
 Author:   Ramesh ramesh.bet...@oracle.com
 Date: Thu, 05 Dec 2013 17:51:54 +0530

   base: Deleted ncsft.h file[#537]

 changeset dad744a421692549aa6dda5c72807fa30d04929a
 Author:   Ramesh ramesh.bet...@oracle.com
 Date: Thu, 05 Dec 2013 17:52:50 +0530

   base: Deleted sysf_pat.h file[#537]

 changeset 32a98ce45ccdfd89f8ed18c3b0a80f2a0908ca04
 Author:   Ramesh ramesh.bet...@oracle.com
 Date: Thu, 05 Dec 2013 17:53:39 +0530

   base: Removed unsed macro's from ncs_edu.h[#537]

 changeset bbb812476dd972c1cd03a056beeae960781b7a48
 Author:   Ramesh ramesh.bet...@oracle.com
 Date: Thu, 05 Dec 2013 17:55:01 +0530

   base: Removed MMGR macro's from ncs_hdl.h and replaced with
   malloc,free[#537]

 changeset dfe1c3cc52c8c5cb368db69aaa6b7ef12c2ce9c4
 Author:   Ramesh ramesh.bet...@oracle.com
 Date: Thu, 05 Dec 2013 17:55:57 +0530

   base: Deleted ncs_tasks.h file [#537]

 changeset 4adaa1f162cf09f16fbfaa102f5be17f8c5a7e43
 Author:   Ramesh ramesh.bet...@oracle.com
 Date: Thu, 05 Dec 2013 17:57:14 +0530

   base: Deleted patricia.h file [#537]

 changeset 575febd3754e3e9b78551d3b2902968bd2146dfd
 Author:   Ramesh ramesh.bet...@oracle.com
 Date: Thu, 05 Dec 2013 17:58:34 +0530

   base: Deleted sysf_def.h file [#537]

 changeset 36ce1b7b5ca89857b22010c18254c46b82ec87de
 Author:   Ramesh ramesh.bet...@oracle.com
 Date: Thu, 05 Dec 2013 17:59:30 +0530

   base: Removed MMGR macro's from sysf_exc_scr.h and replaced with 
 malloc,free
   [#537]

 changeset eb0f91da0b8c0c02d10e2fad1c970aaf73a8bdbd
 Author:   Ramesh ramesh.bet...@oracle.com
 Date: Thu, 05 Dec 2013 18:00:25 +0530

   base: Removed unused macros from sysf_ipc.h file. [#537]

 changeset 938d48afeb6ef045e1ec6b85abd3f7a3c0d70a20
 Author:   Ramesh ramesh.bet...@oracle.com
 Date: Thu, 05 Dec 2013 18:01:12 +0530

   base: Removed unused macros from ncs_osprm.h, ncssysf_def.h and 
 os_defs.h
   files [#537]

 changeset dd2c02224b30ec10535027543cc430f2bbd86a29
 Author:   Ramesh ramesh.bet...@oracle.com
 Date: Thu, 05 Dec 2013 18:02:05 +0530

   base: Removed unused macros/structs from ncs_svd.h[#537]

 changeset cda006422f2ba7787c76ae86f4b6020df764131f
 Author:   Ramesh ramesh.bet...@oracle.com
 Date: Thu, 05 Dec 2013 18:03:06 +0530

   base: Removed unused macros from ncs_tmr.h [#537]

 changeset a48c1ceaccff9268bf829aa66631371053c98b9b
 Author:   Ramesh ramesh.bet...@oracle.com
 Date: Thu, 05 Dec 2013 18:04:11 +0530

   base: Removed unsued function definitions from usrbuf.h[#537]

 changeset 9e108ef0dafc4c302153f764a9a6f704acd50a88
 Author:   Ramesh ramesh.bet...@oracle.com
 Date: Thu, 05 Dec 2013 18:05:09 +0530

   base: Deleted ncs_mds_def.h file[#537]

 changeset e9d5f2e96f1d1d775dff577ac346ea8daa08838a
 Author:   Ramesh ramesh.bet...@oracle.com
 Date: Thu, 05 Dec 2013 18:06:16 +0530

   base: Removed unsed functions from ncs_main_pub.h [#537]


 Testing Commands:
 -
 Bring up two controllers, do switch-overs and failovers.

 Testing, Expected Results:
 --
 Should succeed.

 Conditions of Submission:
 -
 Ack from Mathi.


 Arch  Built StartedLinux distro
 ---
 mipsn  n
 mips64  n  n
 x86 n  n
 x86_64  y  y
 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

Re: [devel] [PATCH 1 of 1] build: Add extra GCC hardening compilation flags [#650]

2013-12-10 Thread Anders Widell
Ok, I will close both of them when this is fixed.

regards,
Anders Widell

2013-12-10 15:57, Hans Nordebäck skrev:
 a ticket for this  already exists 
 http://sourceforge.net/p/opensaf/tickets/320/  /BR HansN

 -Original Message-
 From: Anders Widell [mailto:anders.wid...@ericsson.com]
 Sent: den 9 december 2013 12:45
 To: mathi.naic...@oracle.com
 Cc: opensaf-devel@lists.sourceforge.net
 Subject: [devel] [PATCH 1 of 1] build: Add extra GCC hardening compilation 
 flags [#650]

   00-README.conf   |   2 +-
   Makefile.common  |   4 ++--
   README   |  16 
   configure.ac |  18 ++
   tools/cluster_sim_uml/README |   2 +-
   5 files changed, 34 insertions(+), 8 deletions(-)


 By default, build with the extra hardening flags -D_FORTIFY_SOURCE=2 
 -fstack-protector for improved security and enhanced run-time error 
 detection. The flags can be overridden by setting the environment variable 
 OSAF_HARDEN_FLAGS when building OpenSAF.

 Note that -D_FORTIFY_SOURCE=2 is only enabled in optimized builds. To reduce 
 the risk that a user accidentally builds without optimization by overriding 
 the default CFLAGS and/or CXXFLAGS, the README files have been updated to 
 recommend passing preprocessor definitions using CPPFLAGS instead of CFLAGS.

 diff --git a/00-README.conf b/00-README.conf
 --- a/00-README.conf
 +++ b/00-README.conf
 @@ -85,7 +85,7 @@ file does not have to be changed unless:
   - OpenSAF should run as a different UNIX group and user than the default 
 'opensaf'
 group/user.
   
 - If OpenSAF was built with the flags CFLAGS=-DRUNASROOT, then
 + If OpenSAF was built with the flags CPPFLAGS=-DRUNASROOT, then
   change OPENSAF_GROUP and OPENSAF_USER to root i.e. for old (4.2) 
 behaviour.
   
   For any other user, change OPENSAF_GROUP and OPENSAF_USER accordingly 
 diff --git a/Makefile.common b/Makefile.common
 --- a/Makefile.common
 +++ b/Makefile.common
 @@ -12,8 +12,8 @@ AM_CPPFLAGS = \
   $(CORE_INCLUDES) \
   $(all_includes)
   
 -AM_CFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC -AM_CXXFLAGS = -Wall 
 -fno-strict-aliasing -Werror -fPIC -D__STDC_FORMAT_MACROS
 +AM_CFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC
 +@OSAF_HARDEN_FLAGS@ AM_CXXFLAGS = -Wall -fno-strict-aliasing -Werror
 +-fPIC -D__STDC_FORMAT_MACROS @OSAF_HARDEN_FLAGS@
   AM_LDFLAGS = -ldl -lrt -lpthread
   
   #
 diff --git a/README b/README
 --- a/README
 +++ b/README
 @@ -293,7 +293,7 @@ 1.1.1, 1.1.2 etc.
   To re-enable the old (pre 4.3) non flat addressing, configure the constant
   MDS_USE_SUBSLOT_ID=1 at configure time as in:
   
 -% ./configure CFLAGS=-DMDS_USE_SUBSLOT_ID=1 ...
 +% ./configure CPPFLAGS=-DMDS_USE_SUBSLOT_ID=1 ...
   
   In the non flat scheme, the slot ID is shifted up 4 bits and subslot ID is  
 added in the 4 LSB. The consequence of this is reduced number of @@ -308,7 
 +308,7 @@ 2) Run as root (optional)  If the old (4.2) behaviour of running 
 all processes as root is desired, use  the following configure command:
   
 -% ./configure CFLAGS=-DRUNASROOT
 +% ./configure CPPFLAGS=-DRUNASROOT
   
   
   3) Configure TIPC importance (optional) @@ -317,13 +317,21 @@ The default 
 TIPC importance is LOW for a  In some cases the default importance must be 
 changed if e.g. an application starves the LOW importance communication level.
   To change the default importance, use the following configure command
   
 -   % ./configure CFLAGS=-DTIPCIMPORTANCE=level
 +   % ./configure CPPFLAGS=-DTIPCIMPORTANCE=level
  where level is any of TIPC_LOW_IMPORTANCE, TIPC_MEDIUM_IMPORTANCE or 
 TIPC_HIGH_IMPORTANCE
 -   e.g. configure CFLAGS=-DTIPCIMPORTANCE=TIPC_HIGH_IMPORTANCE
 +   e.g. configure CPPFLAGS=-DTIPCIMPORTANCE=TIPC_HIGH_IMPORTANCE
   
   Note: Giving same importance to AVND  all other Opensaf models is not 
 preferred option. The behavior is unsupported.
   
   
 +4) Configure GCC hardening options (optional)
 +
 +By default, the options -fstack-protector -D_FORTIFY_SOURCE=2 are
 +passed to GCC for improved security. You can override these options by
 +setting the OSAF_HARDEN_FLAGS when configuring OpenSAF. For example:
 +
 +   % ./configure OSAF_HARDEN_FLAGS=-fstack-protector-all 
 -D_FORTIFY_SOURCE=2
 +
   If you are using a released archive (dist tarball) follow the simple common
   steps:
   
 diff --git a/configure.ac b/configure.ac
 --- a/configure.ac
 +++ b/configure.ac
 @@ -545,6 +545,22 @@ if test $enable_imm_pbe = yes; then
   PKG_CHECK_MODULES([SQLITE3], [sqlite3])  fi
   
 +if test -z $OSAF_HARDEN_FLAGS; then
 + # _FORTIFY_SOURCE requires optimization, so only enable it in optimized
 + # builds, i.e. when -O is present in both CFLAGS and CXXFLAGS.
 + if echo ${CFLAGS} | grep -q -- -O; then
 + if echo ${CXXFLAGS} | grep -q -- -O; then
 + OSAF_HARDEN_FLAGS=-D_FORTIFY_SOURCE=2
 + fi
 + fi

[devel] [PATCH 0 of 1] Review Request for java: Fix compiler warnings and treat warnings as errors [#649]

2013-12-12 Thread Anders Widell
Summary: java: Fix compiler warnings and treat warnings as errors [#649]
Review request for Trac Ticket(s): 649
Peer Reviewer(s): Mathi
Pull request to: 
Affected branch(es): opensaf-4.2.x, opensaf-4.3.x, default(4.4)
Development branch: default


Impacted area   Impact y/n

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


Comments (indicate scope for each y above):
-
changeset 5c7edc02bb32b47b6bddde619a440fc1324675d9
Author: Anders Widell anders.wid...@ericsson.com
Date:   Thu, 12 Dec 2013 16:34:13 +0100

java: Fix compiler warnings and treat warnings as errors [#649]

Makefile.common was not included by the makefile for the Java bindings, 
so
warnings were not treated as errors. It is now included, and all 
compiler
warnings in the Java bindings have been fixed. Two of these warnings 
were
actual bugs: the wrong function was called (U_printSaClusterNotification
instead of U_printSaClusterNotification_4, and U_printSaClusterNode 
instead
of U_printSaClusterNode_4).


Complete diffstat:
--
 java/ais_api_impl_native/Makefile.am   |  2 ++
 java/ais_api_impl_native/j_ais_clm_libHandle.c |  2 ++
 java/ais_api_impl_native/j_ais_clm_manager.c   |  4 
 java/ais_api_impl_native/j_ais_socketUtil.c|  3 ---
 java/ais_api_impl_native/j_utils.c |  7 +++
 java/ais_api_impl_native/j_utilsPrint.c|  4 ++--
 6 files changed, 17 insertions(+), 5 deletions(-)


Testing Commands:
-
Build OpenSAF with Java enabled.


Testing, Expected Results:
--
OpenSAF should build and start successfully.


Conditions of Submission:
-
Ack from Mathi


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y
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.


--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility

Re: [devel] [PATCH 1 of 1] base: skip syslog in logtrace when nospc [#658]

2013-12-13 Thread Anders Widell
Ack.

Maybe you could consider if it makes sense to do the following 
improvement, though:

Log to syslog ONCE until the error goes away. This could be done for all 
values of errno (execpt EAGAIN and EINTR) by introducing a flag. When 
write fails, log to syslog once and set the flag. Don't log any more to 
syslog as long as the flag is set. If write is successful again, clear 
the flag.

BTW from a quick look this code seems to contain several problems (not 
related to your patch). Why is it checking for EAGAIN when the file was 
not opened non-blocking? Shouldn't it check for EINTR instead? And maybe 
the file ought to be opened non-blocking? Further up in the code, I see 
wrong usage of return value from snprintf and vsnprintf: these functions 
return -1 on error, and they can return a value larger than maximum 
buffer size in case the string would have overflowed the buffer. This is 
not checked by the code! And the loop (why is it using goto instead of 
an ordinary while loop, btw?) is wrong. If we get EAGAIN, the variable 
i will have the value -1, which is used as size in the next call to 
write(trace_fd, log_string, i). Sigh! Three bugs in the same function.

regards,
Anders Widell

2013-12-13 13:47, Hans Feldt skrev:
   osaf/libs/core/common/logtrace.c |  2 +-
   1 files changed, 1 insertions(+), 1 deletions(-)


 diff --git a/osaf/libs/core/common/logtrace.c 
 b/osaf/libs/core/common/logtrace.c
 --- a/osaf/libs/core/common/logtrace.c
 +++ b/osaf/libs/core/common/logtrace.c
 @@ -120,7 +120,7 @@ write_retry:
   if (i == -1) {
   if (errno == EAGAIN)
   goto write_retry;
 - else
 + else if (errno != ENOSPC)
   syslog(LOG_ERR, logtrace: write failed, %s, 
 strerror(errno));
   }
   }


--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET,  PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] OpenSAF 4.4 Status and Feature Freeze

2013-12-18 Thread Anders Widell
Hi all!

First of all I would like to thank everyone who has been working to get 
the new features ready on time for the OpenSAF 4.4 feature freeze. I am 
really impressed by the progress that has been made during the last few 
weeks, and now we are in a very good shape to keep the planned freeze 
date. Good work!

The plan is to tag OpenSAF 4.4.FC on 2014-01-03.

I know many of you will go on a well-deserved Christmas holiday next 
week. There are still a few open enhancement tickets for OpenSAF 4.4.FC, 
so please try to finish reviews and push before leaving for holiday. If 
there are still some remaining review comments, you can push the code 
anyhow (if maintainers agree) and write defect tickets for the review 
comments. Enhancement tickets that that only affect documentation or 
test cases do not have to be pushed before the freeze. Defect tickets 
don't have to be pushed before the freeze either.

Below is a list of still open enhancement tickets for 4.4.FC:

Anders Widell

452 osaf: Allow us to use more than 1024 file descriptors

A V Mahesh (AVM)

561 CKPT: add CkptArrivalCallback as part of the CKPT API
617 Internal mds/​base function/​api to read ipaddress of the local node

elunlen

152 LOG: remove dependency to shared file system
661 logsv test: Add more features to saflogtest tool

Hans Feldt

569 AMF: make saAmfSGSuHostNodeGroup WRITEABLE
654 MDS improvements
662 AMF: relax saAmfCtSwBundle initialized requirement

hano

94 Convert AMF to C++

Mathi Naickan

220 Support usecase of /​etc/​init.d/​opensafd stop without node reboot
228 Add support for saClmNodeAddress and saClmNodeCurrAddress

Merry Christmas!

/ Anders Widell



--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET,  PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1 of 1] osaf: Improve fault analyse by using current changeset when configuring osaf [#676]

2013-12-19 Thread Anders Widell
Hi!

Some comments:

It seems that if you put it as a static const char* xyz = ABC, then 
the string will be a read-only string that is only present in the 
executable and doesn't get copied into the core dump. To make sure the 
string ends up in the core dump, you could allocate it dynamically by 
doing something like this:

 static const char* internal_version_id_;



 internal_version_id_ = strdup(@(#) $Id:  INTERNAL_VERSION_ID 
 $);
 syslog(LOG_NOTICE, Internal version id: %s, INTERNAL_VERSION_ID);

Also, in the code above I have added @(#) $Id:  as a prefix, so that 
the id string can be identified by running the ident or what command 
on the core dump.

This feature is not specific to AMF, so the strdup() command should not 
be run in AMFD, but rather in some library function that is executed by 
all services.

Also, the modifications to Makefile.common look a bit strange. It seems 
to work, but I find it more natural to do it this way:

AM_CFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC @OSAF_HARDEN_FLAGS@ 
-DINTERNAL_VERSION_ID='@INTERNAL_VERSION_ID@'

regards,
Anders Widell

2013-12-19 09:22, Hans Nordeback skrev:
   Makefile.common |  4 ++--
   configure.ac|  2 ++
   osaf/services/saf/amf/amfd/main.cc  |  4 
   osaf/services/saf/amf/amfnd/main.cc |  4 
   4 files changed, 12 insertions(+), 2 deletions(-)


 Current changeset can be generated and visible in the syslog and in the
 file in question to improve fault analyse.

 diff --git a/Makefile.common b/Makefile.common
 --- a/Makefile.common
 +++ b/Makefile.common
 @@ -12,8 +12,8 @@ AM_CPPFLAGS = \
   $(CORE_INCLUDES) \
   $(all_includes)
   
 -AM_CFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC @OSAF_HARDEN_FLAGS@
 -AM_CXXFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC 
 -D__STDC_FORMAT_MACROS @OSAF_HARDEN_FLAGS@
 +AM_CFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC @OSAF_HARDEN_FLAGS@ 
 -DINTERNAL_VERSION_ID='$(INTERNAL_VERSION_ID)'
 +AM_CXXFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC 
 -D__STDC_FORMAT_MACROS @OSAF_HARDEN_FLAGS@ 
 -DINTERNAL_VERSION_ID='$(INTERNAL_VERSION_ID)'
   AM_LDFLAGS = -ldl -lrt -lpthread
   
   #
 diff --git a/configure.ac b/configure.ac
 --- a/configure.ac
 +++ b/configure.ac
 @@ -32,6 +32,8 @@ AC_USE_SYSTEM_EXTENSIONS
   OPENSAF_LIB_VERSION=0:0:0
   AC_SUBST([OPENSAF_LIB_VERSION])
   
 +AC_SUBST([INTERNAL_VERSION_ID],[$(hg parent --template {rev}:{node|short}) 
 ])
 +
   # FIXME: Until the m4 macro gets cleaned for DSO symbol tests and not 
 executable
   AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test yes = yes)
   #m4_include([m4/linker-script.m4])
 diff --git a/osaf/services/saf/amf/amfd/main.cc 
 b/osaf/services/saf/amf/amfd/main.cc
 --- a/osaf/services/saf/amf/amfd/main.cc
 +++ b/osaf/services/saf/amf/amfd/main.cc
 @@ -63,6 +63,8 @@ enum {
   FD_IMM // must be last
   };
   
 +static const char* internal_version_id_ = INTERNAL_VERSION_ID;
 +
   // Singleton Control Block. Statically allocated
   static AVD_CL_CB _control_block;
   
 @@ -627,6 +629,8 @@ static void main_loop(void)
   // will unwind the stack and thus no call chain will be available.
   std::set_new_handler(new_handler);
   
 + syslog(LOG_NOTICE, Internal version id: %s, internal_version_id_);
 + 
   mbx_fd = ncs_ipc_get_sel_obj(cb-avd_mbx);
   daemon_sigterm_install(term_fd);
   
 diff --git a/osaf/services/saf/amf/amfnd/main.cc 
 b/osaf/services/saf/amf/amfnd/main.cc
 --- a/osaf/services/saf/amf/amfnd/main.cc
 +++ b/osaf/services/saf/amf/amfnd/main.cc
 @@ -37,6 +37,8 @@
   #define FD_CLM   2
   #define FD_MBCSV 3
   
 +static const char* internal_version_id_ = INTERNAL_VERSION_ID;
 +
   static NCS_SEL_OBJ term_sel_obj; /* Selection object for TERM signal events 
 */
   
   static void avnd_evt_process(AVND_EVT *);
 @@ -551,6 +553,8 @@ void avnd_main_process(void)
   
   TRACE_ENTER();
   
 + syslog(LOG_NOTICE, Internal version id: %s, internal_version_id_);
 +
   if (avnd_create() != NCSCC_RC_SUCCESS) {
   LOG_ER(avnd_create failed);
   goto done;


--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET,  PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1 of 1] osaf: Improve fault analyse by using current changeset when configuring osaf [#676]

2013-12-20 Thread Anders Widell
I think something like this could do the trick:

In configure.ac:

INTERNAL_VERSION_ID=0:
AC_SUBST([INTERNAL_VERSION_ID])

In bootstrap.sh:

autoreconf -vi
sed -i s/^INTERNAL_VERSION_ID=.*\$/INTERNAL_VERSION_ID=$(hg parent 
--template {rev}:{node|short})/ configure

regards,
Anders Widell

2013-12-19 16:39, Hans Nordeback skrev:
   Makefile.common  |  4 ++--
   configure.ac |  2 ++
   osaf/libs/core/common/daemon.c   |  4 
   osaf/services/infrastructure/nid/scripts/opensafd.in |  4 +++-
   4 files changed, 11 insertions(+), 3 deletions(-)


 Current changeset can be generated and visible in the syslog and in the
 file in question to improve fault analyse. Updated wih review comments.

 diff --git a/Makefile.common b/Makefile.common
 --- a/Makefile.common
 +++ b/Makefile.common
 @@ -12,8 +12,8 @@ AM_CPPFLAGS = \
   $(CORE_INCLUDES) \
   $(all_includes)
   
 -AM_CFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC @OSAF_HARDEN_FLAGS@
 -AM_CXXFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC 
 -D__STDC_FORMAT_MACROS @OSAF_HARDEN_FLAGS@
 +AM_CFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC @OSAF_HARDEN_FLAGS@ 
 -DINTERNAL_VERSION_ID='@INTERNAL_VERSION_ID@'
 +AM_CXXFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC 
 -D__STDC_FORMAT_MACROS @OSAF_HARDEN_FLAGS@ 
 -DINTERNAL_VERSION_ID='@INTERNAL_VERSION_ID@'
   AM_LDFLAGS = -ldl -lrt -lpthread
   
   #
 diff --git a/configure.ac b/configure.ac
 --- a/configure.ac
 +++ b/configure.ac
 @@ -32,6 +32,8 @@ AC_USE_SYSTEM_EXTENSIONS
   OPENSAF_LIB_VERSION=0:0:0
   AC_SUBST([OPENSAF_LIB_VERSION])
   
 +AC_SUBST([INTERNAL_VERSION_ID],[$(hg parent --template {rev}:{node|short}) 
 ])
 +
   # FIXME: Until the m4 macro gets cleaned for DSO symbol tests and not 
 executable
   AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test yes = yes)
   #m4_include([m4/linker-script.m4])
 diff --git a/osaf/libs/core/common/daemon.c b/osaf/libs/core/common/daemon.c
 --- a/osaf/libs/core/common/daemon.c
 +++ b/osaf/libs/core/common/daemon.c
 @@ -43,6 +43,8 @@
   
   #define DEFAULT_RUNAS_USERNAME  opensaf
   
 +static const char* internal_version_id_;
 +
   extern  void __gcov_flush(void) __attribute__((weak));
   
   static char __pidfile[NAME_MAX];
 @@ -206,6 +208,8 @@ void daemonize(int argc, char *argv[])
   char buf1[256] = { 0 };
   char buf2[256] = { 0 };
   
 + internal_version_id_ = strdup(@(#) $Id:  INTERNAL_VERSION_ID  $);
 + 
   if (argc  0  argv != NULL) { 
   __parse_options(argc, argv);
   openlog(basename(argv[0]), LOG_PID, LOG_LOCAL0);
 diff --git a/osaf/services/infrastructure/nid/scripts/opensafd.in 
 b/osaf/services/infrastructure/nid/scripts/opensafd.in
 --- a/osaf/services/infrastructure/nid/scripts/opensafd.in
 +++ b/osaf/services/infrastructure/nid/scripts/opensafd.in
 @@ -44,6 +44,8 @@ if [ $osafversion = 1 ] ; then
  osafversion=@OPENSAF_RELEASE@
   fi
   
 +osafcshash=@INTERNAL_VERSION_ID@
 +
   unload_tipc() {
   
   # Unload TIPC if already loaded
 @@ -215,7 +217,7 @@ start() {
   start_daemon $binary $args
   RETVAL=$?
   if [ $RETVAL -eq 0 ]; then
 - logger -t $prog OpenSAF($osafversion) services successfully 
 started
 + logger -t $prog OpenSAF($osafversion - $osafcshash) services 
 successfully started
   touch $lockfile
   log_success_msg
   else


--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET,  PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1 of 1] osaf: Improve fault analyse by using current changeset when configuring osaf [#676]

2014-01-07 Thread Anders Widell
Ack (not tested)

regards,
Anders Widell

2014-01-07 12:35, Hans Nordeback skrev:
   Makefile.common  |  4 ++--
   bootstrap.sh |  4 +++-
   configure.ac |  3 +++
   osaf/libs/core/common/daemon.c   |  4 
   osaf/services/infrastructure/nid/scripts/opensafd.in |  4 +++-
   osaf/services/saf/amf/amfd/main.cc   |  2 ++
   osaf/services/saf/amf/amfnd/main.cc  |  2 ++
   7 files changed, 19 insertions(+), 4 deletions(-)


 Current changeset is visible in the syslog, in corefiles using ident, and also
 in the amfd and amfnd binaries (use ident). Updated wih review comments.

 diff --git a/Makefile.common b/Makefile.common
 --- a/Makefile.common
 +++ b/Makefile.common
 @@ -12,8 +12,8 @@ AM_CPPFLAGS = \
   $(CORE_INCLUDES) \
   $(all_includes)
   
 -AM_CFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC @OSAF_HARDEN_FLAGS@
 -AM_CXXFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC 
 -D__STDC_FORMAT_MACROS @OSAF_HARDEN_FLAGS@
 +AM_CFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC @OSAF_HARDEN_FLAGS@ 
 -DINTERNAL_VERSION_ID='@INTERNAL_VERSION_ID@'
 +AM_CXXFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC 
 -D__STDC_FORMAT_MACROS @OSAF_HARDEN_FLAGS@ 
 -DINTERNAL_VERSION_ID='@INTERNAL_VERSION_ID@'
   AM_LDFLAGS = -ldl -lrt -lpthread
   
   #
 diff --git a/bootstrap.sh b/bootstrap.sh
 --- a/bootstrap.sh
 +++ b/bootstrap.sh
 @@ -1,2 +1,4 @@
   #! /bin/sh
 -exec autoreconf -vi
 +autoreconf -vi
 +
 +sed -i s/^INTERNAL_VERSION_ID=.*\$/INTERNAL_VERSION_ID=$(hg parent 
 --template {rev}:{node|short})/ configure
 diff --git a/configure.ac b/configure.ac
 --- a/configure.ac
 +++ b/configure.ac
 @@ -32,6 +32,9 @@ AC_USE_SYSTEM_EXTENSIONS
   OPENSAF_LIB_VERSION=0:0:0
   AC_SUBST([OPENSAF_LIB_VERSION])
   
 +INTERNAL_VERSION_ID=0:
 +AC_SUBST([INTERNAL_VERSION_ID])
 +
   # FIXME: Until the m4 macro gets cleaned for DSO symbol tests and not 
 executable
   AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test yes = yes)
   #m4_include([m4/linker-script.m4])
 diff --git a/osaf/libs/core/common/daemon.c b/osaf/libs/core/common/daemon.c
 --- a/osaf/libs/core/common/daemon.c
 +++ b/osaf/libs/core/common/daemon.c
 @@ -43,6 +43,8 @@
   
   #define DEFAULT_RUNAS_USERNAME  opensaf
   
 +static const char* internal_version_id_;
 +
   extern  void __gcov_flush(void) __attribute__((weak));
   
   static char __pidfile[NAME_MAX];
 @@ -206,6 +208,8 @@ void daemonize(int argc, char *argv[])
   char buf1[256] = { 0 };
   char buf2[256] = { 0 };
   
 + internal_version_id_ = strdup(@(#) $Id:  INTERNAL_VERSION_ID  $);
 + 
   if (argc  0  argv != NULL) { 
   __parse_options(argc, argv);
   openlog(basename(argv[0]), LOG_PID, LOG_LOCAL0);
 diff --git a/osaf/services/infrastructure/nid/scripts/opensafd.in 
 b/osaf/services/infrastructure/nid/scripts/opensafd.in
 --- a/osaf/services/infrastructure/nid/scripts/opensafd.in
 +++ b/osaf/services/infrastructure/nid/scripts/opensafd.in
 @@ -44,6 +44,8 @@ if [ $osafversion = 1 ] ; then
  osafversion=@OPENSAF_RELEASE@
   fi
   
 +osafcshash=@INTERNAL_VERSION_ID@
 +
   unload_tipc() {
   
   # Unload TIPC if already loaded
 @@ -215,7 +217,7 @@ start() {
   start_daemon $binary $args
   RETVAL=$?
   if [ $RETVAL -eq 0 ]; then
 - logger -t $prog OpenSAF($osafversion) services successfully 
 started
 + logger -t $prog OpenSAF($osafversion - $osafcshash) services 
 successfully started
   touch $lockfile
   log_success_msg
   else
 diff --git a/osaf/services/saf/amf/amfd/main.cc 
 b/osaf/services/saf/amf/amfd/main.cc
 --- a/osaf/services/saf/amf/amfd/main.cc
 +++ b/osaf/services/saf/amf/amfd/main.cc
 @@ -55,6 +55,8 @@
   #include su.h
   #include sutype.h
   
 +static const char* internal_version_id_  __attribute__ ((unused)) = @(#) 
 $Id:  INTERNAL_VERSION_ID  $;
 +
   enum {
   FD_TERM = 0,
   FD_MBX,
 diff --git a/osaf/services/saf/amf/amfnd/main.cc 
 b/osaf/services/saf/amf/amfnd/main.cc
 --- a/osaf/services/saf/amf/amfnd/main.cc
 +++ b/osaf/services/saf/amf/amfnd/main.cc
 @@ -37,6 +37,8 @@
   #define FD_CLM   2
   #define FD_MBCSV 3
   
 +static const char* internal_version_id_  __attribute__ ((unused)) = @(#) 
 $Id:  INTERNAL_VERSION_ID  $;
 +
   static NCS_SEL_OBJ term_sel_obj; /* Selection object for TERM signal events 
 */
   
   static void avnd_evt_process(AVND_EVT *);


--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET,  PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831iu

Re: [devel] [PATCH 08 of 15] amfd: Correct a number of issues identified by Coverity [#680]

2014-01-09 Thread Anders Widell
Hi!

Replacing sprintf with snprintf is an improvement, but error handling is 
still missing in the code below. snprintf() returns -1 in case of an 
error, and it can return a value larger than or equal to 
SA_MAX_NAME_LENGTH in case the concatenation below would have overflowed 
the buffer. In these cases, SaNameT.length would get a value that is 
0x or = SA_MAX_NAME_LENGTH, respectively.

is_config_valid() is a validation function that seems to return 1 when 
successful and 0 otherwise. So if the above case happens, I would guess 
it is a good idea to return 0.

regards,
Anders Widell

2014-01-03 06:51, Gary Lee skrev:
   osaf/services/saf/amf/amfd/compcstype.cc |  5 +++--
   osaf/services/saf/amf/amfd/hlt.cc|  2 +-
   osaf/services/saf/amf/amfd/imm.cc|  9 ++---
   3 files changed, 10 insertions(+), 6 deletions(-)


 * Calling risky function (SECURE_CODING)

 replace calls to sprintf with snprintf

 diff --git a/osaf/services/saf/amf/amfd/compcstype.cc 
 b/osaf/services/saf/amf/amfd/compcstype.cc
 --- a/osaf/services/saf/amf/amfd/compcstype.cc
 +++ b/osaf/services/saf/amf/amfd/compcstype.cc
 @@ -204,7 +204,7 @@
   p = strchr(p, ',');
   *p = '\0';
   
 - ctcstype_name.length = sprintf((char*)ctcstype_name.value, %s,%s, 
 cstype_name, comptype_name-value);
 + ctcstype_name.length = snprintf((char*)ctcstype_name.value, 
 SA_MAX_NAME_LENGTH, %s,%s, cstype_name, comptype_name-value);
   
   if (avd_ctcstype_get(ctcstype_name) == NULL) {
   if (opdata == NULL) {
 @@ -256,7 +256,8 @@
   p = strchr(cstype_name, ',') + 1;
   p = strchr(p, ',');
   *p = '\0';
 - ctcstype_name.length = sprintf((char*)ctcstype_name.value,
 + ctcstype_name.length = snprintf((char*)ctcstype_name.value,
 + SA_MAX_NAME_LENGTH,
   %s,%s, cstype_name, comp-comp_type-name.value);
   
   ctcstype = avd_ctcstype_get(ctcstype_name);
 diff --git a/osaf/services/saf/amf/amfd/hlt.cc 
 b/osaf/services/saf/amf/amfd/hlt.cc
 --- a/osaf/services/saf/amf/amfd/hlt.cc
 +++ b/osaf/services/saf/amf/amfd/hlt.cc
 @@ -115,7 +115,7 @@
   
   comp_name = strstr((char *)opdata-objectName.value, safComp);
   osafassert(comp_name);
 - comp_dn.length = sprintf((char *)comp_dn.value, %s, comp_name);
 + comp_dn.length = snprintf((char *)comp_dn.value, SA_MAX_NAME_LENGTH, 
 %s, comp_name);
   comp = avd_comp_get(comp_dn);
   osafassert(comp);
   
 diff --git a/osaf/services/saf/amf/amfd/imm.cc 
 b/osaf/services/saf/amf/amfd/imm.cc
 --- a/osaf/services/saf/amf/amfd/imm.cc
 +++ b/osaf/services/saf/amf/amfd/imm.cc
 @@ -725,15 +725,18 @@
   if (attrValue-attrValueType == SA_IMM_ATTR_SASTRINGT) {
   SaStringT rdnVal = *((SaStringT 
 *)attrValue-attrValues[0]);
   if ((parent_name != NULL)  
 (parent_name-length  0)) {
 - operation-objectName.length = 
 sprintf((char *)operation-objectName.value,
 + operation-objectName.length = 
 snprintf((char *)operation-objectName.value,
 + SA_MAX_NAME_LENGTH,
   %s,%s, rdnVal, 
 parent_name-value);
   } else {
 - operation-objectName.length = 
 sprintf((char *)operation-objectName.value,
 + operation-objectName.length = 
 snprintf((char *)operation-objectName.value,
 + SA_MAX_NAME_LENGTH,
   %s, rdnVal);
   }
   } else {
   SaNameT *rdnVal = ((SaNameT 
 *)attrValue-attrValues[0]);
 - operation-objectName.length = sprintf((char 
 *)operation-objectName.value,
 + operation-objectName.length = snprintf((char 
 *)operation-objectName.value,
 + SA_MAX_NAME_LENGTH,
   %s,%s, rdnVal-value, 
 parent_name-value);
   }
   

 --
 Rapidly troubleshoot problems before they affect your business. Most IT
 organizations don't have a clear picture of how application performance
 affects their revenue. With AppDynamics, you get 100% visibility into your
 Java,.NET,  PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
 http://pubads.g.doubleclick.net/gampad/clk?id=84349831iu=/4140/ostg.clktrk
 ___
 Opensaf-devel mailing list
 Opensaf-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/opensaf-devel



--
CenturyLink Cloud: The Leader

[devel] [PATCH 0 of 1] Review Request for base: Use default scheduling policy when configured policy is invalid [#690]

2014-01-17 Thread Anders Widell
Summary: base: Use default scheduling policy when configured policy is invalid 
[#690]
Review request for Trac Ticket(s): 690
Peer Reviewer(s): Ramesh
Pull request to: 
Affected branch(es): opensaf-4.2.x, opensaf-4.3.x, opensaf-4.4.x, default(4.5)
Development branch: default


Impacted area   Impact y/n

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


Comments (indicate scope for each y above):
-

changeset b030f158fa19817ac62b65cebf371a8b7167b2b6
Author: Anders Widell anders.wid...@ericsson.com
Date:   Fri, 17 Jan 2014 15:43:56 +0100

base: Use default scheduling policy when configured policy is invalid 
[#690]

OpenSAF would fail to start when an invalid thread scheduling policy has
been configured, e.g. using the following configuration options for one 
of
the OpenSAF services:

export OSAF_MDS_SCHED_PRIORITY=0 export OSAF_MDS_SCHED_POLICY=3

The OpenSAF services fail with the following messages:

Dec 24 14:40:02 SLES_NEW2 opensafd[15010]: ER Timed-out for response 
from
RDE Dec 24 14:40:02 SLES_NEW2 opensafd[15010]: ER Dec 24 14:40:02 
SLES_NEW2
opensafd[15010]: ER Going for recovery Dec 24 14:40:02 SLES_NEW2
opensafd[15010]: ER Trying To RESPAWN 
/usr/lib64/opensaf/clc-cli/osaf-rded
attempt #1 Dec 24 14:40:02 SLES_NEW2 opensafd[15010]: ER Sending 
SIGKILL to
RDE, pid=15031

The reason is that scheduling policy 3 (SCHED_BATCH) is not a valid
parameter to the pthread_attr_setschedpolicy() function, and OpenSAF 
passes
the configured policy to this function without whecking that it is 
valid.

A check for this case has been added, so that we fall back to the 
default
scheduling policy when an invalid policy has been configured.


Complete diffstat:
--
 osaf/libs/core/leap/os_defs.c |  13 +++--
 1 files changed, 7 insertions(+), 6 deletions(-)


Testing Commands:
-
Add the following lines to nid.conf and then start OpenSAF:

export OSAF_MDS_SCHED_PRIORITY=0
export OSAF_MDS_SCHED_POLICY=3


Testing, Expected Results:
--
OpenSAF should start up successfully.


Conditions of Submission:
-
Ack from Ramesh


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y
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

[devel] [PATCH 1 of 1] base: Use default scheduling policy when configured policy is invalid [#690]

2014-01-17 Thread Anders Widell
 osaf/libs/core/leap/os_defs.c |  13 +++--
 1 files changed, 7 insertions(+), 6 deletions(-)


OpenSAF would fail to start when an invalid thread scheduling policy has been
configured, e.g. using the following configuration options for one of the
OpenSAF services:

export OSAF_MDS_SCHED_PRIORITY=0
export OSAF_MDS_SCHED_POLICY=3

The OpenSAF services fail with the following messages:

Dec 24 14:40:02 SLES_NEW2 opensafd[15010]: ER Timed-out for response from RDE
Dec 24 14:40:02 SLES_NEW2 opensafd[15010]: ER
Dec 24 14:40:02 SLES_NEW2 opensafd[15010]: ER Going for recovery
Dec 24 14:40:02 SLES_NEW2 opensafd[15010]: ER Trying To RESPAWN 
/usr/lib64/opensaf/clc-cli/osaf-rded attempt #1
Dec 24 14:40:02 SLES_NEW2 opensafd[15010]: ER Sending SIGKILL to RDE, pid=15031

The reason is that scheduling policy 3 (SCHED_BATCH) is not a valid parameter to
the pthread_attr_setschedpolicy() function, and OpenSAF passes the configured
policy to this function without whecking that it is valid.

A check for this case has been added, so that we fall back to the default
scheduling policy when an invalid policy has been configured.

diff --git a/osaf/libs/core/leap/os_defs.c b/osaf/libs/core/leap/os_defs.c
--- a/osaf/libs/core/leap/os_defs.c
+++ b/osaf/libs/core/leap/os_defs.c
@@ -164,15 +164,16 @@ unsigned int ncs_os_task(NCS_OS_TASK *ta
min_prio = sched_get_priority_min(policy);
max_prio = sched_get_priority_max(policy);

-   if((sp.sched_priority  min_prio) || (sp.sched_priority 
  max_prio)) {
+   if ((sp.sched_priority  min_prio) || 
(sp.sched_priority  max_prio) ||
+   pthread_attr_setschedpolicy(attr, policy) != 0) {
/* Set to defaults */
-   syslog(LOG_NOTICE, scheduling priority %d for 
given policy %d to the task %s is not \
-   within 
the range, setting to default \
-   values , 
sp.sched_priority, policy, task-info.create.i_name);
+   syslog(LOG_NOTICE, scheduling priority %d or 
policy %d for the 
+  task %s is invalid, setting to default 
values,
+  sp.sched_priority, policy, 
task-info.create.i_name);
policy = task-info.create.i_policy;
sp.sched_priority = 
task-info.create.i_priority;
-   syslog(LOG_INFO, %s task default policy is %d, 
\
-   priority is %d, task-info.create.i_name, 
policy, sp.sched_priority);
+   syslog(LOG_INFO, %s task default policy is %d, 
priority is %d,
+  task-info.create.i_name, policy, 
sp.sched_priority);
}

 #ifdef RLIMIT_RTPRIO

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments  Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 1 of 1] mds: Remove unnecessary syslog message about TIPC importance [#755]

2014-01-30 Thread Anders Widell
 osaf/libs/core/mds/mds_dt_tipc.c |  3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)


Remove an unnecessary log message regarding the configured TIPC importance,
that was introduced in ticket [#589]. The information in the log message is
unnecessary since the same information can be found in the README file.

diff --git a/osaf/libs/core/mds/mds_dt_tipc.c b/osaf/libs/core/mds/mds_dt_tipc.c
--- a/osaf/libs/core/mds/mds_dt_tipc.c
+++ b/osaf/libs/core/mds/mds_dt_tipc.c
@@ -1306,9 +1306,6 @@ uint32_t mds_mdtm_svc_install_tipc(PW_EN
int imp = 0;
imp = TIPC_HIGH_IMPORTANCE;
 
-   if (TIPCIMPORTANCE == TIPC_HIGH_IMPORTANCE)
-   LOG_WA(Default TIPC importance set to same level as 
AVND (TIPC_HIGH_IMPORTANCE). A non preferred and untested option);
-
if (setsockopt(tipc_cb.BSRsock, SOL_TIPC, TIPC_IMPORTANCE, 
imp, sizeof(imp)) != 0) {
m_MDS_LOG_ERR(MDTM: Can't set socket option TIPC_IMP 
err :%s\n, strerror(errno));
assert(0);

--
WatchGuard Dimension instantly turns raw network data into actionable 
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991iu=/4140/ostg.clktrk
___
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 mds: Remove unnecessary syslog message about TIPC importance [#755]

2014-01-30 Thread Anders Widell
Summary: mds: Remove unnecessary syslog message about TIPC importance [#755]
Review request for Trac Ticket(s): 755
Peer Reviewer(s): Mahesh
Pull request to: 
Affected branch(es): opensaf-4.2.x, opensaf-4.3.x, opensaf-4.4.x, default(4.5)
Development branch: default


Impacted area   Impact y/n

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


Comments (indicate scope for each y above):
-
changeset 7db32ad52774d8b371b43aa5aabccc6feafa13f2
Author: Anders Widell anders.wid...@ericsson.com
Date:   Thu, 30 Jan 2014 16:46:04 +0100

mds: Remove unnecessary syslog message about TIPC importance [#755]

Remove an unnecessary log message regarding the configured TIPC 
importance,
that was introduced in ticket [#589]. The information in the log 
message is
unnecessary since the same information can be found in the README file.


Complete diffstat:
--
 osaf/libs/core/mds/mds_dt_tipc.c |  3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)


Testing Commands:
-
Build OpenSAF with TIPC enabled and start it.


Testing, Expected Results:
--
OpenSAF should build and start successfully.


Conditions of Submission:
-
Ack from reviewer.


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y
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.


--
WatchGuard Dimension instantly turns raw network data into actionable 
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991iu=/4140/ostg.clktrk
___
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 uml: Update UML environment to Linux 3.13.1, busybox 1.21.1 [#762]

2014-01-31 Thread Anders Widell
Summary: uml: Update UML environment to Linux 3.13.1, busybox 1.21.1 [#762]
Review request for Trac Ticket(s): 762
Peer Reviewer(s): Lennart
Pull request to: 
Affected branch(es): opensaf-4.2.x, opensaf-4.3.x, opensaf-4.4.x, default(4.5)
Development branch: default


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   n
 Other   y


Comments (indicate scope for each y above):
-
changeset 8631919bdd815be3e70e9fc389d84c5911cc2b54
Author: Anders Widell anders.wid...@ericsson.com
Date:   Fri, 31 Jan 2014 14:06:00 +0100

uml: Update UML environment to Linux 3.13.1, busybox 1.21.1 [#762]

Update the kernel version used in UML, so that it starts up properly on
Fedora 20. The new kernel version also fixes the problem that UML did 
not
work with a memory size larger than the default 128 MiB.


Complete diffstat:
--
 tools/cluster_sim_uml/uml/build_uml  |15 +-
 tools/cluster_sim_uml/uml/config/busybox-1.19.4  |  1001 
---
 tools/cluster_sim_uml/uml/config/busybox-1.21.1  |  1022 
+
 tools/cluster_sim_uml/uml/config/linux-3.13.1-i686   |  1044 

 tools/cluster_sim_uml/uml/config/linux-3.13.1-x86_64 |  1013 

 tools/cluster_sim_uml/uml/config/linux-3.4.2-i686|   947 
-
 tools/cluster_sim_uml/uml/config/linux-3.4.2-x86_64  |   918 
--
 7 files changed, 3090 insertions(+), 2870 deletions(-)


Testing Commands:
-
Build the UML environment and start it.


Testing, Expected Results:
--
UML should build and start successfully.


Conditions of Submission:
-
Ack from reviewer.


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 y  y
x86_64  y  y
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

Re: [devel] [PATCH 0 of 2] Review Request for fm: failover using OPENSAF_MANAGE_TIPC flag and failover after down of critical services [#721]

2014-02-04 Thread Anders Widell
I am not sure if I fully understand the use case. You say that this is 
for failover without OS reboot, but at the same time you say that FM 
will stay alive until it is killed by the OS reboot, and the peer FM 
will not take over until it receives a service down of FM. Could you 
elaborate a bit on this?

thanks
/ Anders Widell

2014-01-29 19:00, mathi.naic...@oracle.com skrev:
 Summary: failover using OPENSAF_MANAGE_TIPC flag and failover after down of 
 critical services [#721]
 Review request for Trac Ticket(s): #721
 Peer Reviewer(s): ramesh.bet...@oracle.com, anders.wid...@ericsson.com
 Pull request to: LIST THE PERSON WITH PUSH ACCESS HERE
 Affected branch(es): opensaf-4.4.x, 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 servicesy
   Core libraries  n
   Samples n
   Tests   n
   Other   n


 Comments (indicate scope for each y above):
 -
 Two cases are supported by this patch

 1) Failover in 4.4.x, and default will be the same as previous releases.
 i.e. as usual FM trigerres failover upon receiving the NODE_DOWN event.
 2) The main goal of the patch is w.r.t failover without OS reboot through
 /etc/init.d/opensafd stop is more controlled now in the scenario when amfnd 
 itself crashes.
 FM trigers failover after DOWNs of AMF, IMM and FM.

 More info of these cases:
 1) The flag OPENSAF_MANAGE_TIPC=yes is used to control when failover is 
 trigerred.
 This way, the default failover behaviour will now be the same as the previous 
 releases.
 There is no change involved.

 2) In the usecase of failover (involving /etc/init.d/opensafd stop) without 
 OS reboot cycle,
 the flag nid.conf is set to OPENSAF_MANAGE_TIPC=no. This usecase is currently
 intact, however some considerations need to be made ito handle the scenrio 
 when amfnd itself crashes.

 For this FM shall subscribe to service downs of AMFD, AMFND, IMMD, IMMND AND 
 FM and FM
 by way of installing amfnd_down_callback shall exit only when the OS reboot 
 terminates FM.
 The peer FM will the failover once downs of all these services are received.

 changeset c1875b7073b5fa2a1b9ae8755a15f6e8a6bf1aaf
 Author:   Mathivanan N.P.mathi.naic...@oracle.com
 Date: Wed, 29 Jan 2014 23:08:05 +0530

   fm: failover using OPENSAF_MANAGE_TIPC flag and subscribe to AMF, IMM 
 downs
   [#721] To support failover without OS reboot, FM subscribed to AMFND 
 down
   events. But this may not be sufficient in scenarios when AMFND itself
   crashes or exits. In this scenario, the exit/kill of OpenSAF processes 
 need
   not be in order and immediate. This can create a scenario where some 
 OpenSAF
   process may still be running, but FM has already started failover
   processing. To avoid this, FM subscribes to the down events of critical
   opensaf services - AMFD, AMFND, IMMD, IMMND In a false/quick failover
   scenario, these are the services that can lead to problems like
   implementerset not cleared or dangling AMF state assignments. 
 Currently, all
   OpenSAF services exit upon receiving the AMFND down events, but even 
 this
   does not guarantee immediate and ordered delivery of down events. The 
 next
   patch in this series of 2 patches makes FM to install
   ava_amfnd_down_callback such that FM waits forever till the OS kills FM.

 changeset 77232a084d58b68c8b470f7b90fa6a2df541183d
 Author:   Mathivanan N.P.mathi.naic...@oracle.com
 Date: Wed, 29 Jan 2014 23:13:27 +0530

   fm: install ava_install_amf_down_cb and wait till OS reboot terminates 
 FM
   [#721] FM installs amfnd down callback and upon receiving the amfnd down
   event, shall wait till the OS reboot(trigerred by amfnd crash or exit)
   terminates FM. The STANDBY FM will now start the failover after 
 recieving
   the downs of all AMFD, AMFND, IMMD, IMMND and FM


 Complete diffstat:
 --
   osaf/services/infrastructure/fm/fms/fm.h |2 +
   osaf/services/infrastructure/fm/fms/fm_amf.c |   18 +++
   osaf/services/infrastructure/fm/fms/fm_cb.h  |8 +
   osaf/services/infrastructure/fm/fms/fm_evt.h |2 +
   osaf/services/infrastructure/fm/fms/fm_main.c|   86 
 --
   osaf/services/infrastructure/fm/fms/fm_mds.c |  155 
 +--
   osaf/services/infrastructure/fm/fms/fm_mds.h |1 +
   osaf/services/infrastructure/nid/config/nid.conf |2 +-
   8 files changed, 222 insertions(+), 52 deletions

Re: [devel] [PATCH 0 of 2] Review Request for fm: failover using OPENSAF_MANAGE_TIPC flag and failover after down of critical services [#721]

2014-02-04 Thread Anders Widell
Ok, now I see what you mean. In the case of failover without OS reboot, 
the FM process is terminated and will not perform the waiting.

/ Anders Widell

2014-02-04 12:56, Mathivanan Naickan Palanivelu skrev:
 - anders.wid...@ericsson.com wrote:

 I am not sure if I fully understand the use case. You say that this is

 for failover without OS reboot, but at the same time you say that FM
 will stay alive until it is killed by the OS reboot, and the peer FM
 will not take over until it receives a service down of FM. Could you
 elaborate a bit on this?

 Support for failover without OS reboot would mean support for
 failover by means of /etc/init.d/opensafd 'stop' without rmmod tipc
 (i.e. The OS is up, non-OpenSAF applications are on and using TIPC).
 Now, a mechanism that supports this scenario should also handle the
 case when AMFND 'crashes' and node reboot got trigerred.

 In both the cases, the peer FM will failover only after downs of
 all - AMFD, AMFND, IMMD, IMMND, FM are received.

 - In the 'stop' case, all processes are terminated by AMFND first. 
 Subsequently
 AMFND and AMFD exit last.
 - In the 'amfnd crash' case, all middleware processes terminate themselves 
 upon detecting
 AMFND crash. But local FM will not exit upon detecting AMFND crash because
 there is no guarantee that application processes have exited at that point of
 time and therefore the local FM will 'wait' until the OS terminates it.

 It is for this 'waiting' period, that the proposal to run a system_fencer 
 script
 on systems with delayed(by design or fault) reboots, has been made in a 
 separate patch
 for TLC approval.


 Cheers,
 Mathi.

 thanks
 / Anders Widell

 2014-01-29 19:00, mathi.naic...@oracle.com skrev:
 Summary: failover using OPENSAF_MANAGE_TIPC flag and failover after
 down of critical services [#721]
 Review request for Trac Ticket(s): #721
 Peer Reviewer(s): ramesh.bet...@oracle.com,
 anders.wid...@ericsson.com
 Pull request to: LIST THE PERSON WITH PUSH ACCESS HERE
 Affected branch(es): opensaf-4.4.x, 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 servicesy
Core libraries  n
Samples n
Tests   n
Other   n


 Comments (indicate scope for each y above):
 -
 Two cases are supported by this patch

 1) Failover in 4.4.x, and default will be the same as previous
 releases.
 i.e. as usual FM trigerres failover upon receiving the NODE_DOWN
 event.
 2) The main goal of the patch is w.r.t failover without OS reboot
 through
 /etc/init.d/opensafd stop is more controlled now in the scenario
 when amfnd itself crashes.
 FM trigers failover after DOWNs of AMF, IMM and FM.

 More info of these cases:
 1) The flag OPENSAF_MANAGE_TIPC=yes is used to control when failover
 is trigerred.
 This way, the default failover behaviour will now be the same as the
 previous releases.
 There is no change involved.

 2) In the usecase of failover (involving /etc/init.d/opensafd stop)
 without OS reboot cycle,
 the flag nid.conf is set to OPENSAF_MANAGE_TIPC=no. This usecase is
 currently
 intact, however some considerations need to be made ito handle the
 scenrio when amfnd itself crashes.
 For this FM shall subscribe to service downs of AMFD, AMFND, IMMD,
 IMMND AND FM and FM
 by way of installing amfnd_down_callback shall exit only when the OS
 reboot terminates FM.
 The peer FM will the failover once downs of all these services are
 received.
 changeset c1875b7073b5fa2a1b9ae8755a15f6e8a6bf1aaf
 Author: Mathivanan N.P.mathi.naic...@oracle.com
 Date:   Wed, 29 Jan 2014 23:08:05 +0530

 fm: failover using OPENSAF_MANAGE_TIPC flag and subscribe to AMF,
 IMM downs
 [#721] To support failover without OS reboot, FM subscribed to
 AMFND down
 events. But this may not be sufficient in scenarios when AMFND
 itself
 crashes or exits. In this scenario, the exit/kill of OpenSAF
 processes need
 not be in order and immediate. This can create a scenario where
 some OpenSAF
 process may still be running, but FM has already started failover
 processing. To avoid this, FM subscribes to the down events of
 critical
 opensaf services - AMFD, AMFND, IMMD, IMMND In a false/quick
 failover
 scenario, these are the services that can lead to problems like
 implementerset not cleared or dangling AMF state assignments.
 Currently, all
 OpenSAF services exit upon receiving the AMFND down events, but
 even this
 does not guarantee immediate and ordered delivery of down events.
 The next
 patch in this series of 2 patches makes FM to install
 ava_amfnd_down_callback such that FM

Re: [devel] checkpoint section create performance

2014-02-04 Thread Anders Widell
Well, except for the code in the agent library. That code must be 
written in C.

regards,
Anders Widell

2014-02-04 15:59, Anders Widell skrev:
 Hi guys!

 Just to let you know: we are trying to move away from the patricia tree
 code and use C++ STL instead. So if you already have implemented this
 with an STL map, there is no need to port it to use the patricia tree.

 regards,
 Anders Widell

 2014-02-04 15:24, Domrachev, Mikhail skrev:
 Hi, Alex.

 Currently I'm fixing that issue too. You said that you going to reimplement 
 the cpnd database, so if it's done could you please share the patch?
 Or we could fix that trouble together and divide work between us. What do 
 you think about it?

 Thanks.
 _
 Mikhail Domrachev
 Software Engineer
 OpenEPC

 --
 Managing the Performance of Cloud-Based Applications
 Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
 Read the Whitepaper.
 http://pubads.g.doubleclick.net/gampad/clk?id=121051231iu=/4140/ostg.clktrk
 ___
 Opensaf-devel mailing list
 Opensaf-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/opensaf-devel



 --
 Managing the Performance of Cloud-Based Applications
 Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
 Read the Whitepaper.
 http://pubads.g.doubleclick.net/gampad/clk?id=121051231iu=/4140/ostg.clktrk
 ___
 Opensaf-devel mailing list
 Opensaf-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/opensaf-devel




--
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] checkpoint section create performance

2014-02-04 Thread Anders Widell
Hi guys!

Just to let you know: we are trying to move away from the patricia tree 
code and use C++ STL instead. So if you already have implemented this 
with an STL map, there is no need to port it to use the patricia tree.

regards,
Anders Widell

2014-02-04 15:24, Domrachev, Mikhail skrev:
 Hi, Alex.

 Currently I'm fixing that issue too. You said that you going to reimplement 
 the cpnd database, so if it's done could you please share the patch?
 Or we could fix that trouble together and divide work between us. What do you 
 think about it?

 Thanks.
 _
 Mikhail Domrachev
 Software Engineer
 OpenEPC

 --
 Managing the Performance of Cloud-Based Applications
 Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
 Read the Whitepaper.
 http://pubads.g.doubleclick.net/gampad/clk?id=121051231iu=/4140/ostg.clktrk
 ___
 Opensaf-devel mailing list
 Opensaf-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/opensaf-devel




--
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 1 of 1] osaf: Update the commit message template [#791]

2014-02-17 Thread Anders Widell
 tools/devel/review/00-README   |  77 ++---
 tools/devel/review/commit.template |  51 ++--
 tools/devel/review/hgeditor.sh |  32 +++
 3 files changed, 91 insertions(+), 69 deletions(-)


Update the commit message template with the agreeed format for how to write
commit messages in OpenSAF. Add a shell script that can be used to set the
default commit message in Mercurial to the commit message template.

diff --git a/tools/devel/review/00-README b/tools/devel/review/00-README
--- a/tools/devel/review/00-README
+++ b/tools/devel/review/00-README
@@ -1,79 +1,24 @@
 Commit Message Format
 =
 
-The patch review process heavily relies on properly formatted commit message.
-This section will describe how commit message should be formatted and the
-relation it has with the patch review process by email.
-
-A commit message should comply to the following template:
-
-* First line  : 80-chars long one line short description (#ticket). Describe 
what
-the patch is doing logically (not the bug description)
-* Second line : Blank
-* Third line+ : 80-chars long lines for a more complete description
-
---
-example: this is a one line short description (#2000)
-
-This is a more elaborate description that explains your changes and the
-original problem and how it got solved.
-
- * Blah
- * Blah
-
-Signed-off-by: John Doe john@example.com
---
-
-The first line will be grabbed by the 'hg email' command and added as the
-subject of the patch, hence the why it should be short and precise. Note that 
it
-also contains the area/module/feature of the changes (i.e. example:). If you
-have trouble identifying the unique nature of the patch, your patch is probably
-way to long and should be divided in a series.
-
-The Ticket # in a future integration will be used on the Trac web interface to
-correlate tickets and commits. It will also be used by Mercurial hooks to
-close/fix tickets automatically if needed.
-
-The long description gives more details about the patch/changeset.
-
-The SOB tag is the original patch author.
-
+The patch review process heavily relies on properly formatted commit messages.
+Use the file commit.template in this directory as a template when writing
+commit messages. Make sure that your commit message contains all the necessary
+parts, i.e. the component name, a short description, the ticket number and
+a long description.
 
 Default Commit Message Template
 ===
 
-Apparently Mercurial lacks the support of customizing the default commit 
message
-based on a template file somewhere in the repository.
+Enter the following set of commands to set up the commit.template as the 
default
+commit message in Mercurial (you need to log out and log in again for the 
change
+to take effect):
 
-The Qct extension can be installed and used in your ~/.hgrc profile to point to
-a template file, so that you're nagged every time how to fill the commit
-message properly ;)
-
-For instance under Red Hat/Fedora the package is called 'qct-mercurial'
-
-   % yum install qct-mercurial
-   % yum install qct
-
-http://www.selenic.com/mercurial/wiki/index.cgi/QctExtension
-
-Under './tools/devel/review/commit.template', you'll find a default template 
that you
-can use with the Qct extension. The extension automatically looks for a 
template
-file under `hg root`/.commit.template, a copy is already placed in the OpenSAF
-repository for developer that would like to use the Qct extension.
-
---
-[extensions]
-hgext.qct =
-
-[qct]
-signoff = Signed-off-by: John Doe john@example.com
---
-
-To use the Qct Extension, you'll have to commit your changes using the 'hg
-commit-tool | hg qct' command. The tool has neat features, like dynamically
-deciding which files will be part of the current commit etc. But it might bug
-some developers since it pops up a GUI.
-
+mkdir ~/bin
+cp hgeditor.sh ~/bin
+chmod 755 ~/bin/hgeditor.sh
+echo export HGEDITOR=~/bin/hgeditor.sh  ~/.bashrc
+echo setenv HGEDITOR ~/bin/hgeditor.sh  ~/.cshrc
 
 Mercurial Settings Needed for Email Review
 ==
diff --git a/tools/devel/review/commit.template 
b/tools/devel/review/commit.template
--- a/tools/devel/review/commit.template
+++ b/tools/devel/review/commit.template
@@ -1,6 +1,47 @@
-module: this is a one line short description
+component: short_description [#ticket_number]
 
-Ticket #xxx (delete me if none)
-
-This is a more elaborate description that explains your changes and the
-original problem and how it got solved.
+long_description
+HG:
+HG: Enter commit message.  Lines beginning with 'HG:' are removed.
+HG: An empty message aborts the commit.
+HG:
+HG: Edit the different parts of the commit message template above as follows:
+HG:
+HG: component
+HG:   Concatenation 

[devel] [PATCH 0 of 1] Review Request for osaf: Update the commit message template [#791]

2014-02-17 Thread Anders Widell
Summary: osaf: Update the commit message template [#791]
Review request for Trac Ticket(s): 791
Peer Reviewer(s): TLC
Pull request to: 
Affected branch(es): opensaf-4.2.x, opensaf-4.3.x, opensaf-4.4.x, default(4.5)
Development branch: default


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   n
 Other   y


Comments (indicate scope for each y above):
-

changeset 27485a5e44ed4fbc542f24ecc11a6c97df9c5bc8
Author: Anders Widell anders.wid...@ericsson.com
Date:   Mon, 17 Feb 2014 17:40:30 +0100

osaf: Update the commit message template [#791]

Update the commit message template with the agreeed format for how to 
write
commit messages in OpenSAF. Add a shell script that can be used to set 
the
default commit message in Mercurial to the commit message template.


Complete diffstat:
--
 tools/devel/review/00-README   |  77 
+
 tools/devel/review/commit.template |  51 
++-
 tools/devel/review/hgeditor.sh |  32 
 3 files changed, 91 insertions(+), 69 deletions(-)


Testing Commands:
-
Execute the commands listed in tools/devel/review/00-README for setting the
default commit message in Mercurial. Test it by running e.g. hg commit


Testing, Expected Results:
--
Default commit message in Mercurial should be the commit message template.


Conditions of Submission:
-
Ack from TLC


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.


--
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https

Re: [devel] [PATCH 0 of 1] Review Request for rde: print controller role as string and refine log messages [#63]

2014-02-21 Thread Anders Widell
Ack with comments.

1) It is probably a good idea to validate that role is within bounds 
before accessing the array with strings role_string[role]. It could be 
done e.g. in the following way:

LOG_NO(RDE role set to %s, role = 0  role  sizeof(role_string) / 
sizeof(role_string[0]) ? role_string[role] : ?);

2) Shouldn't the strings match the enum values? The PCS_RDA_ROLE enum 
has the following definition:

typedef enum {
 PCS_RDA_UNDEFINED = 0,
 PCS_RDA_ACTIVE,
 PCS_RDA_STANDBY,
 PCS_RDA_QUIESCED,
 PCS_RDA_ASSERTING,
 PCS_RDA_YIELDING
} PCS_RDA_ROLE;

/ Anders W

2014-02-19 02:43, mathi.naic...@oracle.com skrev:
 Summary: rde: print controller role as string and refine log messages [#63]
 Review request for Trac Ticket(s): #63
 Peer Reviewer(s): anders.wid...@ericsson.com
 Pull request to: LIST THE PERSON WITH PUSH ACCESS HERE
 Affected branch(es): opensaf-4.2.x, 4.3.x, 4.x, 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 servicesy
   Core libraries  n
   Samples n
   Tests   n
   Other   n


 Comments (indicate scope for each y above):
 -
 RDE currently prints the role as numbers. This is difficult
 to understand.
 Also, initial startup and role changes, the current log
 message can be improved.

 changeset c63500ec07ac08b87235d00b7ffe1d4b0d0eb9aa
 Author:   Mathivanan N.P.mathi.naic...@oracle.com
 Date: Tue, 18 Feb 2014 20:39:18 -0500

   rde: print controller role as string and refine log messages [#63]


 Complete diffstat:
 --
   osaf/services/infrastructure/rde/rde_main.c |  24 +---
   1 files changed, 17 insertions(+), 7 deletions(-)


 Testing Commands:
 -
   - Note the roles getting printed as strings instead of numbers.
   - The log string during initial startup, switchover, failover should
   look more understandable.


 Testing, Expected Results:
 --
   - Note the roles getting printed as strings instead of numbers.
   - The log string during initial startup, switchover, failover should
   look more understandable.

 Conditions of Submission:
 -
 Ack from Anders.

 Arch  Built StartedLinux distro
 ---
 mipsn  n
 mips64  n  n
 x86 n  n
 x86_64  y  y
 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 

Re: [devel] [PATCH 0 of 5] Review Request for osaf: use common sigterm handler [#512]

2014-02-21 Thread Anders Widell
Ack with comment. Please use NUM_FD instead of writing e.g. the number 5 
directly in the code:

+static struct pollfd fds[5];
+static nfds_t nfds = 5;

replace with:

+static struct pollfd fds[NUM_FD];
+static nfds_t nfds = NUM_FD;

and:

+   while (osaf_poll(sel[0], 3, -1)  0) {

replace with:

+   while (osaf_poll(sel[0], NUM_FD, -1)  0) {

/ Anders Widell

2014-02-19 02:36, mathi.naic...@oracle.com skrev:
 Summary: use common sigterm handler  [#512]
 Review request for Trac Ticket(s): #512
 Peer Reviewer(s): anders.wid...@ericsson.com
 Pull request to: LIST THE PERSON WITH PUSH ACCESS HERE
 Affected branch(es): 4.4.x, 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):
 -
 All OpenSAF core services and CPD already install the
 common sigterm handler.
 This patch series takes a stab at the optional services.
 PLM is pending. Will send a separate patch for that.

 changeset ad694a098f13a829e051a196194b0da1bbac261d
 Author:   Mathivanan N.P.mathi.naic...@oracle.com
 Date: Tue, 18 Feb 2014 20:28:26 -0500

   evt: use daemon_sigterm_install [#512] All core services and cpsv now
   register for a common sigterm handler. This patch series takes a stab 
 at the
   optional services

 changeset 5d1b126dbf643b5c890d669a89069f296ea10046
 Author:   Mathivanan N.P.mathi.naic...@oracle.com
 Date: Tue, 18 Feb 2014 20:30:16 -0500

   lck: gld to use daemon_sigterm_install [#512] All core services and 
 cpsv now
   register for a common sigterm handler. This patch series takes a stab 
 at the
   optional services

 changeset 9ff8677841414b28134e54be71f2bd795aeacf7a
 Author:   Mathivanan N.P.mathi.naic...@oracle.com
 Date: Tue, 18 Feb 2014 20:31:03 -0500

   lck: glnd to use daemon_sigterm_install [#512] All core services and 
 cpsv
   now register for a common sigterm handler. This patch series takes a 
 stab at
   the optional services

 changeset f3715344e800a6449fddc22426284542dad87ccc
 Author:   Mathivanan N.P.mathi.naic...@oracle.com
 Date: Tue, 18 Feb 2014 20:31:26 -0500

   msg: mqd to use daemon_sigterm_install [#512] All core services and 
 cpsv now
   register for a common sigterm handler. This patch series takes a stab 
 at the
   optional services

 changeset 7d94fd93c2c201fd5a10379af1d8fdefe28a0d8a
 Author:   Mathivanan N.P.mathi.naic...@oracle.com
 Date: Tue, 18 Feb 2014 20:32:10 -0500

   msg: mqnd to use daemon_sigterm_install [#512] All core services and 
 cpsv
   now register for a common sigterm handler. This patch series takes a 
 stab at
   the optional services


 Complete diffstat:
 --
   osaf/libs/common/edsv/include/eds.h |   2 ++
   osaf/libs/common/glsv/include/gld.h |   2 ++
   osaf/libs/common/glsv/include/glnd.h|   2 ++
   osaf/libs/common/mqsv/include/mqd.h |   2 ++
   osaf/libs/common/mqsv/include/mqnd.h|   2 ++
   osaf/services/saf/edsv/eds/eds_cb.c |  33 
 -
   osaf/services/saf/edsv/eds/eds_main.c   |   1 -
   osaf/services/saf/glsv/gld/gld_api.c|  30 ++
   osaf/services/saf/glsv/gld/gld_main.c   |   1 -
   osaf/services/saf/glsv/glnd/glnd_api.c  |  15 +--
   osaf/services/saf/mqsv/mqd/mqd_api.c|  26 --
   osaf/services/saf/mqsv/mqd/mqd_main.c   |   1 -
   osaf/services/saf/mqsv/mqnd/mqnd_init.c |  31 
 +++
   osaf/services/saf/mqsv/mqnd/mqnd_main.c |   1 -
   14 files changed, 112 insertions(+), 37 deletions(-)


 Testing Commands:
 -
 Upon /etc/init.d/opensafd stop,
 these optional services should print exiting for shutdown message
 in the syslog and without any core.

 performed repeatged swithcover, failover.

 Testing, Expected Results:
 --

 Upon /etc/init.d/opensafd stop,
 these optional services should print exiting for shutdown message
 in the syslog.

 Conditions of Submission:
 -
 Ack from Anders.

 Arch  Built StartedLinux distro
 ---
 mipsn  n
 mips64  n  n
 x86 n  n
 x86_64  y  y
 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

[devel] [PATCH 1 of 1] osaf: Add definition of the new type SaConstStringT [#625]

2014-03-07 Thread Anders Widell
 osaf/libs/saf/include/Makefile.am|   1 +
 osaf/libs/saf/include/saAis.h|   2 +
 osaf/libs/saf/include/saAis_B_5_14.h |  39 
 3 files changed, 42 insertions(+), 0 deletions(-)


Add a definition of SaConstStringT as an OpenSAF extension to the AIS types.
The following example code illustrates a use case where SaConstStringT is
needed:

void foo(SaConstStringT s) {
printf(%s, s);
}

void bar(const char* s) {
foo(s);
}

By using SaConstStringT instead of SaStringT (or const SaStringT), we avoid
having to cast way the const qualifier of the string when calling foo() from
bar().

diff --git a/osaf/libs/saf/include/Makefile.am 
b/osaf/libs/saf/include/Makefile.am
--- a/osaf/libs/saf/include/Makefile.am
+++ b/osaf/libs/saf/include/Makefile.am
@@ -20,6 +20,7 @@ MAINTAINERCLEANFILES = Makefile.in
 
 include_HEADERS = \
saAis.h \
+   saAis_B_5_14.h \
saAmf.h \
saCkpt.h \
saCkpt_B_02_03.h \
diff --git a/osaf/libs/saf/include/saAis.h b/osaf/libs/saf/include/saAis.h
--- a/osaf/libs/saf/include/saAis.h
+++ b/osaf/libs/saf/include/saAis.h
@@ -179,5 +179,7 @@ typedef union {
 }
 #endif
 
+#include saAis_B_5_14.h
+
 #endif  /* _SA_AIS_H */
 
diff --git a/osaf/libs/saf/include/saAis_B_5_14.h 
b/osaf/libs/saf/include/saAis_B_5_14.h
new file mode 100644
--- /dev/null
+++ b/osaf/libs/saf/include/saAis_B_5_14.h
@@ -0,0 +1,39 @@
+/*  -*- OpenSAF  -*-
+ *
+ * (C) Copyright 2014 The OpenSAF Foundation
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. This file and program are licensed
+ * under the GNU Lesser General Public License Version 2.1, February 1999.
+ * The complete license can be accessed from the following location:
+ * http://opensource.org/licenses/lgpl-license.php
+ * See the Copying file included with the OpenSAF distribution for full
+ * licensing terms.
+ *
+ * Author(s): Ericsson AB
+ */
+
+/*
+ * DESCRIPTION:
+ *   This file provides the suggested additions to the C language binding for
+ *   the Service Availability(TM) Forum.  It contains only the prototypes and
+ *   type definitions that are part of this proposed addition.  These additions
+ *   are currently NON STANDARD. But the intention is to get these additions
+ *   approved formally by SAF in the future.
+ */
+
+#ifndef _SA_AIS_B_5_14_H
+#define _SA_AIS_B_5_14_H
+
+#ifdef  __cplusplus
+extern C {
+#endif
+
+typedef const char* SaConstStringT;
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif   /* _SA_AIS_B_5_14_H */

--
Subversion Kills Productivity. Get off Subversion  Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works. 
Faster operations. Version large binaries.  Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951iu=/4140/ostg.clktrk
___
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 osaf: Add definition of the new type SaConstStringT [#625]

2014-03-07 Thread Anders Widell
Summary: osaf: Add definition of the new type SaConstStringT [#625]
Review request for Trac Ticket(s): 625
Peer Reviewer(s): Mathi
Pull request to: 
Affected branch(es): default(4.5)
Development branch: default


Impacted area   Impact y/n

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


Comments (indicate scope for each y above):
-
changeset f2d124340ecbcb4cab0a16a66879b97fed9614ef
Author: Anders Widell anders.wid...@ericsson.com
Date:   Fri, 07 Mar 2014 14:45:22 +0100

osaf: Add definition of the new type SaConstStringT [#625]

Add a definition of SaConstStringT as an OpenSAF extension to the AIS 
types.
The following example code illustrates a use case where SaConstStringT 
is
needed:

void foo(SaConstStringT s) { printf(%s, s); }

void bar(const char* s) { foo(s); }

By using SaConstStringT instead of SaStringT (or const SaStringT), we 
avoid
having to cast way the const qualifier of the string when calling foo() 
from
bar().


Complete diffstat:
--
 osaf/libs/saf/include/Makefile.am|   1 +
 osaf/libs/saf/include/saAis.h|   2 ++
 osaf/libs/saf/include/saAis_B_5_14.h |  39 
+++
 3 files changed, 42 insertions(+), 0 deletions(-)


Testing Commands:
-
Build and install OpenSAF. Compile the example code above using the header
files installed by OpenSAF.


Testing, Expected Results:
--
The example code should compile without warnings or errors.


Conditions of Submission:
-
Ack from Mathi


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  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.


--
Subversion Kills Productivity. Get off Subversion  Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works. 
Faster operations. Version large binaries.  Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http

[devel] Commit message template and editor settings

2014-03-21 Thread Anders Widell
Hi all!

I would like to announce two changes that have been done recently:

1) Updated commit message template


The commit message template, which is found in the file 
tools/devel/review/commit.template in the Mercurial repository, has been 
updated. A commit message shall consists of a short one-line message, 
followed by a blank line, and then a detailed, multi-line message. The 
template has been updated with detailed instructions for how to write 
the multi-line part of commit messages for defect tickets. The idea is 
to split it into three parts, where the first part contains verbatim log 
messages (or e.g. a stack trace). This can be useful later on if the 
fault happens again, because it will then be possible to search the 
commit messages and find the changeset where the fault has been 
corrected. The second part of the message should be an analysis of the 
fault, and the third part should be a description of how it was fixed.

We have also added a script that can be used to let Mercurial load the 
template as the default text when editing a new commit message. The file 
tools/devel/review/00-README contains instructions for how to configure 
the default commit message in Mercurial. It also contains an example of 
a commit message that has been written according to the new template.

2) Updated editor configuration instructions in the wiki
-

We have updated the instructions for how to set up Eclipse and Emacs so 
that you get the correct code formatting style. The Eclipse instruction 
is new, and the Emacs instruction has been updated with an improved 
version of the coding style file google-c-style.el

The OpenSAF wiki is found here: https://sourceforge.net/p/opensaf/wiki/Home/

regards,
Anders Widell


--
Learn Graph Databases - Download FREE O'Reilly Book
Graph Databases is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1 of 1] osaf: Add definition of the new type SaConstStringT [#625]

2014-04-01 Thread Anders Widell
I think it would be possible to rename (and consolidate) the header 
files for the IMM extensions, since the file names are not exposed to 
the end users. The names are thus not so important - it is more of an 
implementation detail. In a way, it could actually be good if the names 
are a bit ugly to avoid the risk that an application programmer by 
mistake includes them directly. Another thing to consider is the risk of 
name collision with existing or future header files.

Now that I think of it, we could actually do one thing to prevent users 
from including the extension files directly - by adding a preprocessor 
section at the top of them, e.g. like this:

#ifndef _SA_AIS_H
#error Don't include this file directly - include saAis.h instead
#endif

regards,
Anders Widell

2014-04-01 15:41, Mathivanan Naickan Palanivelu skrev:
 One could say the header file convention for the IMM extensions is already 
 existential.
 The handle to the saAisExt.h or saAisOsafExt.h is saAis.h(when included), so
 it is not truly anonymous. At the same time, a convention like B_5_11 does 
 needs some
 documentation of the convention, because i see multiple things here to 
 digest. i.e.
 Till the tatest stable release (specifications release) from SAF which was 
 release 6.0 or 6.1,
 the header files had no extensions and new protoptypes/APIs had a 
 version(typically spec version) suffix.

 So, if we consider the numbering scheme, should we imagine that the num1 in 
 saAis_B_num1_num2.h
 should probably indicate a futuristic release of SAF?
 AND/OR should we intend to drop the 1 (in num2) from **_12, **_13, 
 **_14 and say that it was
 really not required originally, but we just ended up somehow there.

 I agree that saAisOsafExt.h(that keeps growing as and when we update) is 
 better suited to differentiate
 between SAF headers and the extended SAF headers.

 - Mathi.

 - anders.bjornerst...@ericsson.com wrote:

 One more point is that saAisExt.h (or whatever we end up calling it)
 should be included from saAis.h
 (in OpensaF 4.5). We dont want all users having to figure out which
 new include files to explicitly
 include to get access to extensions. It just becomes too confusing
 and/or requires too much documentation.

 If you look at the file naming convention for the IMM API extensions,
 there is very little risk of
 missundertanding that these are not any regular SAF include files.

 A name like saAisExt.h feels quite anonymous and arbitrary.
 If we are to follow that pattern I would at least prefer something
 like saAisOsafExt.h

 /AndersBj

 -Original Message-
 From: Anders Björnerstedt [mailto:anders.bjornerst...@ericsson.com]
 Sent: den 1 april 2014 12:40
 To: Mathivanan Naickan Palanivelu; Anders Widell
 Cc: opensaf-devel@lists.sourceforge.net
 Subject: Re: [devel] [PATCH 1 of 1] osaf: Add definition of the new
 type SaConstStringT [#625]

 Well the only issue here is the already existing pattern used for the
 imm API extensions.
 The significance of the B_5 suffix would be to point at the exact
 version of that part of the SAF standard that is being extended.
 Compare for example with saImmOm_A_2_11.h, saImmOm_A_2_12.h,
 saImmOm_A_2_13.h And similairly for the saImmOi.h extensions.

 In this particular case, it is an addition of a completely new SAF
 type, so I suppose the exact version of the existing SAF primitive
 types does not matter.
 But suppose that in a later OpenSAF release we want to extend the Ais
 types even more.
 Should we then just add the new types to an updated version of
 saAisExt.h ?

 At the very least there should be a comment associated with the new
 type that clearly states in which OpenSAF release this type was
 added.

 /AndersBj


 -Original Message-
 From: Mathivanan Naickan Palanivelu [mailto:mathi.naic...@oracle.com]
 Sent: den 1 april 2014 11:59
 To: Anders Widell
 Cc: opensaf-devel@lists.sourceforge.net
 Subject: Re: [devel] [PATCH 1 of 1] osaf: Add definition of the new
 type SaConstStringT [#625]

 Ack with the following comments:

 1) we could name this file as saAisExt.h.
 Please note, there is no significance for the suffix B_5*** nor is
 it a standard SAF convention.

 2) The description for this file
 + *   This file provides the suggested additions to the C language
 binding for
 + *   the Service Availability(TM) Forum.  It contains only the
 prototypes and
 + *   type definitions that are part of this proposed addition.
 These additions
 + *   are currently NON STANDARD. But the intention is to get these
 additions
 + *   approved formally by SAF in the future.
 Could be changed to something like:

 This file defines extensions to the C header files provided by the
 Service Availability(TM) Forum AIS specifications.
 It contains extended prototypes and type definitions. The intention is
 to get these additions Included as a part of SAF standard
 specifications.

 Thanks,
 Mathi.



 -Original Message-
 From: Anders Widell [mailto:anders.wid

Re: [devel] [PATCH 1 of 1] osaf: Add definition of the new type SaConstStringT [#625]

2014-04-02 Thread Anders Widell
We had a discussion regarding this in TLC and the conclusion was that we 
go for the originally proposed file name saAis_B_5_14.h for now so that 
it is consistent with the names other existing header files, and then at 
a later point we can revisit this issue and rename/consolidate the file 
names for all services at once.

regards,
Anders Widell

2014-04-02 09:52, Anders Björnerstedt skrev:
 The direct inclusion prevention is a good idea and should be added to these 
 files.

 I think the current include file extension for the imm should be kept for now.
 This mainly to avoid rocking the boat in this area unnecessarily.
 Our users have a hard enough time as it is to grasp the distinction of what
 is available in any given imm release. Lets consolidate the include files
 whenever we do the next major release of OpenSaf.

 For SaConstStringT, one possibility is to place it in the file 
 saImmOm_A_2_14.h
 for now. The IMM service will be the first to use this type in some new APIs
 And practically all OpenSAF users use the imm-om API in some way (even Ois).

 I would like not to be stuck in this include file naming discussion for too 
 long.


 /AndersBj

 -Original Message-
 From: Anders Bjornerstedt [mailto:anders.bjornerst...@ericsson.com]
 Sent: den 1 april 2014 16:08
 To: Anders Widell
 Cc: opensaf-devel@lists.sourceforge.net
 Subject: Re: [devel] [PATCH 1 of 1] osaf: Add definition of the new type 
 SaConstStringT [#625]

 It would be possible but I am not sure it is desirable.
 I dont see any problem with the current names and I do see the current 
 labeling as clear, related 1:1 to the SaVersionT setting you need to set to 
 get access to that API version.

 For SaAis.h the difference is that it is not in itself any service.
 But I would still argue : (a) such a type  would logically belong on an 
 OpenSAF branch of the saAis.h file; and (b) it shoulod be guarded against the 
 (yes remote) possibility that the type one day is absorbed into an offical 
 SAF spec. Thus by placing it in an extension file that makes it clear 
 relative to which SAF sepc this file is an extension cannot be wrong. The 
 num2 question is here a bit of a silly problem since there exists no 
 corresponding single service handle.

 In practice the nw SaConstrStringT will be used by the IMM.A.2.14 version in 
 OpensAF4.5.
 Possibly the same SaConstStringT type will be used in API extenstions to 
 other OpenSAF services produced by OpenSAF in future releases.

 /AndersBj

 Anders Widell wrote:
 I think it would be possible to rename (and consolidate) the header
 files for the IMM extensions, since the file names are not exposed to
 the end users. The names are thus not so important - it is more of an
 implementation detail. In a way, it could actually be good if the
 names are a bit ugly to avoid the risk that an application programmer
 by mistake includes them directly. Another thing to consider is the
 risk of name collision with existing or future header files.

 Now that I think of it, we could actually do one thing to prevent
 users from including the extension files directly - by adding a
 preprocessor section at the top of them, e.g. like this:

 #ifndef _SA_AIS_H
 #error Don't include this file directly - include saAis.h instead
 #endif

 regards,
 Anders Widell

 2014-04-01 15:41, Mathivanan Naickan Palanivelu skrev:
 One could say the header file convention for the IMM extensions is
 already existential.
 The handle to the saAisExt.h or saAisOsafExt.h is saAis.h(when
 included), so it is not truly anonymous. At the same time, a
 convention like B_5_11 does needs some documentation of the
 convention, because i see multiple things here to digest. i.e.
 Till the tatest stable release (specifications release) from SAF
 which was release 6.0 or 6.1, the header files had no extensions and
 new protoptypes/APIs had a version(typically spec version) suffix.

 So, if we consider the numbering scheme, should we imagine that the
 num1 in saAis_B_num1_num2.h
 should probably indicate a futuristic release of SAF?
 AND/OR should we intend to drop the 1 (in num2) from **_12,
 **_13, **_14 and say that it was really not required originally,
 but we just ended up somehow there.

 I agree that saAisOsafExt.h(that keeps growing as and when we update)
 is better suited to differentiate between SAF headers and the
 extended SAF headers.

 - Mathi.

 - anders.bjornerst...@ericsson.com wrote:

 One more point is that saAisExt.h (or whatever we end up calling it)
 should be included from saAis.h (in OpensaF 4.5). We dont want all
 users having to figure out which new include files to explicitly
 include to get access to extensions. It just becomes too confusing
 and/or requires too much documentation.

 If you look at the file naming convention for the IMM API
 extensions, there is very little risk of missundertanding that these
 are not any regular SAF include files.

 A name like saAisExt.h feels quite anonymous and arbitrary

Re: [devel] [PATCH 1 of 1] amfd: use template class db to replace patricia tree db V2 [#713]

2014-04-04 Thread Anders Widell
Just some thoughts regarding NULL pointers:

When I write a function, I by default assume that pointers passed to it 
as arguments are not NULL. Only if the API documentation explicitly 
states that a NULL pointer is a valid input for that argument, then the 
function needs to handle it. Otherwise it is fine to crash (or assert) 
when receiving a NULL pointer. An assert is typically not needed, since 
the program will crash when dereferencing a NULL pointer anyway.

Sometimes it is useful to allow function arguments to be NULL pointers. 
One typical example is the C library functions free() and realloc(), 
where it can be very handy to be able to pass a NULL pointer in case no 
memory has been allocated (yet). The API documentation here clearly says 
what happens when you pass a NULL pointer.

regards,
Anders Widell

2014-04-04 15:04, Nagendra Kumar skrev:
 Ack with comment the functions added are not NULL safe. It crashed if passed 
 NULL. Do we want to have some checks ?

 Thanks
 -Nagu

 -Original Message-
 From: Hans Nordeback [mailto:hans.nordeb...@ericsson.com]
 Sent: 26 March 2014 16:58
 To: hans.fe...@ericsson.com; Nagendra Kumar; Praveen Malviya
 Cc: opensaf-devel@lists.sourceforge.net
 Subject: [PATCH 1 of 1] amfd: use template class db to replace patricia tree 
 db
 V2 [#713]

   osaf/services/saf/amf/amfd/include/db_template.h |  63
 
   1 files changed, 63 insertions(+), 0 deletions(-)


 diff --git a/osaf/services/saf/amf/amfd/include/db_template.h
 b/osaf/services/saf/amf/amfd/include/db_template.h
 new file mode 100644
 --- /dev/null
 +++ b/osaf/services/saf/amf/amfd/include/db_template.h
 @@ -0,0 +1,63 @@
 +/*  -*- OpenSAF  -*-
 + *
 + * (C) Copyright 2014 The OpenSAF Foundation
 + *
 + * This program is distributed in the hope that it will be useful, but
 + * WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY
 + * or FITNESS FOR A PARTICULAR PURPOSE. This file and program are licensed
 + * under the GNU Lesser General Public License Version 2.1, February 1999.
 + * The complete license can be accessed from the following location:
 + * http://opensource.org/licenses/lgpl-license.php
 + * See the Copying file included with the OpenSAF distribution for full
 + * licensing terms.
 + *
 + * Author(s): Ericsson AB
 + *
 + */
 +#ifndef DB_TEMPLATE_H
 +#define DB_TEMPLATE_H
 +
 +#include map
 +#include string
 +
 +template typename T
 +class AmfDb {
 +  public:
 +   void insert(T *obj);
 +   void erase(T *obj);
 +   T *find(const SaNameT *name);
 +
 +   typedef std::mapstd::string, T* AmfDbMap;
 +   typedef typename AmfDbMap::const_iterator const_iterator;
 +
 +   const_iterator begin() const {return db.begin();}
 +   const_iterator end() const {return db.end();}
 +
 +  private:
 +   AmfDbMap db;
 +};
 +
 +template typename T
 +void AmfDbT::insert(T *obj) {
 +  std::string name((const char*)obj-name.value, obj-name.length);
 +  db[name] = obj;
 +}
 +
 +template typename T
 +void AmfDbT::erase(T *obj) {
 +  std::string name((const char*)obj-name.value, obj-name.length);
 +  typename AmfDbMap::iterator it = db.find(name);
 +  db.erase(it);
 +}
 +
 +template typename T
 +T *AmfDbT::find(const SaNameT *dn) {
 +  std::string name((const char*)dn-value, dn-length);
 +  typename AmfDbMap::iterator it = db.find(name);
 +  if (it == db.end())
 +return NULL;
 +  else
 +return it-second;
 +}
 +
 +#endif  /* DB_TEMPLATE_H */
 --
 ___
 Opensaf-devel mailing list
 Opensaf-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/opensaf-devel




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


Re: [devel] [PATCH 1 of 1] amfd: use template class db to replace patricia tree db V2 [#713]

2014-04-04 Thread Anders Widell
Asserts are fine even if the input is supposed to already be validated. 
But as I said, asserting that a pointer is not NULL is not so useful 
since you crash anyway when dereferencing it. Possibly it can be useful 
as a way do document the code, to say that you know this pointer is not 
NULL. Both humans and e.g. static analysis tools can make use of such 
information.

regards,
Anders Widell

2014-04-04 16:33, Hans Nordebäck skrev:
 external API normally needs to validate its input and further calling 
 internal function these validations are not needed. Asserts can be used to
 detect bugs and  are normally compiled away in release builds.
 I can add osafassert in these functions, but shouldn't the input already have 
 been validated in calling functions? /BR  HansN

 -Original Message-
 From: Anders Widell
 Sent: den 4 april 2014 16:27
 To: Nagendra Kumar; Hans Nordebäck; Hans Feldt; Praveen Malviya
 Cc: opensaf-devel@lists.sourceforge.net
 Subject: Re: [devel] [PATCH 1 of 1] amfd: use template class db to replace 
 patricia tree db V2 [#713]

 Just some thoughts regarding NULL pointers:

 When I write a function, I by default assume that pointers passed to it as 
 arguments are not NULL. Only if the API documentation explicitly states that 
 a NULL pointer is a valid input for that argument, then the function needs to 
 handle it. Otherwise it is fine to crash (or assert) when receiving a NULL 
 pointer. An assert is typically not needed, since the program will crash when 
 dereferencing a NULL pointer anyway.

 Sometimes it is useful to allow function arguments to be NULL pointers.
 One typical example is the C library functions free() and realloc(), where it 
 can be very handy to be able to pass a NULL pointer in case no memory has 
 been allocated (yet). The API documentation here clearly says what happens 
 when you pass a NULL pointer.

 regards,
 Anders Widell

 2014-04-04 15:04, Nagendra Kumar skrev:
 Ack with comment the functions added are not NULL safe. It crashed if passed 
 NULL. Do we want to have some checks ?

 Thanks
 -Nagu

 -Original Message-
 From: Hans Nordeback [mailto:hans.nordeb...@ericsson.com]
 Sent: 26 March 2014 16:58
 To: hans.fe...@ericsson.com; Nagendra Kumar; Praveen Malviya
 Cc: opensaf-devel@lists.sourceforge.net
 Subject: [PATCH 1 of 1] amfd: use template class db to replace
 patricia tree db
 V2 [#713]

osaf/services/saf/amf/amfd/include/db_template.h |  63
 
1 files changed, 63 insertions(+), 0 deletions(-)


 diff --git a/osaf/services/saf/amf/amfd/include/db_template.h
 b/osaf/services/saf/amf/amfd/include/db_template.h
 new file mode 100644
 --- /dev/null
 +++ b/osaf/services/saf/amf/amfd/include/db_template.h
 @@ -0,0 +1,63 @@
 +/*  -*- OpenSAF  -*-
 + *
 + * (C) Copyright 2014 The OpenSAF Foundation
 + *
 + * This program is distributed in the hope that it will be useful,
 +but
 + * WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY
 + * or FITNESS FOR A PARTICULAR PURPOSE. This file and program are
 +licensed
 + * under the GNU Lesser General Public License Version 2.1, February 1999.
 + * The complete license can be accessed from the following location:
 + * http://opensource.org/licenses/lgpl-license.php
 + * See the Copying file included with the OpenSAF distribution for
 +full
 + * licensing terms.
 + *
 + * Author(s): Ericsson AB
 + *
 + */
 +#ifndef DB_TEMPLATE_H
 +#defineDB_TEMPLATE_H
 +
 +#include map
 +#include string
 +
 +template typename T
 +class AmfDb {
 +  public:
 +   void insert(T *obj);
 +   void erase(T *obj);
 +   T *find(const SaNameT *name);
 +
 +   typedef std::mapstd::string, T* AmfDbMap;
 +   typedef typename AmfDbMap::const_iterator const_iterator;
 +
 +   const_iterator begin() const {return db.begin();}
 +   const_iterator end() const {return db.end();}
 +
 +  private:
 +   AmfDbMap db;
 +};
 +
 +template typename T
 +void AmfDbT::insert(T *obj) {
 +  std::string name((const char*)obj-name.value, obj-name.length);
 +  db[name] = obj;
 +}
 +
 +template typename T
 +void AmfDbT::erase(T *obj) {
 +  std::string name((const char*)obj-name.value, obj-name.length);
 +  typename AmfDbMap::iterator it = db.find(name);
 +  db.erase(it);
 +}
 +
 +template typename T
 +T *AmfDbT::find(const SaNameT *dn) {
 +  std::string name((const char*)dn-value, dn-length);
 +  typename AmfDbMap::iterator it = db.find(name);
 +  if (it == db.end())
 +return NULL;
 +  else
 +return it-second;
 +}
 +
 +#endif /* DB_TEMPLATE_H */
 --
  ___
 Opensaf-devel mailing list
 Opensaf-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/opensaf-devel





--
___
Opensaf-devel mailing list
Opensaf-devel

Re: [devel] [PATCH 1 of 1] base: use dup2 instead of freopen (non async-signal-safe) V1 [#532]

2014-04-23 Thread Anders Widell
In that case the child will have the same stdin/stdout/stderr as the 
parent process. But if we know for sure that the parent already has 
redirected its stdin/stdout/stderr to /dev/null then I think it ought to 
be fine.

/ Anders Widell

2014-04-23 09:45, Hans Feldt skrev:
 What happens in/with the child process if this code is instead removed 
 completely?
 /HansF

 -Original Message-
 From: Hans Nordebäck
 Sent: den 23 april 2014 09:11
 To: Hans Feldt; Anders Widell; ramesh.bet...@oracle.com
 Cc: opensaf-devel@lists.sourceforge.net
 Subject: [PATCH 1 of 1] base: use dup2 instead of freopen (non 
 async-signal-safe) V1 [#532]

   osaf/libs/core/leap/os_defs.c |  21 +++--
   1 files changed, 15 insertions(+), 6 deletions(-)


 New issues where freopen freezes, use dup2 instead.
 Non async-signal-safe are used in ncs_os_process_execute_timed,
 sched_setscheduler, syslog, setenv, getenv and freopen. Syslog may
 freeze but are called only when an error has been detected. The
 remaining should be removed.

 diff --git a/osaf/libs/core/leap/os_defs.c b/osaf/libs/core/leap/os_defs.c
 --- a/osaf/libs/core/leap/os_defs.c
 +++ b/osaf/libs/core/leap/os_defs.c
 @@ -971,6 +971,7 @@ uint32_t ncs_os_process_execute_timed(NC

  /* By default we close all inherited file descriptors in the 
 child */
  if (getenv(OPENSAF_KEEP_FD_OPEN_AFTER_FORK) == NULL) {
 +int fd1;
  /* Close all inherited file descriptors */
  int i = sysconf(_SC_OPEN_MAX);
  if (i == -1) {
 @@ -981,12 +982,20 @@ uint32_t ncs_os_process_execute_timed(NC
  (void) close(i); /* close all descriptors */

  /* Redirect standard files to /dev/null */
 -if (freopen(/dev/null, r, stdin) == NULL)
 -syslog(LOG_ERR, %s: freopen stdin failed - 
 %s, __FUNCTION__, strerror(errno));
 -if (freopen(/dev/null, w, stdout) == NULL)
 -syslog(LOG_ERR, %s: freopen stdout failed - 
 %s, __FUNCTION__, strerror(errno));
 -if (freopen(/dev/null, w, stderr) == NULL)
 -syslog(LOG_ERR, %s: freopen stderr failed - 
 %s, __FUNCTION__, strerror(errno));
 +if ((fd1 = open(/dev/null, O_RDWR))  0) {
 +syslog(LOG_ERR, %s: open /dev/null failed - 
 %s, __FUNCTION__, strerror(errno));
 +}
 +else {
 +if (dup2(fd1, STDIN_FILENO)  0) {
 +syslog(LOG_ERR, %s: dup2 stdin failed 
 - %s, __FUNCTION__, strerror(errno));
 +}
 +if (dup2(fd1, STDOUT_FILENO)  0) {
 +syslog(LOG_ERR, %s: dup2 stdout failed 
 - %s, __FUNCTION__, strerror(errno));
 +}
 +if (dup2(fd1, STDERR_FILENO)  0) {
 +syslog(LOG_ERR, %s: dup2 stderr failed 
 - %s, __FUNCTION__, strerror(errno));
 +}
 +}
  }

  /* RUNASROOT gives the OpenSAF user a possibility to maintain 
 the  4.2 behaviour.



--
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1 of 1] base: use dup2 instead of freopen (non async-signal-safe) V1 [#532]

2014-04-23 Thread Anders Widell
We need to be careful that all file descriptors have the FD_CLOEXEC 
flag, then. It can easily happen that someone later on creates a file 
descriptor without this flag, without knowing that it is needed.

If we had a debug build, then we could have a loop surronded by #ifdef 
DEBUG, that checks that all file descriptors have the FD_CLOEXEC flag. 
Then we would easily be able to catch any such regression.

/ Anders Widell

2014-04-23 09:56, Hans Feldt skrev:
 Yes we know that for sure, it is amfnd or smfnd calling this routine.

  From what I remember one closeonexec is needed (some leap fd) then we can 
 remove the close loop and the reopen part. I think we should aim for that 
 instead of patching.

 /HansF

 -Original Message-
 From: Anders Widell
 Sent: den 23 april 2014 09:54
 To: Hans Feldt; Hans Nordebäck; ramesh.bet...@oracle.com
 Cc: opensaf-devel@lists.sourceforge.net
 Subject: Re: [PATCH 1 of 1] base: use dup2 instead of freopen (non 
 async-signal-safe) V1 [#532]

 In that case the child will have the same stdin/stdout/stderr as the
 parent process. But if we know for sure that the parent already has
 redirected its stdin/stdout/stderr to /dev/null then I think it ought to
 be fine.

 / Anders Widell

 2014-04-23 09:45, Hans Feldt skrev:
 What happens in/with the child process if this code is instead removed 
 completely?
 /HansF

 -Original Message-
 From: Hans Nordebäck
 Sent: den 23 april 2014 09:11
 To: Hans Feldt; Anders Widell; ramesh.bet...@oracle.com
 Cc: opensaf-devel@lists.sourceforge.net
 Subject: [PATCH 1 of 1] base: use dup2 instead of freopen (non 
 async-signal-safe) V1 [#532]

osaf/libs/core/leap/os_defs.c |  21 +++--
1 files changed, 15 insertions(+), 6 deletions(-)


 New issues where freopen freezes, use dup2 instead.
 Non async-signal-safe are used in ncs_os_process_execute_timed,
 sched_setscheduler, syslog, setenv, getenv and freopen. Syslog may
 freeze but are called only when an error has been detected. The
 remaining should be removed.

 diff --git a/osaf/libs/core/leap/os_defs.c b/osaf/libs/core/leap/os_defs.c
 --- a/osaf/libs/core/leap/os_defs.c
 +++ b/osaf/libs/core/leap/os_defs.c
 @@ -971,6 +971,7 @@ uint32_t ncs_os_process_execute_timed(NC

/* By default we close all inherited file descriptors 
 in the child */
if (getenv(OPENSAF_KEEP_FD_OPEN_AFTER_FORK) == NULL) {
 +  int fd1;
/* Close all inherited file descriptors */
int i = sysconf(_SC_OPEN_MAX);
if (i == -1) {
 @@ -981,12 +982,20 @@ uint32_t ncs_os_process_execute_timed(NC
(void) close(i); /* close all 
 descriptors */

/* Redirect standard files to /dev/null */
 -  if (freopen(/dev/null, r, stdin) == NULL)
 -  syslog(LOG_ERR, %s: freopen stdin failed - 
 %s, __FUNCTION__, strerror(errno));
 -  if (freopen(/dev/null, w, stdout) == NULL)
 -  syslog(LOG_ERR, %s: freopen stdout failed - 
 %s, __FUNCTION__, strerror(errno));
 -  if (freopen(/dev/null, w, stderr) == NULL)
 -  syslog(LOG_ERR, %s: freopen stderr failed - 
 %s, __FUNCTION__, strerror(errno));
 +  if ((fd1 = open(/dev/null, O_RDWR))  0) {
 +  syslog(LOG_ERR, %s: open /dev/null failed - 
 %s, __FUNCTION__, strerror(errno));
 +  }
 +  else {
 +  if (dup2(fd1, STDIN_FILENO)  0) {
 +  syslog(LOG_ERR, %s: dup2 stdin failed 
 - %s, __FUNCTION__, strerror(errno));
 +  }
 +  if (dup2(fd1, STDOUT_FILENO)  0) {
 +  syslog(LOG_ERR, %s: dup2 stdout failed 
 - %s, __FUNCTION__, strerror(errno));
 +  }
 +  if (dup2(fd1, STDERR_FILENO)  0) {
 +  syslog(LOG_ERR, %s: dup2 stderr failed 
 - %s, __FUNCTION__, strerror(errno));
 +  }
 +  }
}

/* RUNASROOT gives the OpenSAF user a possibility to 
 maintain the  4.2 behaviour.



--
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [users] Websites and information

2014-04-29 Thread Anders Widell
These things are decided by the Technical Leadership Council. About a 
year ago we decided to migrate from our own server to SourceForge. The 
old server is still up and running as an archive of old information, but 
it is no longer maintained. Eventually we wish to be able to shut it 
down, and you could help out with making this possible if you wish.

We were thinking of downloading everything from the old server and store 
it as static web pages. So what you could do is to download all the old 
pages (wiki, tickets, mailing list archives) and create a tarball with 
static html pages. We can then upload the static html pages to 
http://opensaf.sourceforge.net. They have support for virtual hosts at 
SourceForge, so it would be possible to redirect the DNS to the new server.

Unfortunately, we have no control of www.opensaf.org ourselves. They 
were supposed to have fixed the links by now, and I can see that they 
have indeed inserted a link to the new project page at SourceForge, but 
the old links also remain.

/ Anders Widell

2014-04-29 14:55, Guilherme Moro skrev:
 Hi,

 The project was completely migrated to Sourceforge, is this a valid 
 assumption?

 if you go to http://www.opensaf.org/page/14944~220835/Projects
 They are still referencing  http://devel.opensaf.org/hg/opensaf as the
 main check-in point

 http://devel.opensaf.org/ have some other information that seems
 outdated as well

 So, for now we seem to have duplicated info scattered around the old
 trac system and the new home of the project (sourceforge). And most of
 the google search you do will point to outdated information.

 I know the tickets were migrated already, but we should start
 deactivate the old systems gradually, and put everything in just one
 place.

 I'm willing to help with that, so who can guide me through whatever
 got decided regarding this migration, and more importantly, who
 decides this stuff anyway? ;)

 Regards,

 Guilherme Moro

 --
 Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
 Instantly run your Selenium tests across 300+ browser/OS combos.  Get
 unparalleled scalability from the best Selenium testing platform available.
 Simple to use. Nothing to install. Get started now for free.
 http://p.sf.net/sfu/SauceLabs
 ___
 Opensaf-users mailing list
 opensaf-us...@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/opensaf-users




--
Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.  Get 
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free.
http://p.sf.net/sfu/SauceLabs
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 1 of 3] osaf: Add saAisNameLend() and saAisNameBorrow() [#191]

2014-05-02 Thread Anders Widell
 00-README.conf   |  18 ++
 osaf/libs/saf/include/saAis.h|   4 
 osaf/libs/saf/include/saAis_B_5_14.h |  17 +
 3 files changed, 39 insertions(+), 0 deletions(-)


Add declarations of saAisNameLend() and saAisNameBorrow() to saAis.h.
Update 00-README.conf with description of how to enable the extended
SaNameT type.

diff --git a/00-README.conf b/00-README.conf
--- a/00-README.conf
+++ b/00-README.conf
@@ -447,3 +447,21 @@ Note: The OpenSAF default implemetation 
   Earlier default implementation of the command (which was never called 
from SMF) requires a bundle 
   name as input parameter. 
   From OpenSAF 4.4 the input parameter shall be the DN of the bundle to 
check.
+
+Extended SaNameT type
+=
+The SaNameT type is deprecated will be replaced with string parameters in new
+SAF APIs. As an intermediate solution, the extended format of the SaNameT type
+can be used to pass string parameters to and from old SAF APIs as well, by
+tunneling them through the SaNameT type. To enable the extended SaNameT
+format, the application source code has to be compiled with the
+SA_EXTENDED_NAME_SOURCE preprocessor macro defined, and the environment
+variable SA_ENABLE_EXTENDED_NAMES must be set to the value 1 before the first
+call to any SAF API function.
+
+When the extended SaNameT format is enabled, the SA_MAX_NAME_LENGTH constant
+must not be used, and the application must treat the SaNameT type as opaque
+and not access any of its members directly. Instead, the saAisNameLend() and
+saAisNameBorrow() access functions shall be used. The
+SA_MAX_UNEXTENDED_NAME_LENGTH constant can be used to refer to the maximum
+string length that can be stored in the unextended SaNameT type.
diff --git a/osaf/libs/saf/include/saAis.h b/osaf/libs/saf/include/saAis.h
--- a/osaf/libs/saf/include/saAis.h
+++ b/osaf/libs/saf/include/saAis.h
@@ -70,7 +70,9 @@ typedef SaUint64T SaSelectio
 #define SA_TIME_ONE_DAY 864000LL
 #define SA_TIME_MAX SA_TIME_END
 
+#ifndef SA_EXTENDED_NAME_SOURCE
 #define SA_MAX_NAME_LENGTH 256
+#endif /* SA_EXTENDED_NAME_SOURCE */
 
 #define SA_TRACK_CURRENT   0x01
 #define SA_TRACK_CHANGES   0x02
@@ -156,10 +158,12 @@ typedef struct {
SaUint8T  *bufferAddr;
 } SaAnyT;
 
+#ifndef SA_EXTENDED_NAME_SOURCE
 typedef struct {
 SaUint16T length;
 SaUint8T value[SA_MAX_NAME_LENGTH];
 } SaNameT;
+#endif /* SA_EXTENDED_NAME_SOURCE */
 
 typedef struct {
 SaUint8T releaseCode;
diff --git a/osaf/libs/saf/include/saAis_B_5_14.h 
b/osaf/libs/saf/include/saAis_B_5_14.h
--- a/osaf/libs/saf/include/saAis_B_5_14.h
+++ b/osaf/libs/saf/include/saAis_B_5_14.h
@@ -31,6 +31,23 @@ extern C {
 
 typedef const char* SaConstStringT;
 
+#ifdef SA_EXTENDED_NAME_SOURCE
+#define SA_MAX_UNEXTENDED_NAME_LENGTH 256
+
+typedef struct {
+SaUint16T _opaque[129];
+} SaNameT;
+
+extern void
+saAisNameLend(
+SaConstStringT value,
+SaNameT* name);
+
+extern SaConstStringT
+saAisNameBorrow(
+const SaNameT* name);
+#endif /* SA_EXTENDED_NAME_SOURCE */
+
 #ifdef  __cplusplus
 }
 #endif

--
Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.  Get 
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free.
http://p.sf.net/sfu/SauceLabs
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 3 of 3] imm: Add implementations of saAisNameLend and saAisNameBorrow [#191]

2014-05-02 Thread Anders Widell
 osaf/libs/agents/saf/imma/Makefile.am |1 +
 osaf/libs/agents/saf/imma/aisa_api.c  |  131 ++
 osaf/libs/saf/libSaImm/libSaImmOm.map |2 +
 3 files changed, 134 insertions(+), 0 deletions(-)


The functions saAisNameLend() and saAisNameBorrow() are defined in
saAis_B_5_14.h, but their implementation is placed in libSaImmOm since there is
no libSaAis library.

diff --git a/osaf/libs/agents/saf/imma/Makefile.am 
b/osaf/libs/agents/saf/imma/Makefile.am
--- a/osaf/libs/agents/saf/imma/Makefile.am
+++ b/osaf/libs/agents/saf/imma/Makefile.am
@@ -35,6 +35,7 @@ libimmaOm_la_CPPFLAGS = \
 libimmaOm_la_LDFLAGS = -static
 
 libimmaOm_la_SOURCES = \
+   aisa_api.c \
imma_om_api.c \
imma_db.c \
imma_init.c \
diff --git a/osaf/libs/agents/saf/imma/aisa_api.c 
b/osaf/libs/agents/saf/imma/aisa_api.c
new file mode 100644
--- /dev/null
+++ b/osaf/libs/agents/saf/imma/aisa_api.c
@@ -0,0 +1,131 @@
+/* -*- OpenSAF  -*-
+ *
+ * (C) Copyright 2014 The OpenSAF Foundation
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. This file and program are licensed
+ * under the GNU Lesser General Public License Version 2.1, February 1999.
+ * The complete license can be accessed from the following location:
+ * http://opensource.org/licenses/lgpl-license.php
+ * See the Copying file included with the OpenSAF distribution for full
+ * licensing terms.
+ *
+ * Author(s): Ericsson AB
+ *
+ */
+
+/*
+  DESCRIPTION:
+
+  The SaNameT type is deprecated will be replaced with string parameters in new
+  SAF APIs. As an intermediate solution, the extended format of the SaNameT 
type
+  can be used to pass string parameters to and from old SAF APIs as well, by
+  tunneling them through the SaNameT type. To enable the extended SaNameT
+  format, the application source code has to be compiled with the
+  SA_EXTENDED_NAME_SOURCE preprocessor macro defined, and the environment
+  variable SA_ENABLE_EXTENDED_NAMES must be set to the value 1 before the first
+  call to any SAF API function.
+
+  When the extended SaNameT format is enabled, the SA_MAX_NAME_LENGTH constant
+  must not be used, and the application must treat the SaNameT type as opaque
+  and not access any of its members directly. Instead, the saAisNameLend() and
+  saAisNameBorrow() access functions shall be used. The
+  SA_MAX_UNEXTENDED_NAME_LENGTH constant can be used to refer to the maximum
+  string length that can be stored in the unextended SaNameT type.
+
+*/
+
+#ifndef SA_EXTENDED_NAME_SOURCE
+#define SA_EXTENDED_NAME_SOURCE
+#endif
+#define _GNU_SOURCE
+#include saAis.h
+#include stddef.h
+#include stdbool.h
+#include osaf_extended_name.h
+#include logtrace.h
+
+/
+  Name :  saAisNameLend
+
+  Description  :  Tunnel a NUL-terminated string through a SaNameT type. If
+  length of the string is strictly less than
+  SA_MAX_UNEXTENDED_NAME_LENGTH bytes, the contents of the
+  string is copied into the SaNameT type and can be read in a
+  backwards compatible way by legacy applications that do not
+  support the extended SaNameT format. If length of the string
+  is greater than or equal to SA_MAX_UNEXTENDED_NAME_LENGTH, no
+  copying is performed. Instead, a reference to the original
+  string is stored in the SaNameT type. In this case, it is
+  therefore important that the original string is not modified
+  or freed for as long as the SaNameT type may still used.
+
+  Arguments:  value [in] - A pointer to a NUL-terminated string that will
+   be tunneled through the SaNameT type.
+
+  name [out] - A pointer to an SaNameT type to be used for
+   tunneling.
+
+  Return Values :
+
+  Notes:
+**/
+void saAisNameLend(SaConstStringT value, SaNameT* name)
+{
+   TRACE_ENTER();
+   osaf_extended_name_lend(value, name);
+   TRACE_LEAVE();
+}
+
+/
+  Name :  saAisNameBorrow
+
+  Description :   Retrieve a tunneled string from an SaNameT type. 
Before
+  calling this function, the SaNameT stucture must have been
+  initialized either by a call to the saAisNameLend() function
+  or by being used as an output parameter of any other SAF API
+  function. If the 

[devel] [PATCH 2 of 3] osaf: Add library functions for handling the extended SaNameT format [#191]

2014-05-02 Thread Anders Widell
 osaf/libs/core/common/Makefile.am  |1 +
 osaf/libs/core/common/include/osaf_extended_name.h |  232 +
 osaf/libs/core/common/osaf_extended_name.c |  184 
 osaf/libs/core/leap/sysf_def.c |3 +
 4 files changed, 420 insertions(+), 0 deletions(-)


These library functions are primarily intended to be used in agent libraries,
to handle the old SAF APIs that still are using the SaNameT type.

diff --git a/osaf/libs/core/common/Makefile.am 
b/osaf/libs/core/common/Makefile.am
--- a/osaf/libs/core/common/Makefile.am
+++ b/osaf/libs/core/common/Makefile.am
@@ -34,6 +34,7 @@ libopensaf_common_la_SOURCES = \
osaf_utility.c \
osaf_poll.c \
osaf_time.c \
+   osaf_extended_name.c \
nid_start_util.c \
saf_edu.c \
daemon.c \
diff --git a/osaf/libs/core/common/include/osaf_extended_name.h 
b/osaf/libs/core/common/include/osaf_extended_name.h
new file mode 100644
--- /dev/null
+++ b/osaf/libs/core/common/include/osaf_extended_name.h
@@ -0,0 +1,232 @@
+/*  -*- OpenSAF  -*-
+ *
+ * (C) Copyright 2014 The OpenSAF Foundation
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. This file and program are licensed
+ * under the GNU Lesser General Public License Version 2.1, February 1999.
+ * The complete license can be accessed from the following location:
+ * http://opensource.org/licenses/lgpl-license.php
+ * See the Copying file included with the OpenSAF distribution for full
+ * licensing terms.
+ *
+ * Author(s): Ericsson AB
+ *
+ */
+
+/** @file
+ *
+ * This file contains functions to support tunneling strings through the legacy
+ * SaNameT structure. The definitions in this file are for internal use within
+ * OpenSAF only, and are intended to be used by the agent libraries to support
+ * legacy SAF API functions that have SaNameT parameters.
+ */
+
+#ifndef OPENSAF_OSAF_LIBS_CORE_COMMON_INCLUDE_OSAF_EXTENDED_NAME_H_
+#define OPENSAF_OSAF_LIBS_CORE_COMMON_INCLUDE_OSAF_EXTENDED_NAME_H_
+
+#include stddef.h
+#include stdbool.h
+#include saAis.h
+
+#ifdef  __cplusplus
+extern C {
+#endif
+
+enum {
+  /**
+   *  Magic number stored in the .length field (the first 16-bit word) of the
+   *  legacy SaNameT type, to indicate that it contains a string longer than or
+   *  equal to SA_MAX_UNEXTENDED_NAME_LENGTH bytes. A pointer to the string is
+   *  stored immediately after the first 16-bit word (typically in the first
+   *  four or eight bytes of the .value field of the legacy SaNameT type.
+   */
+  kExtendedNameMagic = 0xcd2b,
+
+  /**
+   *  Maximum length of a distinguished name, not counting the terminating NUL
+   *  character.
+   */
+  kMaxDnLength = 2048
+};
+
+/**
+ *  @brief Initialize the extended SaNameT functionality.
+ *
+ *  This function reads the environment variable SA_ENABLE_EXTENDED_NAMES to
+ *  determine whether extended SaNameT shall be enabled or not. It shall be
+ *  called by all top-level saXxxInitialize() functions, so that it is
+ *  guaranteed to have been called before any other SAF API function.
+ */
+void osaf_extended_name_init(void);
+
+/**
+ *  @brief Check whether extended SaNameT is enabled.
+ *
+ *  This function returns true if extended SaNameT is enabled, and false
+ *  otherwise. The function osaf_extended_name_init() must have been called
+ *  prior to calling this function.
+ */
+static inline bool osaf_is_extended_names_enabled(void);
+
+/**
+ *  @brief Set the string pointer in the legacy SaNameT type.
+ *
+ *  This function sets the legacy SaNameT @a name to the NUL-terminated string
+ *  @a value. If length of the string @a value is strictly less than
+ *  SA_MAX_UNEXTENDED_NAME_LENGTH bytes, the contents of the string is copied
+ *  into the legacy SaNameT type and can be read in a backwards compatible way
+ *  by legacy applications. If length of the string @a value is greater than or
+ *  equal to SA_MAX_UNEXTENDED_NAME_LENGTH, no copying is performed. Instead, a
+ *  reference to the original string @a value is stored in @a name. In this
+ *  case, it is important that @a value is not modified or freed until @a name
+ *  is either overwritten or freed.
+ */
+void osaf_extended_name_lend(SaConstStringT value, SaNameT* name);
+
+/**
+ *  @brief Get a pointer to the string in the legacy SaNameT type.
+ *
+ *  This function returns a pointer to the string value in the legacy SaNameT 
@a
+ *  name. If the .length field of the legacy SaNameT structure is not equal to
+ *  the magic number @a kExtendedNameMagic, the returned pointer points to a
+ *  copy of the string stored inside @a name. Otherwise, the returned pointer
+ *  points to memory outside @a name.
+ *
+ *  NOTE: This function is intended to be used in agent libraries to read
+ *  SaNameT structures that may have been set by legacy 

[devel] [PATCH 1 of 1] osaf: Fix compilation errors when building with GCC 4.9.0 [#883]

2014-05-08 Thread Anders Widell
 osaf/libs/core/common/ncs_main_pub.c |   2 +-
 osaf/libs/core/common/ncs_sprr.c |   2 +-
 osaf/libs/core/include/ncssysf_def.h |   4 ++--
 osaf/libs/core/leap/hj_dec.c |   4 ++--
 osaf/libs/core/leap/hj_enc.c |   8 
 osaf/libs/core/leap/hj_hdl.c |  18 +-
 osaf/libs/core/leap/hj_ubaid.c   |   6 +++---
 osaf/libs/core/leap/sysf_ipc.c   |   6 +++---
 osaf/libs/core/leap/sysf_mem.c   |   4 ++--
 osaf/libs/core/leap/sysf_tmr.c   |   2 +-
 osaf/services/infrastructure/fm/fms/fm_mds.c |   2 +-
 osaf/services/saf/clmsv/clms/clms_mbcsv.c|   2 +-
 osaf/services/saf/cpsv/cpd/cpd_amf.c |   4 ++--
 osaf/services/saf/cpsv/cpd/cpd_mds.c |   2 +-
 osaf/services/saf/glsv/gld/gld_evt.c |   2 +-
 osaf/services/saf/logsv/lgs/lgs_mbcsv.c  |   2 +-
 osaf/services/saf/ntfsv/ntfs/ntfs_mbcsv.c|   2 +-
 17 files changed, 36 insertions(+), 36 deletions(-)


OpenSAF did not build successfully with GCC 4.9.0, due to a new warning:

In file included from ncs_sprr.c:37:0:
ncs_sprr.c: In function 'ncs_splr_api':
../../../../osaf/libs/core/include/ncssysf_def.h:105:54: error: right-hand 
operand of comma expression has no effect [-Werror=unused-value]
 #define m_LEAP_DBG_SINK(r) (TRACE(IN LEAP_DBG_SINK), r)
  ^
ncs_sprr.c:46:58: note: in expansion of macro 'm_LEAP_DBG_SINK'
 #define m_NCS_SPRR_DBG_SINK(x,y)  printf(SPRR:%s\n, y),m_LEAP_DBG_SINK(x)
  ^
ncs_sprr.c:237:9: note: in expansion of macro 'm_NCS_SPRR_DBG_SINK'
rc = m_NCS_SPRR_DBG_SINK(NCSCC_RC_DUPLICATE_ENTRY, SPLR duplication 
attempted);

The warning actually pointed out a rather tricky bug in ncs_sprr.c, that is not
obvious the first time you look at the code. The bug is that the comma operator
is used within a C preprocessor macro, without surrounding parentheses. When
this macro is used in an assignment statement, the code does not do what you
would expect, since the comma operator has lower precedence than the assignment
operator in the C language.

By adding parentheses around the macro definition, this bug is solved.

diff --git a/osaf/libs/core/common/ncs_main_pub.c 
b/osaf/libs/core/common/ncs_main_pub.c
--- a/osaf/libs/core/common/ncs_main_pub.c
+++ b/osaf/libs/core/common/ncs_main_pub.c
@@ -759,7 +759,7 @@ void ncs_get_sys_params_arg(NCS_SYS_PARA
if (m_NCS_GET_PHYINFO_FROM_NODE_ID(sys_params-node_id, 
sys_params-shelf_id,
   sys_params-slot_id, sub_slot_id) 
!= NCSCC_RC_SUCCESS) {
 
-   m_LEAP_DBG_SINK(NCSCC_RC_FAILURE);
+   m_LEAP_DBG_SINK_VOID;
return;
}
 
diff --git a/osaf/libs/core/common/ncs_sprr.c b/osaf/libs/core/common/ncs_sprr.c
--- a/osaf/libs/core/common/ncs_sprr.c
+++ b/osaf/libs/core/common/ncs_sprr.c
@@ -43,7 +43,7 @@
 #ifdef NDEBUG
 #define m_NCS_SPRR_DBG_SINK(x,y)  (x)
 #else
-#define m_NCS_SPRR_DBG_SINK(x,y)  printf(SPRR:%s\n, y),m_LEAP_DBG_SINK(x)
+#define m_NCS_SPRR_DBG_SINK(x,y)  (printf(SPRR:%s\n, y),m_LEAP_DBG_SINK(x))
 #endif
 
 #define m_NCSSPRR_TRACE_ARG2(x,y)
diff --git a/osaf/libs/core/include/ncssysf_def.h 
b/osaf/libs/core/include/ncssysf_def.h
--- a/osaf/libs/core/include/ncssysf_def.h
+++ b/osaf/libs/core/include/ncssysf_def.h
@@ -91,8 +91,8 @@ void opensaf_reboot(unsigned node_id, co
  ** **
  /
 
-#define m_KEY_CHK_FMT(k,f)  { if (k.fmat != f) m_LEAP_DBG_SINK(0);}
-#define m_KEY_CHK_LEN(l){ if (l  SYSF_MAX_KEY_LEN) m_LEAP_DBG_SINK(0); }
+#define m_KEY_CHK_FMT(k,f)  { if (k.fmat != f) m_LEAP_DBG_SINK_VOID;}
+#define m_KEY_CHK_LEN(l){ if (l  SYSF_MAX_KEY_LEN) m_LEAP_DBG_SINK_VOID; }
 #define m_KEY_CHK_SLEN(s)   { uint32_t l = m_NCS_STRLEN(s); m_KEY_CHK_LEN(l); }
 
 /*
diff --git a/osaf/libs/core/leap/hj_dec.c b/osaf/libs/core/leap/hj_dec.c
--- a/osaf/libs/core/leap/hj_dec.c
+++ b/osaf/libs/core/leap/hj_dec.c
@@ -68,7 +68,7 @@ USRBUF *ncs_decode_n_octets(USRBUF *u, u
**/
if ((s = m_MMGR_DATA_AT_START(u, count, (char *)os)) != (char *)os) {
if (s == 0) {
-   m_LEAP_DBG_SINK(0);
+   m_LEAP_DBG_SINK_VOID;
return (USRBUF *)0;
}
memcpy(os, s, (size_t)count);
@@ -84,7 +84,7 @@ USRBUF *ncs_decode_n_octets(USRBUF *u, u
 uint8_t *ncs_flatten_n_octets(USRBUF *u, uint8_t *os, uint32_t count)
 {
if (u == BNULL) {
-   m_LEAP_DBG_SINK(0);
+   m_LEAP_DBG_SINK_VOID;
return NULL;
}
 
diff --git a/osaf/libs/core/leap/hj_enc.c b/osaf/libs/core/leap/hj_enc.c
--- a/osaf/libs/core/leap/hj_enc.c
+++ b/osaf/libs/core/leap/hj_enc.c
@@ -171,7 +171,7 

Re: [devel] [PATCH 1 of 1] osaf: Fix compilation errors when building with GCC 4.9.0 [#883]

2014-05-08 Thread Anders Widell
Yes that should ALSO be done. :-) There are probably several more places 
where we have printf.

This patch just fixes the missing parentheses. I could fix the printf 
too, while touching that line.

/ Anders Widell

On 05/08/2014 03:33 PM, Hans Feldt wrote:
 Why not just replace with trace?
 /Hans

 -Original Message-
 From: Anders Widell [mailto:anders.wid...@ericsson.com]
 Sent: den 8 maj 2014 15:04
 To: ramesh.bet...@oracle.com
 Cc: opensaf-devel@lists.sourceforge.net
 Subject: [devel] [PATCH 1 of 1] osaf: Fix compilation errors when building 
 with GCC 4.9.0 [#883]

   osaf/libs/core/common/ncs_main_pub.c |   2 +-
   osaf/libs/core/common/ncs_sprr.c |   2 +-
   osaf/libs/core/include/ncssysf_def.h |   4 ++--
   osaf/libs/core/leap/hj_dec.c |   4 ++--
   osaf/libs/core/leap/hj_enc.c |   8 
   osaf/libs/core/leap/hj_hdl.c |  18 +-
   osaf/libs/core/leap/hj_ubaid.c   |   6 +++---
   osaf/libs/core/leap/sysf_ipc.c   |   6 +++---
   osaf/libs/core/leap/sysf_mem.c   |   4 ++--
   osaf/libs/core/leap/sysf_tmr.c   |   2 +-
   osaf/services/infrastructure/fm/fms/fm_mds.c |   2 +-
   osaf/services/saf/clmsv/clms/clms_mbcsv.c|   2 +-
   osaf/services/saf/cpsv/cpd/cpd_amf.c |   4 ++--
   osaf/services/saf/cpsv/cpd/cpd_mds.c |   2 +-
   osaf/services/saf/glsv/gld/gld_evt.c |   2 +-
   osaf/services/saf/logsv/lgs/lgs_mbcsv.c  |   2 +-
   osaf/services/saf/ntfsv/ntfs/ntfs_mbcsv.c|   2 +-
   17 files changed, 36 insertions(+), 36 deletions(-)


 OpenSAF did not build successfully with GCC 4.9.0, due to a new warning:

 In file included from ncs_sprr.c:37:0:
 ncs_sprr.c: In function 'ncs_splr_api':
 ../../../../osaf/libs/core/include/ncssysf_def.h:105:54: error: right-hand 
 operand of comma expression has no effect [-
 Werror=unused-value]
   #define m_LEAP_DBG_SINK(r) (TRACE(IN LEAP_DBG_SINK), r)
^
 ncs_sprr.c:46:58: note: in expansion of macro 'm_LEAP_DBG_SINK'
   #define m_NCS_SPRR_DBG_SINK(x,y)  printf(SPRR:%s\n, y),m_LEAP_DBG_SINK(x)
^
 ncs_sprr.c:237:9: note: in expansion of macro 'm_NCS_SPRR_DBG_SINK'
  rc = m_NCS_SPRR_DBG_SINK(NCSCC_RC_DUPLICATE_ENTRY, SPLR duplication 
 attempted);

 The warning actually pointed out a rather tricky bug in ncs_sprr.c, that is 
 not
 obvious the first time you look at the code. The bug is that the comma 
 operator
 is used within a C preprocessor macro, without surrounding parentheses. When
 this macro is used in an assignment statement, the code does not do what you
 would expect, since the comma operator has lower precedence than the 
 assignment
 operator in the C language.

 By adding parentheses around the macro definition, this bug is solved.

 diff --git a/osaf/libs/core/common/ncs_main_pub.c 
 b/osaf/libs/core/common/ncs_main_pub.c
 --- a/osaf/libs/core/common/ncs_main_pub.c
 +++ b/osaf/libs/core/common/ncs_main_pub.c
 @@ -759,7 +759,7 @@ void ncs_get_sys_params_arg(NCS_SYS_PARA
  if (m_NCS_GET_PHYINFO_FROM_NODE_ID(sys_params-node_id, 
 sys_params-shelf_id,
 sys_params-slot_id, sub_slot_id) 
 != NCSCC_RC_SUCCESS) {

 -m_LEAP_DBG_SINK(NCSCC_RC_FAILURE);
 +m_LEAP_DBG_SINK_VOID;
  return;
  }

 diff --git a/osaf/libs/core/common/ncs_sprr.c 
 b/osaf/libs/core/common/ncs_sprr.c
 --- a/osaf/libs/core/common/ncs_sprr.c
 +++ b/osaf/libs/core/common/ncs_sprr.c
 @@ -43,7 +43,7 @@
   #ifdef NDEBUG
   #define m_NCS_SPRR_DBG_SINK(x,y)  (x)
   #else
 -#define m_NCS_SPRR_DBG_SINK(x,y)  printf(SPRR:%s\n, y),m_LEAP_DBG_SINK(x)
 +#define m_NCS_SPRR_DBG_SINK(x,y)  (printf(SPRR:%s\n, 
 y),m_LEAP_DBG_SINK(x))
   #endif

   #define m_NCSSPRR_TRACE_ARG2(x,y)
 diff --git a/osaf/libs/core/include/ncssysf_def.h 
 b/osaf/libs/core/include/ncssysf_def.h
 --- a/osaf/libs/core/include/ncssysf_def.h
 +++ b/osaf/libs/core/include/ncssysf_def.h
 @@ -91,8 +91,8 @@ void opensaf_reboot(unsigned node_id, co
**
  **

 /

 -#define m_KEY_CHK_FMT(k,f)  { if (k.fmat != f) m_LEAP_DBG_SINK(0);}
 -#define m_KEY_CHK_LEN(l){ if (l  SYSF_MAX_KEY_LEN) m_LEAP_DBG_SINK(0); 
 }
 +#define m_KEY_CHK_FMT(k,f)  { if (k.fmat != f) m_LEAP_DBG_SINK_VOID;}
 +#define m_KEY_CHK_LEN(l){ if (l  SYSF_MAX_KEY_LEN) 
 m_LEAP_DBG_SINK_VOID; }
   #define m_KEY_CHK_SLEN(s)   { uint32_t l = m_NCS_STRLEN(s); 
 m_KEY_CHK_LEN(l); }

   /*
 diff --git a/osaf/libs/core/leap/hj_dec.c b/osaf/libs/core/leap/hj_dec.c
 --- a/osaf/libs/core/leap/hj_dec.c
 +++ b/osaf/libs/core/leap/hj_dec.c
 @@ -68,7 +68,7 @@ USRBUF *ncs_decode_n_octets(USRBUF *u, u
  **/
  if ((s = m_MMGR_DATA_AT_START(u

Re: [devel] [PATCH 1 of 1] smfd: wait for node destination before command execution [#893]

2014-05-15 Thread Anders Widell
Ack with minor comment: there is no check for the return value from 
sleep(), so sleep time may be shortened if interrupted by a signal. 
Also, sleep() is an old function that according to man page may be 
implemented using SIGALRM, which means there is a risk of interference 
from other threads or a prior call to alarm(). Consider using the new 
OpenSAF utility function osaf_nanosleep() instead, which has no risk of 
interference and handles signal interruption for you. E.g. like this:

#include osaf_time.h

struct timespec interval = { 2, 0 };
osaf_nanosleep(interval);

/ Anders Widell

On 05/12/2014 08:53 AM, Ingvar Bergstrom wrote:
   osaf/services/saf/smfsv/smfd/SmfUpgradeStep.cc |  58 
 +++--
   osaf/services/saf/smfsv/smfd/SmfUpgradeStep.hh |   8 ---
   osaf/services/saf/smfsv/smfd/SmfUtils.cc   |  18 
   osaf/services/saf/smfsv/smfd/SmfUtils.hh   |   1 +
   4 files changed, 26 insertions(+), 59 deletions(-)


 smfd wait for the node destination to appear before any command specified in 
 the campaign is executed.
 If the node destination does not appear within a timeout period the campaign 
 will fail.

 diff --git a/osaf/services/saf/smfsv/smfd/SmfUpgradeStep.cc 
 b/osaf/services/saf/smfsv/smfd/SmfUpgradeStep.cc
 --- a/osaf/services/saf/smfsv/smfd/SmfUpgradeStep.cc
 +++ b/osaf/services/saf/smfsv/smfd/SmfUpgradeStep.cc
 @@ -1654,41 +1654,6 @@ SmfUpgradeStep::saveImmContent()
   }
   
   
 //--
 -// executeRemoteCmd()
 -//--
 -bool
 -SmfUpgradeStep::executeRemoteCmd( const std::string  i_cmd,
 -   const std::string  i_node)
 -{
 - TRACE_ENTER();
 - TRACE(Executing script '%s' on node '%s', i_cmd.c_str(), 
 i_node.c_str());
 - SaTimeT timeout;
 - uint32_t cmdrc;
 - bool rc = true;
 -SmfndNodeDest nodeDest;
 -if (!getNodeDestination(i_node, nodeDest)) {
 - LOG_NO(no node destination found for node %s, i_node.c_str());
 - rc = false;
 - goto done;
 - }
 -
 - /* Execute the script remote on node */
 - timeout = smfd_cb-cliTimeout;  /* Default timeout */
 -
 - cmdrc = smfnd_exec_remote_cmd(i_cmd.c_str(), nodeDest, timeout / 
 1000, 0);
 - /* convert ns to 10 ms timeout */
 - if (cmdrc != 0) {
 - LOG_NO(executing command '%s' on node '%s' failed (%x),
 -i_cmd.c_str(), i_node.c_str(), cmdrc);
 - rc = false;
 - goto done;
 - }
 -done:
 - TRACE_LEAVE();
 - return rc;
 -}
 -
 -//--
   // callActivationCmd()
   
 //--
   bool
 @@ -1744,7 +1709,7 @@ SmfUpgradeStep::callActivationCmd()
   
   TRACE(Executing activation command '%s' on node '%s' 
 (single-step),
 actCommand.c_str(), nodeName);
 -if (!getNodeDestination(*n, nodeDest)) {
 +if (!waitForNodeDestination(*n, nodeDest)) {
   LOG_NO(no node destination found for node 
 [%s], nodeName);
   result = false;
   goto done;
 @@ -1897,7 +1862,7 @@ SmfUpgradeStep::callBundleScript(SmfInst
   char const* nodeName = n-c_str();
   TRACE(Executing bundle script '%s' on node 
 '%s' (single-step),
 command.c_str(), nodeName);
 - if (!getNodeDestination(*n, nodeDest)) {
 + if (!waitForNodeDestination(*n, nodeDest)) {
   LOG_NO(no node destination found for 
 node [%s], nodeName);
   result = false;
   goto done;
 @@ -1910,7 +1875,6 @@ SmfUpgradeStep::callBundleScript(SmfInst
   goto done;
   }
   }
 -
   } else {
   
   SmfndNodeDest nodeDest;
 @@ -1918,19 +1882,11 @@ SmfUpgradeStep::callBundleScript(SmfInst
 command.c_str(), i_node.c_str());
   TRACE(Get node destination for %s, i_node.c_str());
   
 - int interval = 5;
 - int nodetimeout = smfd_cb-rebootTimeout/10; 
 //seconds
 - while (!getNodeDestination(i_node, nodeDest)) {
 - if (nodetimeout  0) {
 - TRACE(No destination found, try again 
 wait %d seconds, interval);
 - sleep(interval

Re: [devel] [PATCH 1 of 1] smfd: campaign can be committed after cluster reboot in state completed [#906]

2014-05-16 Thread Anders Widell
Ack.

/ Anders Widell

On 05/15/2014 03:16 PM, Ingvar Bergstrom wrote:
   osaf/services/saf/smfsv/smfd/SmfUpgradeProcedure.cc |  10 +-
   1 files changed, 9 insertions(+), 1 deletions(-)


 Without this patch a cluster reboot in state execution completed will put
 the upgrade campaign in a fail state if the old unused versioned types are
 removed in the campaign wrapup campCompleteAction portion of the campaign.
 A campaign in fail state can not be committed.

 diff --git a/osaf/services/saf/smfsv/smfd/SmfUpgradeProcedure.cc 
 b/osaf/services/saf/smfsv/smfd/SmfUpgradeProcedure.cc
 --- a/osaf/services/saf/smfsv/smfd/SmfUpgradeProcedure.cc
 +++ b/osaf/services/saf/smfsv/smfd/SmfUpgradeProcedure.cc
 @@ -1315,11 +1315,19 @@ SmfUpgradeProcedure::addStepModification
 std::multimapstd::string, 
 objectInst i_objects)
   {
   //This method is called for each calculated step. The purpose is to 
 find out and add the modifications
 - //which shold be carried out for this step. The targetEntityTemplate 
 parent/type part of the procedure (in the campaign)
 + //which should be carried out for this step. The targetEntityTemplate 
 parent/type part of the procedure (in the campaign)
   //is used to match the steps activation/deactivation units.
   //If a match is found the modifications associated with this 
 parent/type shall be added to the step.
   TRACE_ENTER();
   
 +//Skip this for procedures in state completed, modifications will 
 not be needed if completed.
 +//This can happend if the cluster is rebooted and will fail if the 
 reboot is performed when the
 +//versioned types are removed i.e. during test traffic, if the types 
 was removed in campaign wrapup/complete section.
 +if (getState() == SA_SMF_PROC_COMPLETED) {
 +TRACE_LEAVE();
 +return true;
 +}
 +
   std::list  SmfTargetEntityTemplate * ::const_iterator it;
   
   //For each targetEntityTemplate in the procedure


--
Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free.
http://p.sf.net/sfu/SauceLabs
___
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 base: Do not use slashes in the names of POSIX shared memory segments [#909]

2014-05-21 Thread Anders Widell
Summary: base: Do not use slashes in the names of POSIX shared memory segments 
[#909]
Review request for Trac Ticket(s): 909
Peer Reviewer(s): Ramesh
Pull request to: 
Affected branch(es): opensaf-4.3.x, opensaf-4.4.x, default(4.5)
Development branch: default


Impacted area   Impact y/n

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


Comments (indicate scope for each y above):
-

changeset f9003f8108396773670f73403db5d6dc6d19337c
Author: Anders Widell anders.wid...@ericsson.com
Date:   Wed, 21 May 2014 13:30:33 +0200

base: Do not use slashes in the names of POSIX shared memory segments 
[#909]

OpenSAF fails to start on systems with (e)glibc version 2.19, e.g. 
Ubuntu
14.04, openSUSE 13.2:

Error messages produced by the MSG service: May 21 13:17:49 SC-1 
local0.crit
osafmsgnd[536]: CR Creation of shared memory segment failed May 21 
13:17:49
SC-1 local0.crit osafmsgnd[536]: CR Destroying the shared memory segment
failed May 21 13:17:49 SC-1 local0.err osafmsgnd[536]: ER
saAmfComponentUnregister Failed with error 7 May 21 13:17:49 SC-1 
local0.err
osafmsgnd[536]: ER Either library initialization or destroy failed May 
21
13:17:49 SC-1 local0.err osafmsgnd[536]: __init_mqnd() failed May 21
13:17:59 SC-1 local0.notice osafamfnd[454]: NO Instantiation of
'safComp=MQND,safSu=SC-1,safSg=NoRed,safApp=OpenSAF' failed May 21 
13:17:59
SC-1 local0.notice osafamfnd[454]: NO Reason: component registration 
timer
expired May 21 13:17:59 SC-1 local0.warn osafamfnd[454]: WA
'safComp=MQND,safSu=SC-1,safSg=NoRed,safApp=OpenSAF' Presence State
INSTANTIATING = INSTANTIATION_FAILED May 21 13:17:59 SC-1 local0.err
osafamfnd[454]: ER 
'safComp=MQND,safSu=SC-1,safSg=NoRed,safApp=OpenSAF'got
Inst failed May 21 13:17:59 SC-1 local0.crit osafamfnd[454]: Rebooting
OpenSAF NodeId = 131343 EE Name = , Reason: NCS component Instantiation
failed, OwnNodeId = 131343, SupervisionTime = 60

Error messages produced by the CPKT service: May 21 13:12:18 SC-1
local0.notice osafckptnd[496]: Started May 21 13:12:19 SC-1 local0.err
osafckptnd[496]: ER cpnd open request fail for RDWR mode (null)

Error messages produced by the LCK service: May 21 13:12:56 SC-1 
local0.crit
osaflcknd[671]: CR GLND shm create failure: rc 2 Error Invalid argument 
May
21 13:12:56 SC-1 local0.notice osafamfnd[457]: NO
'safComp=GLND,safSu=SC-1,safSg=NoRed,safApp=OpenSAF' faulted due to
'avaDown' : Recovery is 'componentRestart' May 21 13:12:58 SC-1
local0.notice osaflcknd[684]: Started May 21 13:12:58 SC-1 local0.crit
osaflcknd[684]: CR GLND shm create failure: rc 2 Error Invalid argument 
May
21 13:12:58 SC-1 local0.notice osafamfnd[457]: NO
'safComp=GLND,safSu=SC-1,safSg=NoRed,safApp=OpenSAF' faulted due to
'avaDown' : Recovery is 'suFailover' May 21 13:12:58 SC-1 local0.err
osafamfnd[457]: ER safComp=GLND,safSu=SC-1,safSg=NoRed,safApp=OpenSAF
Faulted due to:avaDown Recovery is:suFailover May 21 13:12:58 SC-1
local0.crit osafamfnd[457]: Rebooting OpenSAF NodeId = 131343 EE Name = 
,
Reason: Component faulted: recovery is node failfast, OwnNodeId = 
131343,
SupervisionTime = 60

The POSIX function shm_open() says that the name of a shared memory 
segment
shall begin with a slash, followed by up to 254 characters, none of 
which is
a slash. Glibc version 2.19 added stricter checks, that disallow 
slashes in
names of POSIX shared memory segments (which were previously allowed by
glibc). Since OpenSAF uses slashes in the names, the call to shm_open() 
now
fails.

The solution replaces slashes with underscore characters in the shared
memory segment names.


Complete diffstat:
--
 osaf/libs/core/leap/os_defs.c|  4 ++--
 osaf/services/infrastructure/nid/scripts/opensafd.in |  9 +++--
 2 files changed, 5 insertions(+), 8 deletions(-)


Testing Commands:
-
Build and start OpenSAF on a system with (e)glibc 2.19, e.g. Ubuntu 14.04
or openSUSE 13.2


Testing, Expected Results:
--
OpenSAF should build and start successfully.


Conditions of Submission:
-
Ack from reviewer


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 y  y
x86_64  y

[devel] [PATCH 1 of 1] base: Do not use slashes in the names of POSIX shared memory segments [#909]

2014-05-21 Thread Anders Widell
 osaf/libs/core/leap/os_defs.c|  4 ++--
 osaf/services/infrastructure/nid/scripts/opensafd.in |  9 +++--
 2 files changed, 5 insertions(+), 8 deletions(-)


OpenSAF fails to start on systems with (e)glibc version 2.19, e.g. Ubuntu 
14.04, openSUSE 13.2:

Error messages produced by the MSG service:
May 21 13:17:49 SC-1 local0.crit osafmsgnd[536]: CR Creation of shared memory 
segment failed
May 21 13:17:49 SC-1 local0.crit osafmsgnd[536]: CR Destroying the shared 
memory segment failed
May 21 13:17:49 SC-1 local0.err osafmsgnd[536]: ER saAmfComponentUnregister 
Failed with error 7
May 21 13:17:49 SC-1 local0.err osafmsgnd[536]: ER Either library 
initialization or destroy failed
May 21 13:17:49 SC-1 local0.err osafmsgnd[536]: __init_mqnd() failed
May 21 13:17:59 SC-1 local0.notice osafamfnd[454]: NO Instantiation of 
'safComp=MQND,safSu=SC-1,safSg=NoRed,safApp=OpenSAF' failed
May 21 13:17:59 SC-1 local0.notice osafamfnd[454]: NO Reason: component 
registration timer expired
May 21 13:17:59 SC-1 local0.warn osafamfnd[454]: WA 
'safComp=MQND,safSu=SC-1,safSg=NoRed,safApp=OpenSAF' Presence State 
INSTANTIATING = INSTANTIATION_FAILED
May 21 13:17:59 SC-1 local0.err osafamfnd[454]: ER 
'safComp=MQND,safSu=SC-1,safSg=NoRed,safApp=OpenSAF'got Inst failed
May 21 13:17:59 SC-1 local0.crit osafamfnd[454]: Rebooting OpenSAF NodeId = 
131343 EE Name = , Reason: NCS component Instantiation failed, OwnNodeId = 
131343, SupervisionTime = 60

Error messages produced by the CPKT service:
May 21 13:12:18 SC-1 local0.notice osafckptnd[496]: Started
May 21 13:12:19 SC-1 local0.err osafckptnd[496]: ER cpnd open request fail for 
RDWR mode (null)

Error messages produced by the LCK service:
May 21 13:12:56 SC-1 local0.crit osaflcknd[671]: CR GLND  shm create failure: 
rc 2 Error Invalid argument
May 21 13:12:56 SC-1 local0.notice osafamfnd[457]: NO 
'safComp=GLND,safSu=SC-1,safSg=NoRed,safApp=OpenSAF' faulted due to 'avaDown' : 
Recovery is 'componentRestart'
May 21 13:12:58 SC-1 local0.notice osaflcknd[684]: Started
May 21 13:12:58 SC-1 local0.crit osaflcknd[684]: CR GLND  shm create failure: 
rc 2 Error Invalid argument
May 21 13:12:58 SC-1 local0.notice osafamfnd[457]: NO 
'safComp=GLND,safSu=SC-1,safSg=NoRed,safApp=OpenSAF' faulted due to 'avaDown' : 
Recovery is 'suFailover'
May 21 13:12:58 SC-1 local0.err osafamfnd[457]: ER 
safComp=GLND,safSu=SC-1,safSg=NoRed,safApp=OpenSAF Faulted due to:avaDown 
Recovery is:suFailover
May 21 13:12:58 SC-1 local0.crit osafamfnd[457]: Rebooting OpenSAF NodeId = 
131343 EE Name = , Reason: Component faulted: recovery is node failfast, 
OwnNodeId = 131343, SupervisionTime = 60

The POSIX function shm_open() says that the name of a shared memory segment
shall begin with a slash, followed by up to 254 characters, none of which is a
slash. Glibc version 2.19 added stricter checks, that disallow slashes in names
of POSIX shared memory segments (which were previously allowed by glibc). Since
OpenSAF uses slashes in the names, the call to shm_open() now fails.

The solution replaces slashes with underscore characters in the shared memory
segment names.

diff --git a/osaf/libs/core/leap/os_defs.c b/osaf/libs/core/leap/os_defs.c
--- a/osaf/libs/core/leap/os_defs.c
+++ b/osaf/libs/core/leap/os_defs.c
@@ -773,7 +773,7 @@ uint32_t ncs_os_posix_shm(NCS_OS_POSIX_S
return NCSCC_RC_FAILURE;
}
shm_size = (long)req-info.open.i_size;
-   snprintf(shm_name, PATH_MAX, /opensaf/%s, 
req-info.open.i_name);
+   snprintf(shm_name, PATH_MAX, /opensaf_%s, 
req-info.open.i_name);
req-info.open.o_fd = shm_open(shm_name, 
req-info.open.i_flags, 0666);
if (req-info.open.o_fd  0) {
return NCSCC_RC_FAILURE;
@@ -820,7 +820,7 @@ uint32_t ncs_os_posix_shm(NCS_OS_POSIX_S
 
case NCS_OS_POSIX_SHM_REQ_UNLINK:   /* unlink is shm_unlink */
 
-   snprintf(shm_name, PATH_MAX, /opensaf/%s, 
req-info.unlink.i_name);
+   snprintf(shm_name, PATH_MAX, /opensaf_%s, 
req-info.unlink.i_name);
ret_flag = shm_unlink(shm_name);
if (ret_flag  0) {
printf(shm_unlink failed with errno value %d\n, 
errno);
diff --git a/osaf/services/infrastructure/nid/scripts/opensafd.in 
b/osaf/services/infrastructure/nid/scripts/opensafd.in
--- a/osaf/services/infrastructure/nid/scripts/opensafd.in
+++ b/osaf/services/infrastructure/nid/scripts/opensafd.in
@@ -26,7 +26,6 @@ else
. $pkgsysconfdir/nid.conf
 fi 
 
-shmdir=/dev/shm/opensaf
 binary=$pkglibdir/$prog
 lockfile=$lockdir/$prog
 amfnd_bin=$pkglibdir/osafamfnd
@@ -77,9 +76,9 @@ check_env() {
exit 6
fi
 
-   # /dev/shm, /var/lock  /var/run could be tmpfs mounts and needs to be 
+   # /var/lock  /var/run could be tmpfs mounts and needs to be
# recreated at each boot
-   directories=$shmdir $lockdir 

Re: [devel] [PATCH 1 of 1] log: Fix calculation of timeout time on 32 bit systems [#918]

2014-05-23 Thread Anders Widell
Ack with comment:

osaf_timespec_compare(current_ts, evt-entered_at)  1

On the line above you compare with 1, i.e. you require current time to 
be strictly greater than the entered time. In theory, the time stamps 
could be exactly the same, so you should compare with zero instead.

/ Anders Widell

On 05/22/2014 03:41 PM, Lennart Lund wrote:
   osaf/services/saf/logsv/lgs/lgs_evt.c  |  32 
 
   osaf/services/saf/logsv/lgs/lgs_file.c |  24 +++-
   osaf/services/saf/logsv/lgs/lgs_mds.c  |   5 +++--
   3 files changed, 30 insertions(+), 31 deletions(-)


 Use opensaf time calculation help functions

 diff --git a/osaf/services/saf/logsv/lgs/lgs_evt.c 
 b/osaf/services/saf/logsv/lgs/lgs_evt.c
 --- a/osaf/services/saf/logsv/lgs/lgs_evt.c
 +++ b/osaf/services/saf/logsv/lgs/lgs_evt.c
 @@ -20,6 +20,7 @@
   #include limits.h
   
   #include immutil.h
 +#include osaf_time.h
   
   #include lgs.h
   #include lgs_util.h
 @@ -1251,19 +1252,26 @@ static uint32_t process_api_evt(lgsv_lgs
   goto done;
   }
   
 - // Discard too old messages. Don't discard writes as they are async,
 - // no one is waiting on a response
 + /* Discard too old messages. Don't discard writes as they are async,
 +  * no one is waiting on a response.
 +  * Using osaf time functions will guarantee that code works on 32 and 
 64 bit
 +  * systems.
 +  */
   if (api_type  LGSV_WRITE_LOG_ASYNC_REQ) {
 - struct timespec ts;
 - osafassert(clock_gettime(CLOCK_MONOTONIC, ts) == 0);
 -
 - // convert to milliseconds
 - uint64_t entered = (evt-entered_at.tv_sec * 1000) +
 -  (evt-entered_at.tv_nsec / 100);
 - uint64_t removed = (ts.tv_sec * 1000) + (ts.tv_nsec / 100);
 -
 - // compare with sync send time used in library
 - if ((removed - entered)  (LGS_WAIT_TIME * 10)) {
 + struct timespec current_ts, diff_ts;
 + osaf_clock_gettime(CLOCK_MONOTONIC, current_ts);
 + 
 + /* Calculate time diff current - entered */
 + if (osaf_timespec_compare(current_ts, evt-entered_at)  1) {
 + LOG_ER(%s - Entered message time  current time, 
 __FUNCTION__);
 + osafassert(0);
 + }
 + osaf_timespec_subtract(current_ts, evt-entered_at, diff_ts);
 + 
 + /* Convert to millisec and compare with sync send time used in
 +  * library
 +  */
 + if (osaf_timespec_to_millis(diff_ts)  (LGS_WAIT_TIME * 10)) {
   LOG_IN(discarded message from % PRIx64  type %u,
   evt-fr_dest, api_type);
   goto done;
 diff --git a/osaf/services/saf/logsv/lgs/lgs_file.c 
 b/osaf/services/saf/logsv/lgs/lgs_file.c
 --- a/osaf/services/saf/logsv/lgs/lgs_file.c
 +++ b/osaf/services/saf/logsv/lgs/lgs_file.c
 @@ -34,15 +34,14 @@
   
   #include lgs.h
   #include osaf_utility.h
 -
 -#define GETTIME(x) osafassert(clock_gettime(CLOCK_REALTIME, x) == 0);
 +#include osaf_time.h
   
   pthread_mutex_t lgs_ftcom_mutex;/* For locking communication */
   static pthread_cond_t request_cv;   /* File thread waiting for request */
   static pthread_cond_t answer_cv;/* API waiting for answer (timed) */
   
   /* Max time to wait for file thread to finish */
 -static SaUint32T max_waittime_ms = 500;
 +static uint32_t max_waittime_ms = 500;
   
   struct file_communicate {
   bool request_f; /* True if pending request */
 @@ -82,22 +81,13 @@ static int start_file_thread(void);
* @param timeout_time[out]
* @param timeout_ms[in] in ms
*/
 -static void get_timeout_time(struct timespec *timeout_time, long int 
 timeout_ms)
 +static void get_timeout_time(struct timespec *timeout_time, uint32_t 
 timeout_ms)
   {
 - struct timespec start_time;
 - uint64_t millisec1,millisec2;
 + struct timespec start_time, add_time;
   
 - GETTIME(start_time);
 - 
 - /* Convert to ms */
 - millisec1 = (start_time.tv_sec * 1000) + (start_time.tv_nsec / 100);
 - 
 - /* Add timeout time */
 - millisec2 = millisec1+timeout_ms;
 - 
 - /* Convert back to timespec */
 - timeout_time-tv_sec = millisec2 / 1000;
 - timeout_time-tv_nsec = (millisec2 % 1000) * 100;
 + osaf_clock_gettime(CLOCK_REALTIME, start_time);
 + osaf_millis_to_timespec((uint64_t) timeout_ms, add_time);
 + osaf_timespec_add(start_time, add_time, timeout_time);
   }
   
   
 /*
 diff --git a/osaf/services/saf/logsv/lgs/lgs_mds.c 
 b/osaf/services/saf/logsv/lgs/lgs_mds.c
 --- a/osaf/services/saf/logsv/lgs/lgs_mds.c
 +++ b/osaf/services/saf/logsv/lgs/lgs_mds.c
 @@ -17,6 +17,7 @@
   
   #include ncsencdec_pub.h
   #include lgs.h
 +#include osaf_time.h

Re: [devel] [PATCH 1 of 1] cpnd: increase performance when creating large numbers of sections [#770]

2014-05-23 Thread Anders Widell
Hi Alex!

Nice to see this performance enhancement out for review. Good work!

I have a few minor comments, see inline below (marked AndersW):

regards,
Anders Widell

On 05/20/2014 11:27 PM, Alex Jones wrote:
   osaf/libs/common/cpsv/include/cpnd_cb.h   |6 +-
   osaf/libs/common/cpsv/include/cpnd_init.h |   14 +-
   osaf/libs/common/cpsv/include/cpsv_evt.h  |2 +-
   osaf/services/saf/cpsv/cpnd/Makefile.am   |3 +-
   osaf/services/saf/cpsv/cpnd/cpnd_db.c |  246 +
   osaf/services/saf/cpsv/cpnd/cpnd_evt.c|  115 ---
   osaf/services/saf/cpsv/cpnd/cpnd_proc.c   |   26 +-
   osaf/services/saf/cpsv/cpnd/cpnd_res.c|   15 +-
   osaf/services/saf/cpsv/cpnd/cpnd_sec.cc   |  424 
 ++
   9 files changed, 531 insertions(+), 320 deletions(-)


 Jan  7 21:32:32.772347 1789648919 ERR|MDTM: Frag recd is not next frag 
 so dropping adest=0x010010023922604c
 Jan  7 21:32:32.772399 1789648919 ERR|MDTM: Message is dropped as msg 
 is out of seq TRANSPOR-ID=0x010010023922604c
 With large numbers of sections (5k) on the standby the CPU is pegged and all
 ckpt API functions return with SA_AIS_ERR_TIMEOUT, including ActiveReplicaSet,
 and CheckpointClose!

 The section id database is implemented as a linked list.  Each write to a
 section must traverse the list in order to find the section.  With 1000's of
 sections this takes a looong time.  Also, sync data being sent over is too 
 large
 for one packet (30M).  This causes the transport layer (in this case TIPC), to
 drop packets.  Lastly, the SectionCreate message is not asynchronous when
 ACTIVE_REPLICA is specified.

 Solution is in 3 parts:  (1) make the section id database a C++ STL map for 
 fast
 access.  (2) make MAX_SYNC_TRANSFER_SIZE much smaller: 3M instead of 30M.
 (3) SectionCreate message should be asynchronous when ACTIVE_REPLICA is
 specified.

 diff --git a/osaf/libs/common/cpsv/include/cpnd_cb.h 
 b/osaf/libs/common/cpsv/include/cpnd_cb.h
 --- a/osaf/libs/common/cpsv/include/cpnd_cb.h
 +++ b/osaf/libs/common/cpsv/include/cpnd_cb.h
 @@ -23,7 +23,7 @@
   #include ncs_queue.h
   
   /* global variables */
 -uint32_t gl_cpnd_cb_hdl;
 +extern uint32_t gl_cpnd_cb_hdl;
   
   /* macros for the CB handle */
   #define m_CPND_TAKE_CPND_CB  ncshm_take_hdl(NCS_SERVICE_ID_CPND, 
 gl_cpnd_cb_hdl)
 @@ -131,7 +131,6 @@ typedef struct cpnd_ckpt_section_info {
   SaSizeT sec_size;
   SaTimeT exp_tmr;
   SaTimeT lastUpdate;
 - struct cpnd_ckpt_section_info *prev, *next;
   } CPND_CKPT_SECTION_INFO;
   
   #define CPND_CKPT_SECTION_INFO_NULL ((CPND_CKPT_SECTION_INFO *)0)
 @@ -144,7 +143,8 @@ typedef struct cpnd_ckpt_replica_info_ta
   SaUint32T mem_used; /* Used for status */
   NCS_OS_POSIX_SHM_REQ_INFO open; /* for shm open */
   uint32_t *shm_sec_mapping;  /* for validity of sec */
 - CPND_CKPT_SECTION_INFO *section_info;   /* Sections in the shared 
 memory */
 + void *section_db;   /* used for C++ STL map */
 + void *local_section_db; /* used for C++ STL map */
   } CPND_CKPT_REPLICA_INFO;
   
   /*Structure to store info for ALL_REPL_WRITE EVT processing*/
 diff --git a/osaf/libs/common/cpsv/include/cpnd_init.h 
 b/osaf/libs/common/cpsv/include/cpnd_init.h
 --- a/osaf/libs/common/cpsv/include/cpnd_init.h
 +++ b/osaf/libs/common/cpsv/include/cpnd_init.h
 @@ -157,15 +157,21 @@ void cpnd_evt_node_getnext(CPND_CB *cb,
   uint32_t cpnd_evt_node_add(CPND_CB *cb, CPSV_CPND_ALL_REPL_EVT_NODE 
 *evt_node);
   uint32_t cpnd_evt_node_del(CPND_CB *cb, CPSV_CPND_ALL_REPL_EVT_NODE 
 *evt_node);
   CPND_CKPT_NODE *cpnd_ckpt_node_find_by_name(CPND_CB *cpnd_cb, SaNameT 
 ckpt_name);
 -CPND_CKPT_SECTION_INFO *cpnd_ckpt_sec_get(CPND_CKPT_NODE *cp_node, 
 SaCkptSectionIdT *id);
 -CPND_CKPT_SECTION_INFO *cpnd_ckpt_sec_get_create(CPND_CKPT_NODE *cp_node, 
 SaCkptSectionIdT *id);
 -uint32_t cpnd_ckpt_sec_find(CPND_CKPT_NODE *cp_node, SaCkptSectionIdT *id);
 +void cpnd_ckpt_sec_map_init(CPND_CKPT_REPLICA_INFO *replica_info);
 +void cpnd_ckpt_sec_map_destroy(CPND_CKPT_REPLICA_INFO *replica_info);
 +CPND_CKPT_SECTION_INFO *cpnd_ckpt_sec_get_first(const CPND_CKPT_REPLICA_INFO 
 *replicaInfo);
 +CPND_CKPT_SECTION_INFO *cpnd_ckpt_sec_get_next(const CPND_CKPT_REPLICA_INFO 
 *replicaInfo, const CPND_CKPT_SECTION_INFO *section);
 +CPND_CKPT_SECTION_INFO *cpnd_ckpt_sec_get(const CPND_CKPT_NODE *cp_node, 
 const SaCkptSectionIdT *id);
 +CPND_CKPT_SECTION_INFO *cpnd_ckpt_sec_get_create(const CPND_CKPT_NODE 
 *cp_node, const SaCkptSectionIdT *id);
 +uint32_t cpnd_ckpt_sec_find(const CPND_CKPT_NODE *cp_node, const 
 SaCkptSectionIdT *id);
   CPND_CKPT_SECTION_INFO *cpnd_ckpt_sec_del(CPND_CKPT_NODE *cp_node, 
 SaCkptSectionIdT *id);
   CPND_CKPT_SECTION_INFO *cpnd_ckpt_sec_add(CPND_CKPT_NODE *cp_node, 
 SaCkptSectionIdT *id, SaTimeT exp_time,
 uint32_t gen_flag);
 +uint32_t cpnd_ckpt_sec_add_db(CPND_CKPT_REPLICA_INFO *replicaInfo

[devel] [PATCH 1 of 3] osaf: Add declarations of saAisNameLend() and saAisNameBorrow() [#191]

2014-06-09 Thread Anders Widell
 00-README.conf   |  18 ++
 osaf/libs/saf/include/saAis.h|   4 
 osaf/libs/saf/include/saAis_B_5_14.h |  17 +
 3 files changed, 39 insertions(+), 0 deletions(-)


Add declarations of saAisNameLend() and saAisNameBorrow() to saAis_B_5_14.h.
Update 00-README.conf with description of how to enable the extended SaNameT
type.

diff --git a/00-README.conf b/00-README.conf
--- a/00-README.conf
+++ b/00-README.conf
@@ -447,3 +447,21 @@ Note: The OpenSAF default implemetation 
   Earlier default implementation of the command (which was never called 
from SMF) requires a bundle 
   name as input parameter. 
   From OpenSAF 4.4 the input parameter shall be the DN of the bundle to 
check.
+
+Extended SaNameT type
+=
+The SaNameT type is deprecated will be replaced with string parameters in new
+SAF APIs. As an intermediate solution, the extended format of the SaNameT type
+can be used to pass string parameters to and from old SAF APIs as well, by
+tunneling them through the SaNameT type. To enable the extended SaNameT
+format, the application source code has to be compiled with the
+SA_EXTENDED_NAME_SOURCE preprocessor macro defined, and the environment
+variable SA_ENABLE_EXTENDED_NAMES must be set to the value 1 before the first
+call to any SAF API function.
+
+When the extended SaNameT format is enabled, the SA_MAX_NAME_LENGTH constant
+must not be used, and the application must treat the SaNameT type as opaque
+and not access any of its members directly. Instead, the saAisNameLend() and
+saAisNameBorrow() access functions shall be used. The
+SA_MAX_UNEXTENDED_NAME_LENGTH constant can be used to refer to the maximum
+string length that can be stored in the unextended SaNameT type.
diff --git a/osaf/libs/saf/include/saAis.h b/osaf/libs/saf/include/saAis.h
--- a/osaf/libs/saf/include/saAis.h
+++ b/osaf/libs/saf/include/saAis.h
@@ -70,7 +70,9 @@ typedef SaUint64T SaSelectio
 #define SA_TIME_ONE_DAY 864000LL
 #define SA_TIME_MAX SA_TIME_END
 
+#ifndef SA_EXTENDED_NAME_SOURCE
 #define SA_MAX_NAME_LENGTH 256
+#endif /* SA_EXTENDED_NAME_SOURCE */
 
 #define SA_TRACK_CURRENT   0x01
 #define SA_TRACK_CHANGES   0x02
@@ -156,10 +158,12 @@ typedef struct {
SaUint8T  *bufferAddr;
 } SaAnyT;
 
+#ifndef SA_EXTENDED_NAME_SOURCE
 typedef struct {
 SaUint16T length;
 SaUint8T value[SA_MAX_NAME_LENGTH];
 } SaNameT;
+#endif /* SA_EXTENDED_NAME_SOURCE */
 
 typedef struct {
 SaUint8T releaseCode;
diff --git a/osaf/libs/saf/include/saAis_B_5_14.h 
b/osaf/libs/saf/include/saAis_B_5_14.h
--- a/osaf/libs/saf/include/saAis_B_5_14.h
+++ b/osaf/libs/saf/include/saAis_B_5_14.h
@@ -31,6 +31,23 @@ extern C {
 
 typedef const char* SaConstStringT;
 
+#ifdef SA_EXTENDED_NAME_SOURCE
+#define SA_MAX_UNEXTENDED_NAME_LENGTH 256
+
+typedef struct {
+SaUint16T _opaque[129];
+} SaNameT;
+
+extern void
+saAisNameLend(
+SaConstStringT value,
+SaNameT* name);
+
+extern SaConstStringT
+saAisNameBorrow(
+const SaNameT* name);
+#endif /* SA_EXTENDED_NAME_SOURCE */
+
 #ifdef  __cplusplus
 }
 #endif

--
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing  Easy Data Exploration
http://www.hpccsystems.com
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0 of 3] Review Request for Extended Name Type [#191]

2014-06-09 Thread Anders Widell
Summary: Extended Name Type [#191]
Review request for Trac Ticket(s): 191
Peer Reviewer(s): Mathi
Pull request to: 
Affected branch(es): default(4.5)
Development branch: default


Impacted area   Impact y/n

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


Comments (indicate scope for each y above):
-
These patches add new AIS API functions and definitions for the extended
SaNameT format, used to tunnel NUL-terminated strings through SaNameT.
They also add support library functions to be used in agent libraries.

Changes from previous review:

* Fixed an off-by-one bug i saAisNameBorrow()
* Fixed RPM build problem
* Implemented review comment that the saAisNameLend and saAisBorrow shall
  be available in all SAF libraries, instead of just in libSaImmOm

changeset a836344c6a36ad87cc5ad3e79da0499830733171
Author: Anders Widell anders.wid...@ericsson.com
Date:   Mon, 09 Jun 2014 12:48:23 +0200

osaf: Add declarations of saAisNameLend() and saAisNameBorrow() [#191]

Add declarations of saAisNameLend() and saAisNameBorrow() to 
saAis_B_5_14.h.
Update 00-README.conf with description of how to enable the extended 
SaNameT
type.

changeset 5db6d88a050849e6ce6d5b33ca48bd3b5ce8a06a
Author: Anders Widell anders.wid...@ericsson.com
Date:   Mon, 09 Jun 2014 12:50:15 +0200

osaf: Add library functions for handling the extended SaNameT format 
[#191]

Add support library functions that make it easier for agent libraries to
handle the extended SaNameT format in old SAF APIs that use the SaNameT
type.

changeset 688d74727b89a6ea770dbf199befe5af81fa11ab
Author: Anders Widell anders.wid...@ericsson.com
Date:   Mon, 09 Jun 2014 12:50:17 +0200

osaf: Add implementations of saAisNameLend() and saAisNameBorrow() 
[#191]

The functions saAisNameLend() and saAisNameBorrow() are defined in
saAis_B_5_14.h, but there is no libSaAis library. Therefore, these two
functions are put in all SAF libraries as weak aliases, so that an
application can resolve the symbols no matter what SAF libraries it is
linked against.


Complete diffstat:
--
 00-README.conf |   18 +++
 configure.ac   |1 +
 osaf/libs/common/Makefile.am   |2 +-
 osaf/libs/common/ais/Makefile.am   |   27 
 osaf/libs/common/ais/aisa_api.c|  140 

 osaf/libs/core/common/Makefile.am  |1 +
 osaf/libs/core/common/include/Makefile.am  |1 +
 osaf/libs/core/common/include/osaf_extended_name.h |  232 
++
 osaf/libs/core/common/osaf_extended_name.c |  184 
+++
 osaf/libs/core/leap/sysf_def.c |3 +
 osaf/libs/saf/include/saAis.h  |4 ++
 osaf/libs/saf/include/saAis_B_5_14.h   |   17 ++
 osaf/libs/saf/libSaAmf/Makefile.am |1 +
 osaf/libs/saf/libSaAmf/libSaAmf.map|1 +
 osaf/libs/saf/libSaCkpt/Makefile.am|1 +
 osaf/libs/saf/libSaCkpt/libSaCkpt.map  |1 +
 osaf/libs/saf/libSaClm/Makefile.am |1 +
 osaf/libs/saf/libSaClm/libSaClm.map|1 +
 osaf/libs/saf/libSaEvt/Makefile.am |1 +
 osaf/libs/saf/libSaEvt/libSaEvt.map|1 +
 osaf/libs/saf/libSaImm/Makefile.am |2 +
 osaf/libs/saf/libSaImm/libSaImmOi.map  |1 +
 osaf/libs/saf/libSaImm/libSaImmOm.map  |1 +
 osaf/libs/saf/libSaLck/Makefile.am |1 +
 osaf/libs/saf/libSaLck/libSaLck.map|1 +
 osaf/libs/saf/libSaLog/Makefile.am |1 +
 osaf/libs/saf/libSaLog/libSaLog.map|1 +
 osaf/libs/saf/libSaMsg/Makefile.am |1 +
 osaf/libs/saf/libSaMsg/libSaMsg.map|1 +
 osaf/libs/saf/libSaNtf/Makefile.am |1 +
 osaf/libs/saf/libSaNtf/libSaNtf.map|1 +
 osaf/libs/saf/libSaPlm/Makefile.am |1 +
 osaf/libs/saf/libSaPlm/libSaPlm.map|1 +
 osaf/libs/saf/libSaSmf/Makefile.am |1 +
 osaf

[devel] [PATCH 3 of 3] osaf: Add implementations of saAisNameLend() and saAisNameBorrow() [#191]

2014-06-09 Thread Anders Widell
 configure.ac  |1 +
 osaf/libs/common/Makefile.am  |2 +-
 osaf/libs/common/ais/Makefile.am  |   27 ++
 osaf/libs/common/ais/aisa_api.c   |  140 ++
 osaf/libs/saf/libSaAmf/Makefile.am|1 +
 osaf/libs/saf/libSaAmf/libSaAmf.map   |1 +
 osaf/libs/saf/libSaCkpt/Makefile.am   |1 +
 osaf/libs/saf/libSaCkpt/libSaCkpt.map |1 +
 osaf/libs/saf/libSaClm/Makefile.am|1 +
 osaf/libs/saf/libSaClm/libSaClm.map   |1 +
 osaf/libs/saf/libSaEvt/Makefile.am|1 +
 osaf/libs/saf/libSaEvt/libSaEvt.map   |1 +
 osaf/libs/saf/libSaImm/Makefile.am|2 +
 osaf/libs/saf/libSaImm/libSaImmOi.map |1 +
 osaf/libs/saf/libSaImm/libSaImmOm.map |1 +
 osaf/libs/saf/libSaLck/Makefile.am|1 +
 osaf/libs/saf/libSaLck/libSaLck.map   |1 +
 osaf/libs/saf/libSaLog/Makefile.am|1 +
 osaf/libs/saf/libSaLog/libSaLog.map   |1 +
 osaf/libs/saf/libSaMsg/Makefile.am|1 +
 osaf/libs/saf/libSaMsg/libSaMsg.map   |1 +
 osaf/libs/saf/libSaNtf/Makefile.am|1 +
 osaf/libs/saf/libSaNtf/libSaNtf.map   |1 +
 osaf/libs/saf/libSaPlm/Makefile.am|1 +
 osaf/libs/saf/libSaPlm/libSaPlm.map   |1 +
 osaf/libs/saf/libSaSmf/Makefile.am|1 +
 osaf/libs/saf/libSaSmf/libSaSmf.map   |1 +
 27 files changed, 193 insertions(+), 1 deletions(-)


The functions saAisNameLend() and saAisNameBorrow() are defined in
saAis_B_5_14.h, but there is no libSaAis library. Therefore, these two functions
are put in all SAF libraries as weak aliases, so that an application can resolve
the symbols no matter what SAF libraries it is linked against.

diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -690,6 +690,7 @@ AC_CONFIG_FILES([
 osaf/libs/core/mds/Makefile
 osaf/libs/core/mds/include/Makefile
 osaf/libs/common/Makefile
+osaf/libs/common/ais/Makefile
 osaf/libs/common/amf/Makefile
 osaf/libs/common/amf/include/Makefile
 osaf/libs/common/cpsv/Makefile
diff --git a/osaf/libs/common/Makefile.am b/osaf/libs/common/Makefile.am
--- a/osaf/libs/common/Makefile.am
+++ b/osaf/libs/common/Makefile.am
@@ -18,7 +18,7 @@ include $(top_srcdir)/Makefile.common
 
 MAINTAINERCLEANFILES = Makefile.in
 
-SUBDIRS = amf immsv logsv ntfsv clmsv
+SUBDIRS = ais amf immsv logsv ntfsv clmsv
 
 if ENABLE_AIS_PLM
 
diff --git a/osaf/libs/common/ais/Makefile.am b/osaf/libs/common/ais/Makefile.am
new file mode 100644
--- /dev/null
+++ b/osaf/libs/common/ais/Makefile.am
@@ -0,0 +1,27 @@
+#  -*- OpenSAF  -*-
+#
+# (C) Copyright 2014 The OpenSAF Foundation
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE. This file and program are licensed
+# under the GNU Lesser General Public License Version 2.1, February 1999.
+# The complete license can be accessed from the following location:
+# http://opensource.org/licenses/lgpl-license.php
+# See the Copying file included with the OpenSAF distribution for full
+# licensing terms.
+#
+# Author(s): Ericsson AB
+#
+
+include $(top_srcdir)/Makefile.common
+
+MAINTAINERCLEANFILES = Makefile.in
+
+noinst_LTLIBRARIES = libais_common.la
+
+libais_common_la_CPPFLAGS = \
+   $(AM_CPPFLAGS)
+
+libais_common_la_SOURCES = \
+   aisa_api.c
diff --git a/osaf/libs/common/ais/aisa_api.c b/osaf/libs/common/ais/aisa_api.c
new file mode 100644
--- /dev/null
+++ b/osaf/libs/common/ais/aisa_api.c
@@ -0,0 +1,140 @@
+/* -*- OpenSAF  -*-
+ *
+ * (C) Copyright 2014 The OpenSAF Foundation
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. This file and program are licensed
+ * under the GNU Lesser General Public License Version 2.1, February 1999.
+ * The complete license can be accessed from the following location:
+ * http://opensource.org/licenses/lgpl-license.php
+ * See the Copying file included with the OpenSAF distribution for full
+ * licensing terms.
+ *
+ * Author(s): Ericsson AB
+ *
+ */
+
+/*
+  DESCRIPTION:
+
+  The SaNameT type is deprecated will be replaced with string parameters in new
+  SAF APIs. As an intermediate solution, the extended format of the SaNameT 
type
+  can be used to pass string parameters to and from old SAF APIs as well, by
+  tunneling them through the SaNameT type. To enable the extended SaNameT
+  format, the application source code has to be compiled with the
+  SA_EXTENDED_NAME_SOURCE preprocessor macro defined, and the environment
+  variable SA_ENABLE_EXTENDED_NAMES must be set to the value 1 before the first
+  call to any SAF API function.
+
+  When the extended SaNameT format is enabled, the SA_MAX_NAME_LENGTH 

[devel] [PATCH 2 of 3] osaf: Add library functions for handling the extended SaNameT format [#191]

2014-06-09 Thread Anders Widell
 osaf/libs/core/common/Makefile.am  |1 +
 osaf/libs/core/common/include/Makefile.am  |1 +
 osaf/libs/core/common/include/osaf_extended_name.h |  232 +
 osaf/libs/core/common/osaf_extended_name.c |  184 
 osaf/libs/core/leap/sysf_def.c |3 +
 5 files changed, 421 insertions(+), 0 deletions(-)


Add support library functions that make it easier for agent libraries to handle
the extended SaNameT format in old SAF APIs that use the SaNameT type.

diff --git a/osaf/libs/core/common/Makefile.am 
b/osaf/libs/core/common/Makefile.am
--- a/osaf/libs/core/common/Makefile.am
+++ b/osaf/libs/core/common/Makefile.am
@@ -34,6 +34,7 @@ libopensaf_common_la_SOURCES = \
osaf_utility.c \
osaf_poll.c \
osaf_time.c \
+   osaf_extended_name.c \
nid_start_util.c \
saf_edu.c \
daemon.c \
diff --git a/osaf/libs/core/common/include/Makefile.am 
b/osaf/libs/core/common/include/Makefile.am
--- a/osaf/libs/core/common/include/Makefile.am
+++ b/osaf/libs/core/common/include/Makefile.am
@@ -30,6 +30,7 @@ noinst_HEADERS = \
sprr_dl_api.h \
nid_start_util.h \
daemon.h \
+   osaf_extended_name.h \
osaf_unicode.h \
osaf_poll.h \
osaf_time.h \
diff --git a/osaf/libs/core/common/include/osaf_extended_name.h 
b/osaf/libs/core/common/include/osaf_extended_name.h
new file mode 100644
--- /dev/null
+++ b/osaf/libs/core/common/include/osaf_extended_name.h
@@ -0,0 +1,232 @@
+/*  -*- OpenSAF  -*-
+ *
+ * (C) Copyright 2014 The OpenSAF Foundation
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. This file and program are licensed
+ * under the GNU Lesser General Public License Version 2.1, February 1999.
+ * The complete license can be accessed from the following location:
+ * http://opensource.org/licenses/lgpl-license.php
+ * See the Copying file included with the OpenSAF distribution for full
+ * licensing terms.
+ *
+ * Author(s): Ericsson AB
+ *
+ */
+
+/** @file
+ *
+ * This file contains functions to support tunneling strings through the legacy
+ * SaNameT structure. The definitions in this file are for internal use within
+ * OpenSAF only, and are intended to be used by the agent libraries to support
+ * legacy SAF API functions that have SaNameT parameters.
+ */
+
+#ifndef OPENSAF_OSAF_LIBS_CORE_COMMON_INCLUDE_OSAF_EXTENDED_NAME_H_
+#define OPENSAF_OSAF_LIBS_CORE_COMMON_INCLUDE_OSAF_EXTENDED_NAME_H_
+
+#include stddef.h
+#include stdbool.h
+#include saAis.h
+
+#ifdef  __cplusplus
+extern C {
+#endif
+
+enum {
+  /**
+   *  Magic number stored in the .length field (the first 16-bit word) of the
+   *  legacy SaNameT type, to indicate that it contains a string longer than or
+   *  equal to SA_MAX_UNEXTENDED_NAME_LENGTH bytes. A pointer to the string is
+   *  stored immediately after the first 16-bit word (typically in the first
+   *  four or eight bytes of the .value field of the legacy SaNameT type.
+   */
+  kExtendedNameMagic = 0xcd2b,
+
+  /**
+   *  Maximum length of a distinguished name, not counting the terminating NUL
+   *  character.
+   */
+  kMaxDnLength = 2048
+};
+
+/**
+ *  @brief Initialize the extended SaNameT functionality.
+ *
+ *  This function reads the environment variable SA_ENABLE_EXTENDED_NAMES to
+ *  determine whether extended SaNameT shall be enabled or not. It shall be
+ *  called by all top-level saXxxInitialize() functions, so that it is
+ *  guaranteed to have been called before any other SAF API function.
+ */
+void osaf_extended_name_init(void);
+
+/**
+ *  @brief Check whether extended SaNameT is enabled.
+ *
+ *  This function returns true if extended SaNameT is enabled, and false
+ *  otherwise. The function osaf_extended_name_init() must have been called
+ *  prior to calling this function.
+ */
+static inline bool osaf_is_extended_names_enabled(void);
+
+/**
+ *  @brief Set the string pointer in the legacy SaNameT type.
+ *
+ *  This function sets the legacy SaNameT @a name to the NUL-terminated string
+ *  @a value. If length of the string @a value is strictly less than
+ *  SA_MAX_UNEXTENDED_NAME_LENGTH bytes, the contents of the string is copied
+ *  into the legacy SaNameT type and can be read in a backwards compatible way
+ *  by legacy applications. If length of the string @a value is greater than or
+ *  equal to SA_MAX_UNEXTENDED_NAME_LENGTH, no copying is performed. Instead, a
+ *  reference to the original string @a value is stored in @a name. In this
+ *  case, it is important that @a value is not modified or freed until @a name
+ *  is either overwritten or freed.
+ */
+void osaf_extended_name_lend(SaConstStringT value, SaNameT* name);
+
+/**
+ *  @brief Get a pointer to the string in the legacy SaNameT type.
+ *
+ *  This function returns a 

[devel] [PATCH 0 of 1] Review Request for build: Modernize autotools configuration [#901]

2014-06-09 Thread Anders Widell
Summary: build: Modernize autotools configuration [#901]
Review request for Trac Ticket(s): 901
Peer Reviewer(s): Mathi
Pull request to: 
Affected branch(es): default(4.5)
Development branch: default


Impacted area   Impact y/n

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


Comments (indicate scope for each y above):
-
changeset f3a7552039663e0884a45f4f94123401fe7b0807
Author: Anders Widell anders.wid...@ericsson.com
Date:   Mon, 09 Jun 2014 17:12:43 +0200

build: Modernize autotools configuration [#901]

The macro AM_INIT_AUTOMAKE is now called without parameters. Also, the
Makefiles no longer reference source files that are not located in the 
same
directory as the Makefile. Instead, a static library is built in these
cases, and the Makefile will reference the library.


Complete diffstat:
--
 Makefile.am|   4 ++--
 configure.ac   |  11 ---
 contrib/plmc/configure.ac  |   6 +++---
 java/ais_api_impl_native/Makefile.am   |  34 
+-
 osaf/Makefile.am   |   2 +-
 osaf/libs/common/immsv/Makefile.am |  11 ++-
 osaf/services/saf/amf/amfd/Makefile.am |   5 ++---
 osaf/services/saf/amf/amfnd/Makefile.am|   2 +-
 osaf/services/saf/clmsv/clms/Makefile.am   |   4 ++--
 osaf/services/saf/cpsv/cpd/Makefile.am |   4 ++--
 osaf/services/saf/edsv/eds/Makefile.am |   2 +-
 osaf/services/saf/glsv/gld/Makefile.am |   4 ++--
 osaf/services/saf/immsv/immpbed/Makefile.am|   4 ++--
 osaf/services/saf/logsv/lgs/Makefile.am|   2 +-
 osaf/services/saf/mqsv/mqd/Makefile.am |   4 ++--
 osaf/services/saf/mqsv/mqnd/Makefile.am|   2 +-
 osaf/services/saf/ntfsv/ntfimcnd/Makefile.am   |   2 +-
 osaf/services/saf/ntfsv/ntfs/Makefile.am   |   4 ++--
 osaf/services/saf/plmsv/plms/Makefile.am   |   2 +-
 osaf/services/saf/smfsv/smfd/Makefile.am   |   4 ++--
 osaf/tools/safimm/Makefile.am  |   2 +-
 osaf/tools/safimm/immadm/Makefile.am   |   2 +-
 osaf/tools/safimm/immcfg/Makefile.am   |   2 +-
 osaf/tools/safimm/immdump/Makefile.am  |   6 +++---
 osaf/tools/safimm/immfind/Makefile.am  |   2 +-
 osaf/tools/safimm/immlist/Makefile.am  |   2 +-
 osaf/tools/safimm/src/Makefile.am  |  28 

 osaf/tools/saflog/Makefile.am  |   2 +-
 osaf/tools/saflog/src/Makefile.am  |  29 
+
 osaf/tools/safntf/Makefile.am  |   2 +-
 osaf/tools/safntf/ntfread/Makefile.am  |   6 +++---
 osaf/tools/safntf/ntfsend/Makefile.am  |   6 +++---
 osaf/tools/safntf/ntfsubscribe/Makefile.am |   6 +++---
 osaf/tools/safntf/src/Makefile.am  |  30 
++
 samples/configure.ac   |   6 +++---
 tests/Makefile |   3 ++-
 tests/clmsv/Makefile.am|  32 
+++-
 tests/clmsv/src/clmtest.c  |   0 
 tests/clmsv/src/clmtest.h  |   0 
 tests/clmsv/src/tet_ClmOiOps.c |   0 
 tests/clmsv/src/tet_saClmClusterNodeGet.c  |   0 
 tests/clmsv/src/tet_saClmClusterNodeGetAsync.c |   0 
 tests/clmsv/src/tet_saClmClusterNotificationFree.c |   0 
 tests/clmsv/src/tet_saClmClusterTrack.c|   0 
 tests/clmsv/src/tet_saClmClusterTrackStop.c|   0 
 tests/clmsv/src/tet_saClmDispatch.c|   0 
 tests/clmsv/src/tet_saClmFinalize.c|   0 
 tests/clmsv/src/tet_saClmInitialize.c  |   0 
 tests/clmsv/src/tet_saClmResponse.c|   0 
 tests/clmsv/src/tet_saClmSelectionObjectGet.c  |   0 
 tests/immsv/common/Makefile.am |  10 ++
 tests/immsv/implementer/Makefile.am|  10 --
 tests/immsv/management/Makefile.am |  11 ---
 tests/logsv/Makefile.am|   8 
 tests/mds/Makefile.am  |   5 ++---
 tests/ntfsv/Makefile.am|  10 +-
 tests/plmsv/Makefile.am|   2 +-
 tests/plmsv/common/Makefile.am |  27

[devel] [PATCH 1 of 1] build: Modernize autotools configuration [#901]

2014-06-09 Thread Anders Widell
 Makefile.am|   4 +-
 configure.ac   |  11 +-
 contrib/plmc/configure.ac  |   6 +-
 java/ais_api_impl_native/Makefile.am   |  34 +++---
 osaf/Makefile.am   |   2 +-
 osaf/libs/common/immsv/Makefile.am |  11 ++-
 osaf/services/saf/amf/amfd/Makefile.am |   5 +-
 osaf/services/saf/amf/amfnd/Makefile.am|   2 +-
 osaf/services/saf/clmsv/clms/Makefile.am   |   4 +-
 osaf/services/saf/cpsv/cpd/Makefile.am |   4 +-
 osaf/services/saf/edsv/eds/Makefile.am |   2 +-
 osaf/services/saf/glsv/gld/Makefile.am |   4 +-
 osaf/services/saf/immsv/immpbed/Makefile.am|   4 +-
 osaf/services/saf/logsv/lgs/Makefile.am|   2 +-
 osaf/services/saf/mqsv/mqd/Makefile.am |   4 +-
 osaf/services/saf/mqsv/mqnd/Makefile.am|   2 +-
 osaf/services/saf/ntfsv/ntfimcnd/Makefile.am   |   2 +-
 osaf/services/saf/ntfsv/ntfs/Makefile.am   |   4 +-
 osaf/services/saf/plmsv/plms/Makefile.am   |   2 +-
 osaf/services/saf/smfsv/smfd/Makefile.am   |   4 +-
 osaf/tools/safimm/Makefile.am  |   2 +-
 osaf/tools/safimm/immadm/Makefile.am   |   2 +-
 osaf/tools/safimm/immcfg/Makefile.am   |   2 +-
 osaf/tools/safimm/immdump/Makefile.am  |   6 +-
 osaf/tools/safimm/immfind/Makefile.am  |   2 +-
 osaf/tools/safimm/immlist/Makefile.am  |   2 +-
 osaf/tools/safimm/src/Makefile.am  |  28 ++
 osaf/tools/saflog/Makefile.am  |   2 +-
 osaf/tools/saflog/src/Makefile.am  |  29 ++
 osaf/tools/safntf/Makefile.am  |   2 +-
 osaf/tools/safntf/ntfread/Makefile.am  |   6 +-
 osaf/tools/safntf/ntfsend/Makefile.am  |   6 +-
 osaf/tools/safntf/ntfsubscribe/Makefile.am |   6 +-
 osaf/tools/safntf/src/Makefile.am  |  30 +++
 samples/configure.ac   |   6 +-
 tests/Makefile |   3 +-
 tests/clmsv/Makefile.am|  32 +---
 tests/clmsv/src/clmtest.c  |   0 
 tests/clmsv/src/clmtest.h  |   0 
 tests/clmsv/src/tet_ClmOiOps.c |   0 
 tests/clmsv/src/tet_saClmClusterNodeGet.c  |   0 
 tests/clmsv/src/tet_saClmClusterNodeGetAsync.c |   0 
 tests/clmsv/src/tet_saClmClusterNotificationFree.c |   0 
 tests/clmsv/src/tet_saClmClusterTrack.c|   0 
 tests/clmsv/src/tet_saClmClusterTrackStop.c|   0 
 tests/clmsv/src/tet_saClmDispatch.c|   0 
 tests/clmsv/src/tet_saClmFinalize.c|   0 
 tests/clmsv/src/tet_saClmInitialize.c  |   0 
 tests/clmsv/src/tet_saClmResponse.c|   0 
 tests/clmsv/src/tet_saClmSelectionObjectGet.c  |   0 
 tests/immsv/common/Makefile.am |  10 ++
 tests/immsv/implementer/Makefile.am|  10 ++---
 tests/immsv/management/Makefile.am |  11 ++
 tests/logsv/Makefile.am|   8 ++--
 tests/mds/Makefile.am  |   5 +-
 tests/ntfsv/Makefile.am|  10 +++---
 tests/plmsv/Makefile.am|   2 +-
 tests/plmsv/common/Makefile.am |  27 +
 tests/plmsv/plms/Makefile.am   |   7 +--
 tests/unit_test_fw/Makefile.am |   2 +-
 tests/unit_test_fw/inc/util.h  |   1 -
 tests/unit_test_fw/src/Makefile.am |  30 +++
 tests/unit_test_fw/src/util.c  |   2 +-
 63 files changed, 281 insertions(+), 123 deletions(-)


The macro AM_INIT_AUTOMAKE is now called without parameters. Also, the Makefiles
no longer reference source files that are not located in the same directory as
the Makefile. Instead, a static library is built in these cases, and the
Makefile will reference the library.

diff --git a/Makefile.am b/Makefile.am
--- a/Makefile.am
+++ b/Makefile.am
@@ -160,14 +160,14 @@ if ENABLE_TESTS
 EXTRA_DIST += tests
 
 SUBDIRS += \
+   tests/unit_test_fw \
tests/logsv \
tests/ntfsv \
tests/immsv \
tests/immsv/implementer \
tests/immsv/management \
tests/clmsv \
-   tests/mds \
-   tests/unit_test_fw
+   tests/mds
 
 if ENABLE_AIS_PLM
 SUBDIRS += \
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -15,14 +15,14 @@
 #
 
 AC_PREREQ([2.61])
-AC_INIT([opensaf], [4.5.M0], [opensaf-devel@lists.sourceforge.net])
+AC_INIT([opensaf], [4.5.M0], [opensaf-us...@lists.sourceforge.net], [opensaf])
 

Re: [devel] [PATCH 0 of 1] Review Request for osaf: port existing daemonization and nid process to systemd new-style daemon [#455]

2014-06-10 Thread Anders Widell
Hi!

I have started testing this patch. When I build RPMs and install on 
openSUSE 13.2.M0 I get the following log messages:

Jun 10 15:31:19 SC-1 systemd[1]: Configuration file 
/usr/lib/systemd/system/opensafd.service is marked executable. Please 
remove executable permission bits. Proceeding anyway.
Jun 10 15:31:19 SC-1 systemd[1]: 
[/usr/lib/systemd/system/opensafd.service:10] Unknown lvalue 
'ControlGroup' in section 'Service'

The first message simply says the file is installed with wrong 
permissions, so that one should be easy to fix. The second one is more 
strange, though. Do you get this message on your system? Do you get the 
same log message? Maybe this configuration option has changed in recent 
versions of systemd?

/ Anders Widell

On 06/02/2014 11:12 PM, Alex Jones wrote:
 Summary: osaf: port existing daemonization and nid process to systemd 
 new-style daemon
 Review request for Trac Ticket(s): 455
 Peer Reviewer(s): HansF, AndersW
 Pull request to: AndersW
 Affected branch(es): branch
 Development branch:

 
 Impacted area   Impact y/n
 
   Docsn
   Build systemy
   RPM/packaging   y
   Configuration files y
   Startup scripts y
   SAF servicesn
   OpenSAF servicesn
   Core libraries  n
   Samples n
   Tests   n
   Other   n


 Comments (indicate scope for each y above):
 -
 This is a first cut at getting OpenSAF to work with systemd.  This patch still
 leaves the opensafd SysV init.d script, but creates a new opensafd.service 
 file
 which calls it.  No attempt has been made to convert the individual daemons to
 systemd, except for plmcd, which has been converted to a full-blown systemd
 daemon.  I've built this for both Fedora 19 and OpenSUSE 12.2, and ran it on
 OpenSUSE 12.2.  I have not run it on Fedora 19.

 changeset 08c4e042835b7dbf45876c10fd3b1db5ba066319
 Author:   Alex Jones ajo...@genband.com
 Date: Mon, 02 Jun 2014 17:03:09 -0400

   osaf: port existing daemonization and nid process to systemd new-style
   daemon [#455]

   Jun 2 16:55:57 linux-po6q osafrded[16114]: Started Jun 2 16:55:57 linux-
   po6q osafrded[16114]: Creation of real-time thread 'OSAF_TMR' FAILED -
   'Operation not permitted' Jun 2 16:55:57 linux-po6q osafrded[16114]: ER
   ncs_core_agents_startup FAILED Jun 2 16:55:57 linux-po6q 
 opensafd[16086]:
   ER Failed Jun 2 16:55:57 linux-po6q opensafd[16086]: ER Going for 
 recovery
   Jun 2 16:55:57 linux-po6q opensafd[16086]: ER Trying To RESPAWN
   /usr/lib64/opensaf/clc-cli/osaf-rded attempt #1 Jun 2 16:55:57 
 linux-po6q
   opensafd[16086]: ER Sending SIGKILL to RDE, pid=16106 Jun 2 16:55:57 
 linux-
   po6q osafrded[16114]: Exiting... Jun 2 16:56:12 linux-po6q 
 osafrded[16133]:
   Started

   Linux distros that use systemd fail to start opensafd because, by 
 default,
   systemd does not assign any RT time budgets to the cpu cgroups it 
 creates.

   The solution is in two parts: (1) Create an opensafd.service file for 
 use
   by systemd which has cgroup info in it. (2) Make plmcd a full systemd-
   enabled daemon.


 Added Files:
 
   contri
   osaf/services/infrastructure/nid/scripts/opensafd.service.in


 Complete diffstat:
 --
   Makefile.common  |   1 +
   configure.ac |  16 ++
   contrib/plmc/Makefile.common |   1 +
   contrib/plmc/config/plmcd.conf   |   4 +
   contrib/plmc/configure.ac|  16 ++
   contrib/plmc/lib/utils/plmc_read_config.c|   8 +
   contrib/plmc/plmcd/Makefile.am   |   4 +
   contrib/plmc/plmcd/plmcd.c   |  52 -
   contrib/plmc/scripts/Makefile.am |   6 +
   contrib/plmc/scripts/plmcboot.service.in |  12 ++
   contrib/plmc/scripts/plmcd.service.in|  13 ++
   opensaf.spec.in  |  70 
 ++-
   osaf/services/infrastructure/nid/scripts/Makefile.am |   5 +
   osaf/services/infrastructure/nid/scripts/opensafd.service.in |  13 ++
   14 files changed, 211 insertions(+), 10 deletions(-)


 Testing Commands:
 -
 systemctl start opensafd.service on a distro that uses systemd.


 Testing, Expected Results:
 --
 It starts.


 Conditions of Submission:
 -


 Arch  Built StartedLinux distro
 ---
 mipsn  n
 mips64  n  n
 x86 n  n
 x86_64  y  y

Re: [devel] [PATCH 0 of 1] Review Request for osaf: port existing daemonization and nid process to systemd new-style daemon [#455]

2014-06-11 Thread Anders Widell
It starts anyway (even without your patch) on openSUSE 13.2.M0. So I 
guess it is fine to have it there, but it would be nice to avoid warning 
messages in syslog. Also, we should check how this is supposed to be 
configured on newer systemd versions, maybe another option is needed?

/ Anders Widell

On 06/10/2014 05:30 PM, Alex Jones wrote:
 Oh great...

 After a quick perusal of the systemd changelogs, it looks like they 
 removed support for ControlGroup in systemd-205, replacing it with 
 different attributes.  ControlGroup is the key attribute that allows 
 RT threads to work under systemd (which we need!).

 Did it start OpenSAF, or did you still get the RT thread error?

 I guess I'll need to figure out how to get it to work under the new 
 scheme, as well as keep the pre-systemd-205 ControlGroup.

 It should work properly under OpenSUSE 12.2 and Fedora 19.

 I will install OpenSUSE 13.2, and fix the issues.

 Alex


 On 06/10/2014 10:25 AM, Anders Widell wrote:
 Hi!

 I have started testing this patch. When I build RPMs and install on 
 openSUSE 13.2.M0 I get the following log messages:

 Jun 10 15:31:19 SC-1 systemd[1]: Configuration file 
 /usr/lib/systemd/system/opensafd.service is marked executable. Please 
 remove executable permission bits. Proceeding anyway.
 Jun 10 15:31:19 SC-1 systemd[1]: 
 [/usr/lib/systemd/system/opensafd.service:10] Unknown lvalue 
 'ControlGroup' in section 'Service'

 The first message simply says the file is installed with wrong 
 permissions, so that one should be easy to fix. The second one is 
 more strange, though. Do you get this message on your system? Do you 
 get the same log message? Maybe this configuration option has changed 
 in recent versions of systemd?

 / Anders Widell

 On 06/02/2014 11:12 PM, Alex Jones wrote:
 Summary: osaf: port existing daemonization and nid process to 
 systemd new-style daemon
 Review request for Trac Ticket(s): 455
 Peer Reviewer(s): HansF, AndersW
 Pull request to: AndersW
 Affected branch(es): branch
 Development branch:

 
 Impacted area   Impact y/n
 
   Docsn
   Build systemy
   RPM/packaging   y
   Configuration files y
   Startup scripts y
   SAF servicesn
   OpenSAF servicesn
   Core libraries  n
   Samples n
   Tests   n
   Other   n


 Comments (indicate scope for each y above):
 -
 This is a first cut at getting OpenSAF to work with systemd. This 
 patch still
 leaves the opensafd SysV init.d script, but creates a new 
 opensafd.service file
 which calls it.  No attempt has been made to convert the individual 
 daemons to
 systemd, except for plmcd, which has been converted to a full-blown 
 systemd
 daemon.  I've built this for both Fedora 19 and OpenSUSE 12.2, and 
 ran it on
 OpenSUSE 12.2.  I have not run it on Fedora 19.

 changeset 08c4e042835b7dbf45876c10fd3b1db5ba066319
 Author:Alex Jones ajo...@genband.com
 Date:Mon, 02 Jun 2014 17:03:09 -0400

 osaf: port existing daemonization and nid process to systemd 
 new-style
 daemon [#455]

 Jun 2 16:55:57 linux-po6q osafrded[16114]: Started Jun 2 
 16:55:57 linux-
 po6q osafrded[16114]: Creation of real-time thread 'OSAF_TMR' 
 FAILED -
 'Operation not permitted' Jun 2 16:55:57 linux-po6q 
 osafrded[16114]: ER
 ncs_core_agents_startup FAILED Jun 2 16:55:57 linux-po6q 
 opensafd[16086]:
 ER Failed Jun 2 16:55:57 linux-po6q opensafd[16086]: ER Going 
 for recovery
 Jun 2 16:55:57 linux-po6q opensafd[16086]: ER Trying To RESPAWN
 /usr/lib64/opensaf/clc-cli/osaf-rded attempt #1 Jun 2 16:55:57 
 linux-po6q
 opensafd[16086]: ER Sending SIGKILL to RDE, pid=16106 Jun 2 
 16:55:57 linux-
 po6q osafrded[16114]: Exiting... Jun 2 16:56:12 linux-po6q 
 osafrded[16133]:
 Started

 Linux distros that use systemd fail to start opensafd because, 
 by default,
 systemd does not assign any RT time budgets to the cpu cgroups 
 it creates.

 The solution is in two parts: (1) Create an opensafd.service 
 file for use
 by systemd which has cgroup info in it. (2) Make plmcd a full 
 systemd-
 enabled daemon.


 Added Files:
 
   contri
   osaf/services/infrastructure/nid/scripts/opensafd.service.in


 Complete diffstat:
 --
   Makefile.common |   1 +
   configure.ac |  16 ++
   contrib/plmc/Makefile.common |   1 +
   contrib/plmc/config/plmcd.conf |   4 +
   contrib/plmc/configure.ac |  16 ++
   contrib/plmc/lib/utils/plmc_read_config.c |   8 +
   contrib/plmc/plmcd/Makefile.am |   4 +
   contrib/plmc/plmcd/plmcd.c |  52 -
   contrib/plmc/scripts/Makefile.am |   6 +
   contrib/plmc/scripts/plmcboot.service.in |  12 ++
   contrib/plmc/scripts/plmcd.service.in |  13 ++
   opensaf.spec.in |  70 ++-
   osaf/services/infrastructure/nid

[devel] Release schedule for OpenSAF 4.5

2014-06-13 Thread Anders Widell
Hi all!

Summer holidays are approaching, and so is the OpenSAF 4.5 release. We 
are now aiming to tag OpenSAF 4.5.FC on August 15. This means that there 
is around two months left for implementing enhancements that are to be 
included in OpenSAF 4.5. When 4.5.FC has been tagged, we will only 
accept bug fixes on the 4.5 branch.

regards,
Anders Widell


--
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing  Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


  1   2   3   4   5   6   7   8   9   >