Re: [devel] [PATCH 1/1] amf: remove hard-coding in amfnd [#3205]

2020-07-29 Thread Mathi N P
That description sounds fine to me. Nevertheless, I still can't see the
problem you are trying to solve when it is already possible to run OpenSAF
as a non-root user.

Cheers,
Mathi.

On Tue, Jul 28, 2020 at 9:56 PM Anand Sundararaj <
s.an...@gethighavailability.com> wrote:

> Thanks Mathi. I can change it to  "amf: provide configuration option to
> run amfnd as non-root [##205]", is that ok?
>
> Thanks
> Anand Sundararaj
> Senior Solutions Architect | +1 480 686 4772
>
> www.GetHighAvailability.com
> <https://am2.myprofessionalmail.com/appsuite/www.GetHighAvailability.com>
> Get High Availability Today!
> *NJ, USA*: +1 508-507-6507
>
> On 07/28/2020 12:24 PM Mathi N P  wrote:
>
>
> Hi Anand,
>
> For some background, It is not merely a hard coding that you are looking
> at, but it is rather by design.
> I think you should at the least change the commit message of your patch
> and describe the actual change that you are intending to introduce.
> FYI,
> Mathi.
>
> On Tue, Jul 28, 2020 at 6:01 PM Anand Sundararaj <
> s.an...@gethighavailability.com> wrote:
>
> Hi Minh/Thang/Nagendra/Paul,
> I am planning to push the patch by 30th July(thursday).
> Please kindly find some time to review by 29th July(tomorrow) and
> send your comments or Ack.
>
> Thanks
> Anand Sundararaj
> Senior Solutions Architect | +1 480 686 4772
> www.GetHighAvailability.com (
> https://am2.myprofessionalmail.com/appsuite/www.GetHighAvailability.com)
> Get High Availability Today!
> NJ, USA: +1 508-507-6507
>
> > On 07/23/2020 9:38 PM s.an...@gethighavailability.com <
> s.an...@gethighavailability.com> wrote:
> >
> >
> > Hi Thang,
> > Good catch !
> > Can you please let me know if you were starting pm monitoring on a
> component pid, which is in root or non-root?
> >
> > The issue, you are reporting, Thang, may come when Amfnd' (kill) doesn't
> have permission to send signal to the pid.
> > I am assuming that you are getting EPERM as a return.
> > Can you please verify, Thang(by logging, just like done in mon.cc at
> "switch (kill(mon_rec->pid, 0)) {"), if the return is EPERM or something
> else?
> > If it is correct, then ideally, the user shouldn't be using pm
> monitoring on such pid and that means no change is needed in the patch.
> > can you please confirm, Thang.
> >
> > Thanks
> >
> > Anand Sundararaj
> > Senior Solutions Architect | 480 686 4772
> >
> >
> > www.GetHighAvailability.com
> >
> > Get High Availability Today!
> > NJ, USA: +1 508-507-6507
> >
> > > On 07/20/2020 9:11 PM Thang Duc Nguyen 
> wrote:
> > >
> > >
> > > I missed one info.  I tested with NON_ROOT user.
> > > export AMFND_NON_ROOT=1
> > >
> > > -Original Message-
> > > From: Thang Duc Nguyen 
> > > Sent: Tuesday, July 21, 2020 11:02 AM
> > > To: s.an...@gethighavailability.com; Minh Hon Chau <
> minh.c...@dektech.com.au>; nagen...@gethighavailability.com;
> p...@gethighavailability.com
> > > Cc: opensaf-devel@lists.sourceforge.net
> > > Subject: Re: [devel] [PATCH 1/1] amf: remove hard-coding in amfnd
> [#3205]
> > >
> > > Hi Sundararaj,
> > >
> > > The Opensaf can start but it may not run correctly.
> > > I tested your patch. During passive mornitoring process of copoenent,
> this patch cuases the coredump in function avnd_comp_pm_param_val() when
> invoking saAmfPmStop()/saAmfPmStart().
> > >
> > > Snipest code indicate the crash in cpm.cc file void
> avnd_comp_pm_param_val( ) { ...
> > >   if (kill(pm_start->pid, 0) == -1) {
> > > osafassert(errno == ESRCH); //Crash here due to retured error:
> Operation not permitted
> > > *o_amf_rc = SA_AIS_ERR_NOT_EXIST;
> > > return;
> > >   }
> > > }
> > >
> > > B.R/Thang
> > > -Original Message-
> > > From: s.an...@gethighavailability.com 
>
> > > Sent: Tuesday, July 21, 2020 9:22 AM
> > > To: Minh Hon Chau ; Thang Duc Nguyen <
> thang.d.ngu...@dektech.com.au>; nagen...@gethighavailability.com;
> p...@gethighavailability.com
> > > Cc: opensaf-devel@lists.sourceforge.net; Anand Sundararaj <
> s.an...@gethighavailability.com>
> > > Subject: [PATCH 1/1] amf: remove hard-coding in amfnd [#3205]
> > >
> > > From: Anand Sundararaj 
> > >
> > > ---
> > >  src/amf/amfnd/amfnd.conf | 3 +++
> > >  src/amf/amfnd/main.cc| 9 -
> > >  2 fil

Re: [devel] [PATCH 1/1] amf: remove hard-coding in amfnd [#3205]

2020-07-28 Thread Mathi N P
Hi Anand,

For some background, It is not merely a hard coding that you are looking
at, but it is rather by design.
I think you should at the least change the commit message of your patch and
describe the actual change that you are intending to introduce.
FYI,
Mathi.

On Tue, Jul 28, 2020 at 6:01 PM Anand Sundararaj <
s.an...@gethighavailability.com> wrote:

> Hi Minh/Thang/Nagendra/Paul,
> I am planning to push the patch by 30th July(thursday).
> Please kindly find some time to review by 29th July(tomorrow) and
> send your comments or Ack.
>
> Thanks
> Anand Sundararaj
> Senior Solutions Architect | +1 480 686 4772
> www.GetHighAvailability.com (
> https://am2.myprofessionalmail.com/appsuite/www.GetHighAvailability.com)
> Get High Availability Today!
> NJ, USA: +1 508-507-6507
>
> > On 07/23/2020 9:38 PM s.an...@gethighavailability.com <
> s.an...@gethighavailability.com> wrote:
> >
> >
> > Hi Thang,
> > Good catch !
> > Can you please let me know if you were starting pm monitoring on a
> component pid, which is in root or non-root?
> >
> > The issue, you are reporting, Thang, may come when Amfnd' (kill) doesn't
> have permission to send signal to the pid.
> > I am assuming that you are getting EPERM as a return.
> > Can you please verify, Thang(by logging, just like done in mon.cc at
> "switch (kill(mon_rec->pid, 0)) {"), if the return is EPERM or something
> else?
> > If it is correct, then ideally, the user shouldn't be using pm
> monitoring on such pid and that means no change is needed in the patch.
> > can you please confirm, Thang.
> >
> > Thanks
> >
> > Anand Sundararaj
> > Senior Solutions Architect | 480 686 4772
> >
> >
> > www.GetHighAvailability.com
> >
> > Get High Availability Today!
> > NJ, USA: +1 508-507-6507
> >
> > > On 07/20/2020 9:11 PM Thang Duc Nguyen 
> wrote:
> > >
> > >
> > > I missed one info.  I tested with NON_ROOT user.
> > > export AMFND_NON_ROOT=1
> > >
> > > -Original Message-
> > > From: Thang Duc Nguyen 
> > > Sent: Tuesday, July 21, 2020 11:02 AM
> > > To: s.an...@gethighavailability.com; Minh Hon Chau <
> minh.c...@dektech.com.au>; nagen...@gethighavailability.com;
> p...@gethighavailability.com
> > > Cc: opensaf-devel@lists.sourceforge.net
> > > Subject: Re: [devel] [PATCH 1/1] amf: remove hard-coding in amfnd
> [#3205]
> > >
> > > Hi Sundararaj,
> > >
> > > The Opensaf can start but it may not run correctly.
> > > I tested your patch. During passive mornitoring process of copoenent,
> this patch cuases the coredump in function avnd_comp_pm_param_val() when
> invoking saAmfPmStop()/saAmfPmStart().
> > >
> > > Snipest code indicate the crash in cpm.cc file void
> avnd_comp_pm_param_val( ) { ...
> > >   if (kill(pm_start->pid, 0) == -1) {
> > > osafassert(errno == ESRCH); //Crash here due to retured error:
> Operation not permitted
> > > *o_amf_rc = SA_AIS_ERR_NOT_EXIST;
> > > return;
> > >   }
> > > }
> > >
> > > B.R/Thang
> > > -Original Message-
> > > From: s.an...@gethighavailability.com  >
> > > Sent: Tuesday, July 21, 2020 9:22 AM
> > > To: Minh Hon Chau ; Thang Duc Nguyen <
> thang.d.ngu...@dektech.com.au>; nagen...@gethighavailability.com;
> p...@gethighavailability.com
> > > Cc: opensaf-devel@lists.sourceforge.net; Anand Sundararaj <
> s.an...@gethighavailability.com>
> > > Subject: [PATCH 1/1] amf: remove hard-coding in amfnd [#3205]
> > >
> > > From: Anand Sundararaj 
> > >
> > > ---
> > >  src/amf/amfnd/amfnd.conf | 3 +++
> > >  src/amf/amfnd/main.cc| 9 -
> > >  2 files changed, 11 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/src/amf/amfnd/amfnd.conf b/src/amf/amfnd/amfnd.conf index
> 07bc0ba..4e8b07a 100644
> > > --- a/src/amf/amfnd/amfnd.conf
> > > +++ b/src/amf/amfnd/amfnd.conf
> > > @@ -34,3 +34,6 @@ export AVND_PM_MONITORING_RATE=1000  # It can be
> disabled if set THREAD_TRACE_BUFFER as 0, the maximum value  # can be set
> as 65535.
> > >  # export THREAD_TRACE_BUFFER=10240
> > > +
> > > +#AMFND run as root. Uncomment next line to run as a user mentioned in
> nid.conf.
> > > +#export AMFND_NON_ROOT=1
> > > diff --git a/src/amf/amfnd/main.cc b/src/amf/amfnd/main.cc index
> d7857fa..6d9ee95 100644
> > > --- a/src/amf/amfnd/main.cc
> > > +++ b/src/amf/amfnd/main.cc
> > > @@ -164,6 +164,7 @@ static void new_handler() {
> > >
> > >  int main(int argc, char *argv[]) {
> > >uint32_t error;
> > > +  char *val;
> > >
> > >// function to be called if new fails. The alternative of using
> catch of
> > >// std::bad_alloc will unwind the stack and thus no call chain will
> be @@ -179,7 +180,13 @@ int main(int argc, char *argv[]) {
> > >  goto done;
> > >}
> > >
> > > -  daemonize_as_user("root", argc, argv);
> > > +  if ((val = getenv("AMFND_NON_ROOT")) != nullptr) {
> > > +daemonize(argc, argv);
> > > +TRACE("AMFND will run as non-root");  } else {
> > > +daemonize_as_user("root", argc, argv);
> > > +TRACE("AMFND will run as root");
> > > +  }
> > >
> > >

Re: [devel] [PATCH 1/1] amf: remove hard-coding in amfnd [#3205]

2020-07-27 Thread Mathi N P
Hi,

Without getting into the merits of the ticket, I think the headline can be
changed to describe the problem better.
As it stands, it is misleading for a topic such as this.

Cheers,
Mathi.

On Tue, Jul 21, 2020 at 4:41 AM  wrote:

> From: Anand Sundararaj 
>
> ---
>  src/amf/amfnd/amfnd.conf | 3 +++
>  src/amf/amfnd/main.cc| 9 -
>  2 files changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/src/amf/amfnd/amfnd.conf b/src/amf/amfnd/amfnd.conf
> index 07bc0ba..4e8b07a 100644
> --- a/src/amf/amfnd/amfnd.conf
> +++ b/src/amf/amfnd/amfnd.conf
> @@ -34,3 +34,6 @@ export AVND_PM_MONITORING_RATE=1000
>  # It can be disabled if set THREAD_TRACE_BUFFER as 0, the maximum value
>  # can be set as 65535.
>  # export THREAD_TRACE_BUFFER=10240
> +
> +#AMFND run as root. Uncomment next line to run as a user mentioned in
> nid.conf.
> +#export AMFND_NON_ROOT=1
> diff --git a/src/amf/amfnd/main.cc b/src/amf/amfnd/main.cc
> index d7857fa..6d9ee95 100644
> --- a/src/amf/amfnd/main.cc
> +++ b/src/amf/amfnd/main.cc
> @@ -164,6 +164,7 @@ static void new_handler() {
>
>  int main(int argc, char *argv[]) {
>uint32_t error;
> +  char *val;
>
>// function to be called if new fails. The alternative of using catch of
>// std::bad_alloc will unwind the stack and thus no call chain will be
> @@ -179,7 +180,13 @@ int main(int argc, char *argv[]) {
>  goto done;
>}
>
> -  daemonize_as_user("root", argc, argv);
> +  if ((val = getenv("AMFND_NON_ROOT")) != nullptr) {
> +daemonize(argc, argv);
> +TRACE("AMFND will run as non-root");
> +  } else {
> +daemonize_as_user("root", argc, argv);
> +TRACE("AMFND will run as root");
> +  }
>
>// Enable long DN
>if (setenv("SA_ENABLE_EXTENDED_NAMES", "1", 1) != 0) {
> --
> 2.7.4
>
>
>
> ___
> 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/1] base: fix creation of msg queues [#3107]

2020-02-14 Thread Mathi N P
I don't remember if this problem (of /tmp getting cleared up after
sometime) was ever discussed at all.
Ack,
Mathi.

On Thu, Feb 13, 2020 at 2:46 PM Alex Jones  wrote:

> Message queues stop working correctly after queue file is removed from
> /tmp.
>
> Message queue API uses "ftok" which relies on the file being permanent. The
> behaviour is undefined if the file is removed. Many systems clean out /tmp
> periodically, so this can break if the message queue is long lived.
>
> Create the queue file in /var/run.
> ---
> src/base/os_defs.c | 19 +--
> 1 file changed, 17 insertions(+), 2 deletions(-)
>
> diff --git a/src/base/os_defs.c b/src/base/os_defs.c
> index da38cd71c..83458c208 100644
> --- a/src/base/os_defs.c
> +++ b/src/base/os_defs.c
> @@ -55,6 +55,8 @@
> #include "base/osaf_time.h"
> #include "base/logtrace.h"
>
> +#include "osaf/configmake.h"
> +
> NCS_OS_LOCK gl_ncs_atomic_mtx;
> #ifndef NDEBUG
> bool gl_ncs_atomic_mtx_initialise = false;
> @@ -658,7 +660,7 @@ uint32_t ncs_os_posix_mq(NCS_OS_POSIX_MQ_REQ_INFO *req)
>
> memset(, 0, sizeof(struct msqid_ds));
>
> - sprintf(filename, "/tmp/%s%d", req->info.open.qname,
> + sprintf(filename, PKGPIDDIR "/%s%d", req->info.open.qname,
> req->info.open.node);
>
> if (req->info.open.iflags & O_CREAT) {
> @@ -669,6 +671,13 @@ uint32_t ncs_os_posix_mq(NCS_OS_POSIX_MQ_REQ_INFO
> *req)
> return NCSCC_RC_FAILURE;
>
> key = ftok(filename, 1);
> +
> + if (key < 0) {
> + LOG_ER("ftok failed for %s: %i", filename,
> + errno);
> + return NCSCC_RC_FAILURE;
> + }
> +
> os_req.info.create.i_key = 
>
> if (fclose(file) != 0)
> @@ -678,6 +687,12 @@ uint32_t ncs_os_posix_mq(NCS_OS_POSIX_MQ_REQ_INFO
> *req)
> os_req.req = NCS_OS_MQ_REQ_OPEN;
>
> key = ftok(filename, 1);
> +
> + if (key < 0) {
> + LOG_ER("ftok failed for %s: %i", filename,
> + errno);
> + return NCSCC_RC_FAILURE;
> + }
> os_req.info.open.i_key = 
> }
>
> @@ -721,7 +736,7 @@ uint32_t ncs_os_posix_mq(NCS_OS_POSIX_MQ_REQ_INFO *req)
> char filename[264];
>
> memset(filename, 0, sizeof(filename));
> - sprintf(filename, "/tmp/%s%d", req->info.unlink.qname,
> + sprintf(filename, PKGPIDDIR "%s%d", req->info.unlink.qname,
> req->info.unlink.node);
>
> if (unlink(filename) != 0)
> --
> 2.21.1
>
>
> --
> Notice: This e-mail together with any attachments may contain information
> of Ribbon Communications Inc. that is confidential and/or proprietary for
> the sole use of the intended recipient. Any review, disclosure, reliance or
> distribution by others or forwarding without express permission is strictly
> prohibited. If you are not the intended recipient, please notify the sender
> immediately and then delete all copies, including any attachments.
> --
>

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


Re: [devel] [PATCH 2/2] lck: fully support SC absence [#3092]

2020-02-05 Thread Mathi N P
Ack with a comment below:
It is arguable that one second is a big delay interval. How are the other
services handling this?
+ if (error == SA_AIS_ERR_TIMEOUT || error == SA_AIS_ERR_TRY_AGAIN) {
+ redo = true;
+ printf("lockGrantCallbackNoResources received timeout/tryagain\n");
+ sleep(1);

Cheers,
Mathi.

On Mon, Jan 27, 2020 at 5:29 PM Jones, Alex  wrote:

> fix whitespace error
> ---
> src/lck/apitest/test_saLckLimitGet.cc | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/lck/apitest/test_saLckLimitGet.cc
> b/src/lck/apitest/test_saLckLimitGet.cc
> index f3e7bc05d..bb77b696a 100644
> --- a/src/lck/apitest/test_saLckLimitGet.cc
> +++ b/src/lck/apitest/test_saLckLimitGet.cc
> @@ -45,7 +45,7 @@ SaAisErrorT lockResourceOpen(SaLckHandleT lckHandle,
> SaLckResourceHandleT& lockResourceHandle)
> {
> SaAisErrorT rc(SA_AIS_OK);
> -
> +
> while (true) {
> rc = saLckResourceOpen(lckHandle,
> ,
> @@ -68,7 +68,7 @@ SaAisErrorT lockResourceOpenAsync(SaLckHandleT lckHandle,
> SaLckResourceOpenFlagsT flags)
> {
> SaAisErrorT rc(SA_AIS_OK);
> -
> +
> while (true) {
> rc = saLckResourceOpenAsync(lckHandle, invocation, , flags);
>
> --
> 2.21.1
>
>
> --
> Notice: This e-mail together with any attachments may contain information
> of Ribbon Communications Inc. that is confidential and/or proprietary for
> the sole use of the intended recipient. Any review, disclosure, reliance or
> distribution by others or forwarding without express permission is strictly
> prohibited. If you are not the intended recipient, please notify the sender
> immediately and then delete all copies, including any attachments.
> --
>

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


Re: [devel] [PATCH 1/1] lck: fix infinite loop in lcknd when it cannot talk to lckd [#2813]

2020-02-03 Thread Mathi N P
Ack,
Mathi.

On Tue, Jan 28, 2020 at 5:56 PM Jones, Alex  wrote:

> lcknd fails health check and restarts
>
> When lcknd sends resource open requests to lckd it keeps them on a
> list. If the open times out in lcknd because it cannot talk to lckd,
> and the client finalizes or exits, lcknd attempts to clean up these
> outstanding requests. But, it gets into an infinite loop traversing
> the outstanding request list.
>
> Fully traverse the list.
> ---
> src/lck/lckd/gld_rsc.c | 12 ++--
> src/lck/lcknd/glnd_api.c | 2 +-
> src/lck/lcknd/glnd_client.c | 10 ++
> src/lck/lcknd/glnd_res_req.c | 2 ++
> 4 files changed, 15 insertions(+), 11 deletions(-)
>
> diff --git a/src/lck/lckd/gld_rsc.c b/src/lck/lckd/gld_rsc.c
> index 7a45cd716..93a450738 100644
> --- a/src/lck/lckd/gld_rsc.c
> +++ b/src/lck/lckd/gld_rsc.c
> @@ -296,6 +296,7 @@ void gld_free_rsc_info(GLSV_GLD_CB *gld_cb,
> GLSV_GLD_RSC_INFO *rsc_info)
> GLSV_GLD_RSC_MAP_INFO *rsc_map_info = NULL;
> SaNameT lck_name;
> SaNameT immObj_name;
> +SaAisErrorT rc = SA_AIS_OK;
>
> TRACE_ENTER();
>
> @@ -322,12 +323,11 @@ void gld_free_rsc_info(GLSV_GLD_CB *gld_cb,
> GLSV_GLD_RSC_INFO *rsc_info)
> memcpy(_name, _info->lck_name, sizeof(SaNameT));
> /* delete imm runtime object */
> if (gld_cb->ha_state == SA_AMF_HA_ACTIVE) {
> -if (immutil_saImmOiRtObjectDelete(gld_cb->immOiHandle,
> - _name) != SA_AIS_OK) {
> -LOG_ER("Deleting run time object %s FAILED",
> - lck_name.value);
> -TRACE_LEAVE();
> -return;
> +rc = immutil_saImmOiRtObjectDelete(gld_cb->immOiHandle,
> + _name);
> +if (rc != SA_AIS_OK) {
> +LOG_ER("Deleting run time object %s FAILED: %i",
> + lck_name.value, rc);
> }
> }
> rsc_map_info = (GLSV_GLD_RSC_MAP_INFO *)ncs_patricia_tree_get(
> diff --git a/src/lck/lcknd/glnd_api.c b/src/lck/lcknd/glnd_api.c
> index 1801e5e45..55328f9fb 100644
> --- a/src/lck/lcknd/glnd_api.c
> +++ b/src/lck/lcknd/glnd_api.c
> @@ -158,7 +158,7 @@ void glnd_process_mbx(GLND_CB *cb, SYSF_MBX *mbx)
> GLSV_GLND_EVT *evt = NULL;
> TRACE_ENTER();
>
> -while ((evt = (GLSV_GLND_EVT *)m_NCS_IPC_NON_BLK_RECEIVE(mbx, evt))) {
> +if ((evt = (GLSV_GLND_EVT *)m_NCS_IPC_NON_BLK_RECEIVE(mbx, evt))) {
> if ((evt->type >= GLSV_GLND_EVT_BASE) &&
> (evt->type < GLSV_GLND_EVT_MAX)) {
> /* process mail box */
> diff --git a/src/lck/lcknd/glnd_client.c b/src/lck/lcknd/glnd_client.c
> index eead1af2a..906de1408 100644
> --- a/src/lck/lcknd/glnd_client.c
> +++ b/src/lck/lcknd/glnd_client.c
> @@ -283,6 +283,7 @@ uint32_t glnd_client_node_del(GLND_CB *glnd_cb,
> GLND_CLIENT_INFO *client_info)
> {
> GLND_CLIENT_LIST_RESOURCE *res_list, *tmp_res_list;
> GLND_RESOURCE_INFO *res_info;
> +GLND_RESOURCE_REQ_LIST *req_list;
> SaLckLockModeT mode;
> bool orphan = false;
> uint32_t rc = NCSCC_RC_SUCCESS;
> @@ -335,11 +336,12 @@ uint32_t glnd_client_node_del(GLND_CB *glnd_cb,
> GLND_CLIENT_INFO *client_info)
> }
>
> /* free up any stale res_requests from this finalized client ... */
> -while (glnd_cb->res_req_list != NULL) {
> -if (client_info->app_handle_id ==
> - glnd_cb->res_req_list->client_handle_id)
> +for (req_list = glnd_cb->res_req_list; req_list; /*empty*/) {
> +GLND_RESOURCE_REQ_LIST *tmp_req_list = req_list->next;
> +if (client_info->app_handle_id == req_list->client_handle_id)
> glnd_resource_req_node_del(
> - glnd_cb, glnd_cb->res_req_list->res_req_hdl_id);
> + glnd_cb, req_list->res_req_hdl_id);
> +req_list = tmp_req_list;
> }
>
> /* free the memory */
> diff --git a/src/lck/lcknd/glnd_res_req.c b/src/lck/lcknd/glnd_res_req.c
> index b5dede887..95c84e641 100644
> --- a/src/lck/lcknd/glnd_res_req.c
> +++ b/src/lck/lcknd/glnd_res_req.c
> @@ -149,6 +149,7 @@ void glnd_resource_req_node_del(GLND_CB *glnd_cb,
> uint32_t res_req_hdl)
> GLND_RESOURCE_REQ_LIST *res_req_info;
> res_req_info = (GLND_RESOURCE_REQ_LIST *)ncshm_take_hdl(
> NCS_SERVICE_ID_GLND, res_req_hdl);
> +TRACE_ENTER();
>
> if (res_req_info != NULL) {
> /* delete it from the list and return the pointer */
> @@ -169,6 +170,7 @@ void glnd_resource_req_node_del(GLND_CB *glnd_cb,
> uint32_t res_req_hdl)
> /* free the memory */
> m_MMGR_FREE_GLND_RESOURCE_REQ_LIST(res_req_info);
> }
> +TRACE_LEAVE();
> return;
> }
>
> --
> 2.21.1
>
>
> --
> Notice: This e-mail together with any attachments may contain information
> of Ribbon Communications Inc. that is confidential and/or proprietary for
> the sole use of the intended recipient. Any review, disclosure, reliance or
> distribution by others or forwarding without express permission is strictly
> prohibited. If you are not the intended recipient, please notify the sender
> immediately and then delete all copies, including any attachments.
> --
>

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


Re: [devel] [PATCH 2/2] msg: fully support SC absence [#3083]

2019-10-21 Thread Mathi N P
It becomes trickier to handle timeout scenarios within the agent library
threads.
The application designer may not like asserts from OpenSAF library.
Returning an error code (SA_AIS_ERR_NO_RESOURCES) could be an option, but
the error code doesn't accurately reflects the situation if the timeout
occurred because of a transient situation even though the user an decide to
reInitialize the library at a later point of time.
As you mentioned, we should perhaps just revisit this topic if such a
timeout situation arises(at all)...

Ack,
Mathi.

On Tue, Oct 15, 2019 at 8:59 PM Jones, Alex  wrote:

> Hi Mathi,
>
> See my comments inline.
>
> Alex
>
> On 10/15/19 12:45 PM, Mathi N P wrote:
> 
> NOTICE: This email was received from an EXTERNAL sender
> 
>
>
> Hi Alex,
>
> I only have a couple of things to discuss, the rest of the changes are
> fine.
>
> 1) Performing mqa_mds_reregister_queues() in a separate thread(inside the
> application process), iam not yet sure about
> synchronization issues this might throw with the MDS thread
> [Alex] I tried this originally, but this is currently on the mds thread.
> So, because we are using a sync call we can never get the return because we
> are calling this from the mds thread. That's why I created a separate
> thread. I did create a sync with msgnd, so that API calls can only continue
> when we know that msgnd has synced all of its queues with msgd.
> 2) In the below call, there is likelihood of the MDS send timing out
> (extreme case?). Should we handle the timeout error code from the MDS send?
> + /* send the request to the MQND */
> + uint32_t rc(mqa_mds_msg_sync_send(mqa_cb->mqa_mds_hdl,
> + _cb->mqnd_mds_dest,
> + _evt, _evt, MQSV_WAIT_TIME));
> +
> + mqa_cb = m_MQSV_MQA_RETRIEVE_MQA_CB;
> +
> + if (rc != NCSCC_RC_SUCCESS)
> [Alex] How should we handle a timeout? Retry a few times? Assert? I put
> the LOG_ER in there, so we can see if it ever happens, and deal with it at
> that point. I haven't seen this in my testing.
>
> Thanks,
> Mathi.
>
>
> On Thu, Oct 10, 2019 at 6:19 PM Jones, Alex  ajo...@rbbn.com>> wrote:
> Fix whitespace issues
> ---
> src/msg/apitest/test_CapacityThresholds.cc | 2 +-
> src/msg/msgd/mqd_saf.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/msg/apitest/test_CapacityThresholds.cc
> b/src/msg/apitest/test_CapacityThresholds.cc
> index eb5dda1dc..971c8ae90 100644
> --- a/src/msg/apitest/test_CapacityThresholds.cc
> +++ b/src/msg/apitest/test_CapacityThresholds.cc
> @@ -50,7 +50,7 @@ static SaAisErrorT msgInitialize(SaMsgHandleT *msgHandle,
> SaVersionT *version)
> {
> SaAisErrorT rc(SA_AIS_OK);
> -
> +
> while (true) {
> rc = saMsgInitialize(msgHandle, 0, version);
>
> diff --git a/src/msg/msgd/mqd_saf.c b/src/msg/msgd/mqd_saf.c
> index 846755ba7..895a4852d 100644
> --- a/src/msg/msgd/mqd_saf.c
> +++ b/src/msg/msgd/mqd_saf.c
> @@ -64,7 +64,7 @@ static void get_q_groups_from_imm(MQD_CB *pMqd)
> SaVersionT version = { 'A', 2, 15 };
>
> error = immutil_saImmOmInitialize(, 0, );
> -
> +
> if (error != SA_AIS_OK) {
> LOG_ER("saImmOmInitialize failed %u", error);
> break;
> --
> 2.20.1
>
>
> 
> Notice: This e-mail together with any attachments may contain information
> of Ribbon Communications Inc. that is confidential and/or proprietary for
> the sole use of the intended recipient. Any review, disclosure, reliance or
> distribution by others or forwarding without express permission is strictly
> prohibited. If you are not the intended recipient, please notify the sender
> immediately and then delete all copies, including any attachments.
> 
>

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


Re: [devel] [PATCH 2/2] msg: fully support SC absence [#3083]

2019-10-15 Thread Mathi N P
Hi Alex,

I only have a couple of things to discuss, the rest of the changes are fine.

1) Performing mqa_mds_reregister_queues() in a separate thread(inside the
application process), iam not yet sure about
synchronization issues this might throw with the MDS thread
2) In the below call, there is likelihood of the MDS send timing out
(extreme case?). Should we handle the timeout error code from the MDS send?
+ /* send the request to the MQND */
+ uint32_t rc(mqa_mds_msg_sync_send(mqa_cb->mqa_mds_hdl,
+ _cb->mqnd_mds_dest,
+ _evt, _evt, MQSV_WAIT_TIME));
+
+ mqa_cb = m_MQSV_MQA_RETRIEVE_MQA_CB;
+
+ if (rc != NCSCC_RC_SUCCESS)

Thanks,
Mathi.


On Thu, Oct 10, 2019 at 6:19 PM Jones, Alex  wrote:

> Fix whitespace issues
> ---
> src/msg/apitest/test_CapacityThresholds.cc | 2 +-
> src/msg/msgd/mqd_saf.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/msg/apitest/test_CapacityThresholds.cc
> b/src/msg/apitest/test_CapacityThresholds.cc
> index eb5dda1dc..971c8ae90 100644
> --- a/src/msg/apitest/test_CapacityThresholds.cc
> +++ b/src/msg/apitest/test_CapacityThresholds.cc
> @@ -50,7 +50,7 @@ static SaAisErrorT msgInitialize(SaMsgHandleT *msgHandle,
> SaVersionT *version)
> {
> SaAisErrorT rc(SA_AIS_OK);
> -
> +
> while (true) {
> rc = saMsgInitialize(msgHandle, 0, version);
>
> diff --git a/src/msg/msgd/mqd_saf.c b/src/msg/msgd/mqd_saf.c
> index 846755ba7..895a4852d 100644
> --- a/src/msg/msgd/mqd_saf.c
> +++ b/src/msg/msgd/mqd_saf.c
> @@ -64,7 +64,7 @@ static void get_q_groups_from_imm(MQD_CB *pMqd)
> SaVersionT version = { 'A', 2, 15 };
>
> error = immutil_saImmOmInitialize(, 0, );
> -
> +
> if (error != SA_AIS_OK) {
> LOG_ER("saImmOmInitialize failed %u", error);
> break;
> --
> 2.20.1
>
>
> --
> Notice: This e-mail together with any attachments may contain information
> of Ribbon Communications Inc. that is confidential and/or proprietary for
> the sole use of the intended recipient. Any review, disclosure, reliance or
> distribution by others or forwarding without express permission is strictly
> prohibited. If you are not the intended recipient, please notify the sender
> immediately and then delete all copies, including any attachments.
> --
>

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


Re: [devel] [PATCH 1/1] evtd: handle CLM-API errors during SC absence [#3081]

2019-09-10 Thread Mathi N P
About the patch, I have no clue why the indentation looks strange.
I just have a question below, otherwise ack:
+while (true) {
+/* Say Hello */
+rc = saClmInitialize_4(>clm_hdl, _cbk, _version);
+if (rc == SA_AIS_OK)
+break;
+else if (rc == SA_AIS_ERR_TRY_AGAIN ||
+rc == SA_AIS_ERR_UNAVAILABLE) {
+osaf_nanosleep();
+continue;

IMM utils implement a global retry counter. I haven't thought through the
big picture yet, so leaving it to you to decide whether
such a retry counter makes sense here?

Thanks,
Mathi.

On Thu, Sep 5, 2019 at 9:21 PM Jones, Alex  wrote:

> Handle CLM-API errors during SC absence.
> ---
> src/evt/common/edsv_defs.h | 2 +-
> src/evt/evtd/eds_amf.c | 71 ++
> src/evt/evtd/eds_amf.h | 11 --
> src/evt/evtd/eds_cb.c | 6 +++-
> 4 files changed, 72 insertions(+), 18 deletions(-)
>
> diff --git a/src/evt/common/edsv_defs.h b/src/evt/common/edsv_defs.h
> index 8372ce8a8..24604927c 100644
> --- a/src/evt/common/edsv_defs.h
> +++ b/src/evt/common/edsv_defs.h
> @@ -82,7 +82,7 @@
>
> #define m_EDSV_GET_CLM_VER(amf_ver) \
> amf_ver.releaseCode = 'B'; \
> - amf_ver.majorVersion = 0x01; \
> + amf_ver.majorVersion = 0x04; \
> amf_ver.minorVersion = 0x01;
>
> /* Define our limits */
> diff --git a/src/evt/evtd/eds_amf.c b/src/evt/evtd/eds_amf.c
> index fe90a6c62..97b71a5bd 100644
> --- a/src/evt/evtd/eds_amf.c
> +++ b/src/evt/evtd/eds_amf.c
> @@ -26,6 +26,7 @@ DESCRIPTION:
> This include file contains AMF interaction logic for health-check and other
> stuff.
>
> ***/
> +#include "base/osaf_time.h"
> #include "eds.h"
> #include "eds_dl_api.h"
>
> @@ -622,9 +623,9 @@ uint32_t eds_amf_register(EDS_CB *eds_cb)
> SaAisErrorT eds_clm_init(EDS_CB *cb)
> {
> SaVersionT clm_version;
> -SaClmCallbacksT clm_cbk;
> -SaClmClusterNodeT cluster_node;
> -SaClmClusterNotificationBufferT notify_buff;
> +SaClmCallbacksT_4 clm_cbk;
> +SaClmClusterNodeT_4 cluster_node;
> +SaClmClusterNotificationBufferT_4 notify_buff;
> SaAisErrorT rc = SA_AIS_OK;
> SaTimeT timeout = EDSV_CLM_TIMEOUT;
> TRACE_ENTER();
> @@ -639,13 +640,22 @@ SaAisErrorT eds_clm_init(EDS_CB *cb)
> clm_cbk.saClmClusterNodeGetCallback = NULL;
> clm_cbk.saClmClusterTrackCallback = eds_clm_cluster_track_cbk;
>
> -/* Say Hello */
> -rc = saClmInitialize(>clm_hdl, _cbk, _version);
> -if (rc != SA_AIS_OK) {
> -LOG_ER("saClmInitialize failed with error: %d", rc);
> -TRACE_LEAVE();
> -return rc;
> +while (true) {
> +/* Say Hello */
> +rc = saClmInitialize_4(>clm_hdl, _cbk, _version);
> +if (rc == SA_AIS_OK)
> +break;
> +else if (rc == SA_AIS_ERR_TRY_AGAIN ||
> +rc == SA_AIS_ERR_UNAVAILABLE) {
> +osaf_nanosleep();
> +continue;
> +} else {
> +LOG_ER("saClmInitialize_4 failed with error: %d", rc);
> +TRACE_LEAVE();
> +return rc;
> +}
> }
> +
> /* Get the FD */
> if (SA_AIS_OK !=
> (rc = saClmSelectionObjectGet(cb->clm_hdl, >clm_sel_obj))) {
> @@ -654,10 +664,10 @@ SaAisErrorT eds_clm_init(EDS_CB *cb)
> return rc;
> }
> /* Get your own node id */
> -rc = saClmClusterNodeGet(cb->clm_hdl, SA_CLM_LOCAL_NODE_ID, timeout,
> +rc = saClmClusterNodeGet_4(cb->clm_hdl, SA_CLM_LOCAL_NODE_ID, timeout,
> _node);
> if (rc != SA_AIS_OK) {
> -LOG_ER("saClmClusterNodeGet failed with error: %d", rc);
> +LOG_ER("saClmClusterNodeGet_4 failed with error: %d", rc);
> TRACE_LEAVE();
> return rc;
> }
> @@ -665,7 +675,7 @@ SaAisErrorT eds_clm_init(EDS_CB *cb)
> cb->node_id = cluster_node.nodeId;
>
> notify_buff.notification = NULL;
> -rc = saClmClusterTrack(cb->clm_hdl,
> +rc = saClmClusterTrack_4(cb->clm_hdl,
> (SA_TRACK_CURRENT | SA_TRACK_CHANGES), NULL);
> if (rc != SA_AIS_OK)
> LOG_ER("saClmClusterTrack failed with error: %d", rc);
> @@ -674,6 +684,33 @@ SaAisErrorT eds_clm_init(EDS_CB *cb)
> return rc;
> }
>
> +static void * eds_clm_init_thread(void *arg) {
> + TRACE_ENTER();
> + EDS_CB *cb = (EDS_CB *)(arg);
> +
> + eds_clm_init(cb);
> +
> + TRACE_LEAVE();
> + return 0;
> +}
> +
> +SaAisErrorT eds_clm_reinit_bg(EDS_CB *cb)
> +{
> +pthread_t thread;
> +pthread_attr_t attr;
> +pthread_attr_init();
> +pthread_attr_setdetachstate(, PTHREAD_CREATE_DETACHED);
> +
> +if (pthread_create(, , eds_clm_init_thread, cb) != 0) {
> +LOG_ER("pthread_create FAILED: %s", strerror(errno));
> +exit(EXIT_FAILURE);
> +}
> +
> +pthread_attr_destroy();
> +
> +return SA_AIS_OK;
> +}
> +
> /**
> * Function: eds_clm_cluster_track_cbk
> *
> @@ -700,8 +737,14 @@ SaAisErrorT eds_clm_init(EDS_CB *cb)
> **/
>
> void eds_clm_cluster_track_cbk(
> - const SaClmClusterNotificationBufferT *notificationBuffer,
> - SaUint32T numberOfMembers, SaAisErrorT error)
> +const SaClmClusterNotificationBufferT_4 *notificationBuffer,
> +SaUint32T numberOfMembers,
> +SaInvocationT invocation,
> +const SaNameT *rootCauseEntity,
> +const SaNtfCorrelationIdsT *correlationIds,
> 

Re: [devel] [PATCH 1/1] plm: add support for HE alarms [#3027]

2019-04-09 Thread Mathi N P
ACK,
And, back then, i remember arguing with some developers in PLM against use
of comparisons where constants are placed in the leftside of a comparison,
except maybe when
comparing against NULL.

Mathi.



On Thu, Apr 4, 2019 at 10:55 PM Jones, Alex  wrote:

> This ticket adds support for implementing sections 3.1.3.5 and 6.2.1.1 of
> the PLM spec. For now this support is only for threshold sensors.
> ---
> src/plm/common/plms_hsm.c | 80 ++
> src/plm/common/plms_notifications.h | 2 +-
> src/plm/plmd/plms_he_pres_fsm.c | 101 +++-
> src/plm/plmd/plms_notifications.c | 24 +--
> 4 files changed, 200 insertions(+), 7 deletions(-)
>
> diff --git a/src/plm/common/plms_hsm.c b/src/plm/common/plms_hsm.c
> index f8f7b6275..fe53f2fbd 100644
> --- a/src/plm/common/plms_hsm.c
> +++ b/src/plm/common/plms_hsm.c
> @@ -99,6 +99,8 @@ static SaUint32T hsm_send_hotswap_event(SaHpiRptEntryT
> *rpt_entry,
> SaUint32T retriev_idr_info);
> static SaUint32T hsm_send_resource_event(const SaHpiRptEntryT *rpt_entry,
> const SaHpiEventT *event);
> +static SaUint32T hsm_send_sensor_event(const SaHpiRptEntryT *rpt_entry,
> + const SaHpiEventT *event);
> SaUint32T hsm_correct_length(SaHpiIdrFieldT *thisfield);
> SaUint32T hsm_get_idr_info(SaHpiRptEntryT *rpt_entry, PLMS_INV_DATA
> *inv_data);
> static SaUint32T hsm_get_idr_product_info(SaHpiRptEntryT *rpt_entry,
> @@ -766,6 +768,8 @@ static void *plms_hsm(void)
> SAHPI_ENTITY_PRESENCE will be generated, send the status after
> upgrade to check that the state has not changed */
> if (event.EventType == SAHPI_ET_SENSOR) {
> + hsm_send_sensor_event(_entry, );
> +
> if (event.EventDataUnion.SensorEvent.SensorType ==
> SAHPI_ENTITY_PRESENCE) {
> hsm_send_hotswap_event(
> @@ -1313,6 +1317,82 @@ static SaUint32T hsm_send_resource_event(const
> SaHpiRptEntryT *rpt_entry,
> return rc;
> }
>
> +/**
> +* @brief Sends resource event to PLM main thread
> +*
> +*
> +* @param[in] rpt_entry
> +* @param[in] retriev_idr_info
> +*
> +* @return NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE
> +***/
> +static SaUint32T hsm_send_sensor_event(const SaHpiRptEntryT *rpt_entry,
> + const SaHpiEventT *event)
> +{
> + PLMS_CB *cb = plms_cb;
> + PLMS_EVT *plms_evt = NULL;
> + PLMS_EVT_REQ req_evt;
> + SaHpiEntityPathT entity_path;
> + SaInt8T *entity_path_str = NULL;
> + SaUint32T i, rc;
> +
> + TRACE_ENTER();
> +
> + if (NULL == rpt_entry) {
> + LOG_ER("Invalid rpt_entry");
> + return NCSCC_RC_FAILURE;
> + }
> +
> + /* Get the entity path */
> + memset(_path, 0, sizeof(SaHpiEntityPathT));
> + for (i = 0; i < SAHPI_MAX_ENTITY_PATH; i++) {
> + entity_path.Entry[i] = rpt_entry->ResourceEntity.Entry[i];
> +
> + /* Stop copying when we see SAHPI_ENT_ROOT */
> + if (rpt_entry->ResourceEntity.Entry[i].EntityType ==
> + SAHPI_ENT_ROOT)
> + break;
> + }
> +
> + memset(_evt, 0, sizeof(PLMS_EVT_REQ));
> +
> + req_evt.req_type = PLMS_HPI_EVT_T;
> + req_evt.hpi_evt.sa_hpi_evt = *event;
> +
> + /* convert SaHpiEntityPathT to string format */
> + rc = convert_entitypath_to_string(_path, _path_str);
> + if (NCSCC_RC_FAILURE == rc) {
> + /* Log */
> + return NCSCC_RC_FAILURE;
> + }
> + req_evt.hpi_evt.entity_path = entity_path_str;
> +
> + /* Copy entity key to req_evt*/
> + memcpy(_evt.hpi_evt.epath_key, _path, sizeof(entity_path));
> +
> + plms_evt = (PLMS_EVT *)malloc(sizeof(PLMS_EVT));
> + if (NULL == plms_evt) {
> + LOG_ER("Memory allocation failed ret:%s", strerror(errno));
> + assert(0);
> + }
> + memset(plms_evt, 0, sizeof(PLMS_EVT));
> + plms_evt->req_res = PLMS_REQ;
> + plms_evt->req_evt = req_evt;
> +
> + TRACE("Sending Sensor_event for res:%u entity:%s Sensor Num:%u \n",
> + rpt_entry->ResourceId, entity_path_str,
> + event->EventDataUnion.SensorEvent.SensorNum);
> +
> + /* post event to PLM mailbox */
> + rc = m_NCS_IPC_SEND(>mbx, (NCSCONTEXT)plms_evt,
> + MDS_SEND_PRIORITY_MEDIUM);
> + if (rc != NCSCC_RC_SUCCESS)
> + LOG_ER("m_NCS_IPC_SEND failed error %u", rc);
> +
> + TRACE_LEAVE();
> + return rc;
> +}
> +
> /***
> * @brief This function retrieves Inventory Data Record (IDR) for
> * the given resource
> diff --git a/src/plm/common/plms_notifications.h
> b/src/plm/common/plms_notifications.h
> index 03cba1088..ea2929d6b 100644
> --- a/src/plm/common/plms_notifications.h
> +++ b/src/plm/common/plms_notifications.h
> @@ -45,7 +45,7 @@ SaAisErrorT plms_hpi_evt_ntf_send(SaNtfHandleT
> plm_ntf_hdl, SaNameT *object,
> SaAisErrorT plms_alarm_ntf_send(SaNtfHandleT plm_ntf_hdl, SaNameT *object,
> SaUint32T event_type, SaInt8T *entity_path,
> SaUint32T severity, SaUint32T cause,
> - SaUint32T minor_id,
> + SaUint32T minor_id, SaTimeT timestamp,
> SaUint16T no_of_corr_notifications,
> SaNtfIdentifierT *corr_ids,
> SaNtfIdentifierT *ntf_id);
> diff --git a/src/plm/plmd/plms_he_pres_fsm.c
> 

Re: [devel] [PATCH 1/1] evt: resurrect apitests v2 [#2974]

2019-01-10 Thread Mathi N P
Ack,
Mathi.

On Tue, Dec 18, 2018 at 11:48 AM Mohan Kanakam  wrote:

> ---
>  opensaf.spec.in |   1 +
>  src/evt/Makefile.am |  17 ++
>  src/evt/apitest/Makefile|  20 +++
>  src/evt/apitest/evttest.c   |  44 +
>  src/evt/apitest/tet_eda.c   | 320
> ++--
>  src/evt/apitest/tet_eda.h   |  23 ++-
>  src/evt/apitest/tet_edsv_func.c |  54 ++
>  src/evt/apitest/tet_edsv_util.c | 201 +-
>  src/evt/apitest/tet_edsv_wrappers.c |  19 ++-
>  9 files changed, 522 insertions(+), 177 deletions(-)
>  create mode 100644 src/evt/apitest/Makefile
>  create mode 100644 src/evt/apitest/evttest.c
>
> diff --git a/opensaf.spec.in b/opensaf.spec.in
> index 5ae2070..b7c37d9 100644
> --- a/opensaf.spec.in
> +++ b/opensaf.spec.in
> @@ -1533,6 +1533,7 @@ fi
>  %{_bindir}/clmtest
>  %{_bindir}/mdstest
>  %{_bindir}/amftest
> +%{_bindir}/evttest
>  %if %is_ais_smf
>  #SMF: Demo and test of CCB handling
>  %{_bindir}/ccbdemo_create
> diff --git a/src/evt/Makefile.am b/src/evt/Makefile.am
> index 0c36ea6..819bab8 100644
> --- a/src/evt/Makefile.am
> +++ b/src/evt/Makefile.am
> @@ -137,9 +137,26 @@ bin_osafevtd_LDADD = \
>
>  if ENABLE_TESTS
>
> +bin_evttest_CPPFLAGS = \
> +   $(AM_CPPFLAGS)
> +
> +bin_PROGRAMS += bin/evttest
> +
>  noinst_HEADERS += \
> src/evt/apitest/tet_eda.h
>
> +bin_evttest_SOURCES = \
> +  src/evt/apitest/tet_edsv_wrappers.c \
> +  src/evt/apitest/tet_eda.c \
> +  src/evt/apitest/tet_edsv_func.c \
> +  src/evt/apitest/tet_edsv_util.c \
> +  src/evt/apitest/evttest.c
> +
> +bin_evttest_LDADD = \
> +  lib/libSaEvt.la \
> +  lib/libopensaf_core.la \
> +  lib/libapitest.la
> +
>  endif
>
>  endif
> diff --git a/src/evt/apitest/Makefile b/src/evt/apitest/Makefile
> new file mode 100644
> index 000..561fe8b
> --- /dev/null
> +++ b/src/evt/apitest/Makefile
> @@ -0,0 +1,20 @@
> +#  -*- OpenSAF  -*-
> +#
> +#(C) Copyright 2017 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): High Availability Solutions
> +#
> +#
> +
> +all:
> +   $(MAKE) -C ../../.. bin/evttest
> +
> diff --git a/src/evt/apitest/evttest.c b/src/evt/apitest/evttest.c
> new file mode 100644
> index 000..3712b3e
> --- /dev/null
> +++ b/src/evt/apitest/evttest.c
> @@ -0,0 +1,44 @@
> +/*  -*- OpenSAF  -*-
> + *
> + * (C) Copyright 2017 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): High Availability Solutions
> + *
> + */
> +
> +#include 
> +#include 
> +#include "osaf/apitest/utest.h"
> +#include "osaf/apitest/util.h"
> +
> +int main(int argc, char **argv)
> +{
> +   int suite = ALL_SUITES, tcase = ALL_TESTS;
> +
> +   srandom(getpid());
> +
> +   if (argc > 1) {
> +   suite = atoi(argv[1]);
> +   }
> +
> +   if (argc > 2) {
> +   tcase = atoi(argv[2]);
> +   }
> +
> +   if (suite == 0) {
> +   test_list();
> +   return 0;
> +   }
> +
> +   return test_run(suite, tcase);
> +}
> +
> diff --git a/src/evt/apitest/tet_eda.c b/src/evt/apitest/tet_eda.c
> index bfd9d2e..4c551df 100644
> --- a/src/evt/apitest/tet_eda.c
> +++ b/src/evt/apitest/tet_eda.c
> @@ -1,7 +1,7 @@
> +#include 
>  #include 
> -#include "tet_api.h"
> -#include "tet_startup.h"
>  #include "tet_eda.h"
> +#include "osaf/apitest/utest.h"
>  void tet_edsv_startup(void);
>  void tet_edsv_cleanup(void);
>
> @@ -55,6 +55,7 @@ void tet_saEvtInitializeCases(int iOption)
> gl_rc = saEvtInitialize(NULL, _evtCallbacks,
> _version);
> result("saEvtInitialize() with NULL event handle",
>SA_AIS_ERR_INVALID_PARAM);
> +   rc_validate(gl_rc, SA_AIS_ERR_INVALID_PARAM);
> break;
>
> case 2:
> @@ -65,7 +66,7 @@ void tet_saEvtInitializeCases(int iOption)
> gl_rc = saEvtInitialize(_evtHandle, NULL, _version);
> 

Re: [devel] [PATCH 1/1] evt: resurrect apitests [#2974]

2018-12-17 Thread Mathi N P
Hi,

A couple of comments:

1) Is the redefinition of ncs_task_release necessary? It's already defined
in sysf_tsk.c?
+#define m_NCS_TASK_RELEASE(t_handle) ncs_task_release(t_handle)
...
+
+uint32_t ncs_task_release(void *task_handle)
+{
+   NCS_OS_TASK task;
+   memset(, 0, sizeof(task));
+
+   if (task_handle == NULL)
+   return NCSCC_RC_SUCCESS;
+
+   task.info.release.i_handle = task_handle;
+
+   return m_NCS_OS_TASK(, NCS_OS_TASK_RELEASE);
+}
+

2) The indentation in tet_eda.c and evttest.c are different.

Thanks,
Mathi.

On Mon, Nov 26, 2018 at 9:27 AM Mohan Kanakam  wrote:

> ---
>  opensaf.spec.in |   1 +
>  src/evt/Makefile.am |  17 ++
>  src/evt/apitest/Makefile|  20 +++
>  src/evt/apitest/evttest.c   |  44 +
>  src/evt/apitest/tet_eda.c   | 335
> +++-
>  src/evt/apitest/tet_eda.h   |  22 ++-
>  src/evt/apitest/tet_edsv_func.c |  54 ++
>  src/evt/apitest/tet_edsv_util.c | 201 +-
>  src/evt/apitest/tet_edsv_wrappers.c |  62 ++-
>  9 files changed, 579 insertions(+), 177 deletions(-)
>  create mode 100644 src/evt/apitest/Makefile
>  create mode 100644 src/evt/apitest/evttest.c
>
> diff --git a/opensaf.spec.in b/opensaf.spec.in
> index 5ae2070..b7c37d9 100644
> --- a/opensaf.spec.in
> +++ b/opensaf.spec.in
> @@ -1533,6 +1533,7 @@ fi
>  %{_bindir}/clmtest
>  %{_bindir}/mdstest
>  %{_bindir}/amftest
> +%{_bindir}/evttest
>  %if %is_ais_smf
>  #SMF: Demo and test of CCB handling
>  %{_bindir}/ccbdemo_create
> diff --git a/src/evt/Makefile.am b/src/evt/Makefile.am
> index 0c36ea6..819bab8 100644
> --- a/src/evt/Makefile.am
> +++ b/src/evt/Makefile.am
> @@ -137,9 +137,26 @@ bin_osafevtd_LDADD = \
>
>  if ENABLE_TESTS
>
> +bin_evttest_CPPFLAGS = \
> +   $(AM_CPPFLAGS)
> +
> +bin_PROGRAMS += bin/evttest
> +
>  noinst_HEADERS += \
> src/evt/apitest/tet_eda.h
>
> +bin_evttest_SOURCES = \
> +  src/evt/apitest/tet_edsv_wrappers.c \
> +  src/evt/apitest/tet_eda.c \
> +  src/evt/apitest/tet_edsv_func.c \
> +  src/evt/apitest/tet_edsv_util.c \
> +  src/evt/apitest/evttest.c
> +
> +bin_evttest_LDADD = \
> +  lib/libSaEvt.la \
> +  lib/libopensaf_core.la \
> +  lib/libapitest.la
> +
>  endif
>
>  endif
> diff --git a/src/evt/apitest/Makefile b/src/evt/apitest/Makefile
> new file mode 100644
> index 000..561fe8b
> --- /dev/null
> +++ b/src/evt/apitest/Makefile
> @@ -0,0 +1,20 @@
> +#  -*- OpenSAF  -*-
> +#
> +#(C) Copyright 2017 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): High Availability Solutions
> +#
> +#
> +
> +all:
> +   $(MAKE) -C ../../.. bin/evttest
> +
> diff --git a/src/evt/apitest/evttest.c b/src/evt/apitest/evttest.c
> new file mode 100644
> index 000..180539a
> --- /dev/null
> +++ b/src/evt/apitest/evttest.c
> @@ -0,0 +1,44 @@
> +/*  -*- OpenSAF  -*-
> + *
> + * (C) Copyright 2017 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): High Availability Solutions
> + *
> + */
> +
> +#include 
> +#include 
> +#include "osaf/apitest/utest.h"
> +#include "osaf/apitest/util.h"
> +
> +int main(int argc, char **argv)
> +{
> +  int suite = ALL_SUITES, tcase = ALL_TESTS;
> +
> +  srandom(getpid());
> +
> +  if (argc > 1) {
> +suite = atoi(argv[1]);
> +  }
> +
> +  if (argc > 2) {
> +tcase = atoi(argv[2]);
> +  }
> +
> +  if (suite == 0) {
> +test_list();
> +return 0;
> +  }
> +
> +  return test_run(suite, tcase);
> +}
> +
> diff --git a/src/evt/apitest/tet_eda.c b/src/evt/apitest/tet_eda.c
> index bfd9d2e..7629cb9 100644
> --- a/src/evt/apitest/tet_eda.c
> +++ b/src/evt/apitest/tet_eda.c
> @@ -1,13 +1,28 @@
> +#include 
>  #include 
> -#include "tet_api.h"
> -#include "tet_startup.h"
>  #include "tet_eda.h"
> +#include "osaf/apitest/utest.h"
> +#define m_NCS_TASK_RELEASE(t_handle) ncs_task_release(t_handle)
>  void tet_edsv_startup(void);
>  void 

Re: [devel] [PATCH 0/1] Review Request for evt: resurrect apitests [#2974]

2018-12-13 Thread Mathi N P
Hi,

I will revert back by 18th.
Thanks,
Mathi.

On Tue, Dec 11, 2018 at 7:04 AM  wrote:

> Hi Mathi, hans,
> Polite remainder for review.
>
>
> Thanks
> Mohan
> High Availability Solutions Pvt. Ltd.
> www.hasolutions.in
>
>
>
> - Original Message -
> Subject: [PATCH 0/1] Review Request for evt: resurrect apitests [#2974]
> From: "Mohan Kanakam" 
> Date: 11/26/18 1:55 pm
> To: mathi.np@gmail.com, hans.nordeb...@ericsson.com
> Cc: opensaf-devel@lists.sourceforge.net, "Mohan Kanakam" <
> mo...@hasolutions.in>
>
> Summary: evt: resurrect apitests [#2974]
> Review request for Ticket(s): 2974
> Peer Reviewer(s): mathi, hans
> Pull request to: *** LIST THE PERSON WITH PUSH ACCESS HERE ***
> Affected branch(es): develop
> Development branch: ticket-2974
> Base revision: 72ff674dea7f796b8d957ed7ecaccb0d404f6360
> Personal repository: git://git.code.sf.net/u/mohan-hasoln/review
>
> 
> Impacted area Impact y/n
> 
> Docs n
> Build system n
> RPM/packaging n
> Configuration files n
> Startup scripts n
> SAF services n
> OpenSAF services n
> Core libraries n
> Samples n
> Tests y
> Other n
>
>
> Comments (indicate scope for each "y" above):
> -
> Resurrect apitests
>
> revision 55a0f051418350a5392f328fd35cf1237add96c8
> Author: Mohan Kanakam 
> Date: Mon, 26 Nov 2018 13:11:49 +0530
>
> evt: resurrect apitests [#2974]
>
>
>
> Added Files:
> 
> src/evt/apitest/evttest.c
> src/evt/apitest/Makefile
>
>
> Complete diffstat:
> --
> opensaf.spec.in | 1 +
> src/evt/Makefile.am | 17 ++
> src/evt/apitest/Makefile | 20 +++
> src/evt/apitest/evttest.c | 44 +
> src/evt/apitest/tet_eda.c | 335 +++-
> src/evt/apitest/tet_eda.h | 22 ++-
> src/evt/apitest/tet_edsv_func.c | 54 ++
> src/evt/apitest/tet_edsv_util.c | 201 +-
> src/evt/apitest/tet_edsv_wrappers.c | 62 ++-
> 9 files changed, 579 insertions(+), 177 deletions(-)
>
>
> Testing Commands:
> -
> ./evttest
>
> Testing, Expected Results:
> --
> All tests were passed.
>
> Conditions of Submission:
> -
> Ack from maintainers
>
> Arch Built Started Linux distro
> ---
> mips n 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 ~/.gitconfig file (i.e. user.name,
> user.email etc)
>
> ___ Your computer have a badly configured date and time; confusing the
> the threaded patch review.
>
> ___ Your changes affect IPC mechanism, and you don't present any results
> for in-service upgradability test.
>
> ___ Your changes affect user manual and documentation, your patch series
> do not contain the patch that updates the Doxygen manual.
>
>

___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net

Re: [devel] [PATCH 1/1] plmd: correct null pointer issues when deleting plm entities [#209]

2018-09-26 Thread Mathi N P
Hi,

Ack from me after the following comment is fixed.
As a general guideline, *please avoid* modifying the copyright part of the
code. The 'authors' may be edited if any significant architectural/design
changes are made to the OpenSAF services.

Thanks,
Mathi.


On Tue, Sep 25, 2018 at 2:03 PM Meenakshi TK 
wrote:

> ---
>  src/plm/plmd/plms_imm.c | 11 ---
>  1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/src/plm/plmd/plms_imm.c b/src/plm/plmd/plms_imm.c
> index 9fbba6c..bfdba45 100644
> --- a/src/plm/plmd/plms_imm.c
> +++ b/src/plm/plmd/plms_imm.c
> @@ -12,7 +12,7 @@
>   * licensing terms.
>   *
>   * Author(s): Emerson Network Power
> - *
> + *High Availability Solutions Pvt Ltd
>   */
>
>
>  
> /*
> @@ -600,10 +600,10 @@ void plms_modify_objects(SaInt32T obj_type, SaNameT
> *obj_name,
>  }
>  static void plms_delete_objects(SaInt32T obj_type, SaNameT *obj_name)
>  {
> -   PLMS_GROUP_ENTITY *child_list, *temp;
> +   PLMS_GROUP_ENTITY *child_list = NULL, *temp;
> PLMS_ENTITY *plm_ent, *parent, *tmp;
> SaUint32T rc;
> -   TRACE_ENTER();
> +   TRACE_ENTER2("%s", obj_name->value);
> switch (obj_type) {
> case PLMS_HE_OBJ_TYPE:
> case PLMS_EE_OBJ_TYPE:
> @@ -612,6 +612,10 @@ static void plms_delete_objects(SaInt32T obj_type,
> SaNameT *obj_name)
> _cb->entity_info, (SaUint8T *)obj_name);
> /* No need to check if plm_ent is null */
> /* Update the parent/child relationship */
> +   if (plm_ent == NULL) {
> +   TRACE_2("%s not found", obj_name->value);
> +   goto end;
> +   }
> parent = plm_ent->parent;
> if (parent == NULL) {
> /* Parent is domain object */
> @@ -686,6 +690,7 @@ static void plms_delete_objects(SaInt32T obj_type,
> SaNameT *obj_name)
> plms_delete_vm_obj(obj_name);
> break;
> }
> +end:
> TRACE_LEAVE();
>  }
>  static SaAisErrorT plms_imm_ccb_obj_create_cbk(SaImmOiHandleT imm_oi_hdl,
> --
> 2.7.4
>
>

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


Re: [devel] [PATCH 1/1] plm: fix build to determine location and name of systemd library [#2931]

2018-09-25 Thread Mathi N P
Ack,
Mathi.

On Mon, Sep 24, 2018 at 10:21 PM Jones, Alex  wrote:

> plmcd does not build on Fedora 27. This may occur on other distros, too.
> CCLD bin/plmcd
> CXXLD lib/libosaf_common.la
> CXXLD lib/libimmpbe_dump.la
> /usr/bin/ld: cannot find -lsystemd-daemon
> collect2: error: ld returned 1 exit status
> make[2]: *** [Makefile:11016: bin/plmcd] Error 1
>
> The systemd library is hardcoded in src/plm/Makefile.am
>
> It should be determined via pkg-config.
> ---
>  configure.ac| 3 +++
>  src/plm/Makefile.am | 2 +-
>  2 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/configure.ac b/configure.ac
> index 1011d9544..4f770e95c 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -533,6 +533,7 @@ PKG_CHECK_MODULES([XML2], [libxml-2.0])
>  if test "$enable_ais_plm" = yes; then
>  PKG_CHECK_MODULES([HPI], [openhpi])
>  PKG_CHECK_MODULES([LIBVIRT], [libvirt])
> +PKG_CHECK_MODULES([LIBSYSTEMD], [libsystemd])
>
>  if test "$with_hpi_interface" = check; then
> if test "$cross_compiling" = no; then
> @@ -697,6 +698,8 @@ if test "$enable_ais_plm" = yes; then
>  echo "${ECHO_T}  HPI_LIBS: ${HPI_LIBS}"
>  echo "${ECHO_T}  LIBVIRT_CFLAGS: ${LIBVIRT_CFLAGS}"
>  echo "${ECHO_T}  LIBVIRT_LIBS: ${LIBVIRT_LIBS}"
> +echo "${ECHO_T}  SYSTEMD_CFLAGS: ${LIBSYSTEMD_CFLAGS}"
> +echo "${ECHO_T}  SYSTEMD_LIBS: ${LIBSYSTEMD_LIBS}"
>  fi
>
>  if test "$enable_imm_pbe" = yes; then
> diff --git a/src/plm/Makefile.am b/src/plm/Makefile.am
> index 581cb17c4..2416fab81 100644
> --- a/src/plm/Makefile.am
> +++ b/src/plm/Makefile.am
> @@ -282,7 +282,7 @@ dist_systemd_DATA += \
> src/plm/plmcd/plmcboot.service \
> src/plm/plmcd/plmcd.service
>
> -bin_plmcd_LDFLAGS += -lsystemd-daemon
> +bin_plmcd_LDFLAGS += @LIBSYSTEMD_LIBS@
>
>  else
>
> --
> 2.14.4
>
>

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


Re: [devel] [PATCH 1/1] plmd: cleanup current admin operation on EE if EE uninstantiates [#198]

2018-09-24 Thread Mathi N P
Perhaps this part can moved into to a separate function.
Ack,
Mathi.

On Tue, Sep 18, 2018 at 4:43 PM Jones, Alex  wrote:

> Application can receive START step after responding to VALIDATE step after
> EE has uninstantiated.
>
> Ongoing admin operations are not cleaned up after EE uninstantiates.
>
> Clean up ongoing admin operations and tracking when an EE uninstantiates.
> ---
>  src/plm/plmd/plms_plmc.c | 42 ++
>  1 file changed, 42 insertions(+)
>
> diff --git a/src/plm/plmd/plms_plmc.c b/src/plm/plmd/plms_plmc.c
> index cf8687219..566f4559b 100644
> --- a/src/plm/plmd/plms_plmc.c
> +++ b/src/plm/plmd/plms_plmc.c
> @@ -645,6 +645,48 @@ SaUint32T
> plms_plmc_tcp_disconnect_process(PLMS_ENTITY *ent)
>
> } else { /* If the entity is in insvc, then got to make the entity
>   to move to OOS.*/
> +   if (ent->adm_op_in_progress &&
> +   ent->adm_op_in_progress !=
> SA_PLM_CAUSE_EE_RESTART) {
> +   PLMS_CB *cb = plms_cb;
> +
> +   /*
> +* clean up the current admin op since we are
> about to
> +* go OOS
> +*/
> +   ret_err = saImmOiAdminOperationResult(
> +   cb->oi_hdl, ent->trk_info->inv_id,
> SA_AIS_OK);
> +   if (NCSCC_RC_SUCCESS != ret_err) {
> +   LOG_ER("Sending admin response to IMM
> failed. "
> +   "IMM Ret code: %d",
> +   ret_err);
> +   }
> +
> +   PLMS_ENTITY_GROUP_INFO_LIST *head =
> +   ent->trk_info->group_info_list;
> +   while (head) {
> +   plms_inv_to_cbk_in_grp_trk_rmv(
> +   head->ent_grp_inf,
> +   ent->trk_info);
> +   head = head->next;
> +   }
> +
> +   plms_trk_info_free(ent->trk_info);
> +   ent->trk_info = 0;
> +
> +   if (ent->adm_op_in_progress ==
> SA_PLM_CAUSE_SHUTDOWN ||
> +   ent->adm_op_in_progress ==
> SA_PLM_CAUSE_LOCK)
> +   {
> +   plms_admin_state_set(ent,
> +   SA_PLM_EE_ADMIN_LOCKED,
> +   NULL,
> +   SA_NTF_OBJECT_OPERATION,
> +
>  SA_PLM_NTFID_STATE_CHANGE_ROOT);
> +   }
> +
> +   ent->adm_op_in_progress = false;
> +   ent->am_i_aff_ent = false;
> +   }
> +
> /* Get all the affected entities.*/
> plms_affected_ent_list_get(ent, _ent_list, 0);
>
> --
> 2.14.4
>
>

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


Re: [devel] [PATCH 1/1] uml: add support for plm to run under uml [#2922]

2018-09-18 Thread Mathi N P
Good work. A very nice value add for PLM users.

Mathi.

On Tue, Sep 18, 2018 at 9:22 AM Hans Nordebäck 
wrote:

> ack, review only. (Run ok with the legacy uml without plm enabled).
>
> Minor comment, the function cmd_build/install_container_testprog() is
> part of ticket #70?
>
> /BR HansN
>
> On 09/17/2018 09:53 PM, Alex Jones wrote:
> > Add support for plm to run under uml.
> > ---
> >   src/plm/config/openhpi.conf| 18 
> >   tools/cluster_sim_uml/archive/scripts/40opensaf.rc | 30 +++
> >   tools/cluster_sim_uml/build_uml| 95
> --
> >   3 files changed, 138 insertions(+), 5 deletions(-)
> >   create mode 100644 src/plm/config/openhpi.conf
> >
> > diff --git a/src/plm/config/openhpi.conf b/src/plm/config/openhpi.conf
> > new file mode 100644
> > index 0..b811de134
> > --- /dev/null
> > +++ b/src/plm/config/openhpi.conf
> > @@ -0,0 +1,18 @@
> > +OPENHPI_AUTOINSERT_TIMEOUT = 50
> > +OPENHPI_AUTOINSERT_TIMEOUT_READONLY = "NO"
> > +
> > +# Section for dynamic_simulator plugin
> > +handler libdyn_simulator {
> > +entity_root = "{ADVANCEDTCA_CHASSIS,2}"
> > +# Location of the simulation data file
> > +# Normally an example file is installed in the same directory as
> openhpi.conf.
> > +# Please change the following entry if you have configured another
> install
> > +# directory or will use your own simulation.data.
> > +file = "/etc/openhpi/opensaf-plm-sim.txt"
> > +# infos goes to logfile and stdout
> > +# the logfile are log00.log, log01.log ...
> > +#logflags = "file stdout"
> > +#logfile = "dynsim"
> > +# if #logfile_max reached replace the oldest one
> > +#logfile_max = "5"
> > +}
> > diff --git a/tools/cluster_sim_uml/archive/scripts/40opensaf.rc
> b/tools/cluster_sim_uml/archive/scripts/40opensaf.rc
> > index 7df4cfee6..9057d680b 100644
> > --- a/tools/cluster_sim_uml/archive/scripts/40opensaf.rc
> > +++ b/tools/cluster_sim_uml/archive/scripts/40opensaf.rc
> > @@ -76,4 +76,34 @@ echo "$node_name" > /etc/opensaf/node_name
> >   echo "/tmp/core_%t_%e_%p" > /proc/sys/kernel/core_pattern
> >   ulimit -c unlimited
> >
> > +if test -e /etc/plmcd.conf; then
> > +sc_1_ip=$(grep "SC-1" /etc/hosts | cut -d' ' -f 1)
> > +sc_2_ip=$(grep "SC-2" /etc/hosts | cut -d' ' -f 1)
> > +if [ "$node_name" == "SC-1" ]; then
> > +  ee="Linux_os_hosting_clm_node,safHE=f120_slot_1"
> > +  path="my_entity =
> \"{ADVANCEDTCA_CHASSIS,2}{PHYSICAL_SLOT,1}{SWITCH_BLADE,0}\""
> > +elif [ "$node_name" == "SC-2" ]; then
> > +  ee="Linux_os_hosting_clm_node,safHE=f120_slot_16"
> > +  path="my_entity =
> \"{ADVANCEDTCA_CHASSIS,2}{PHYSICAL_SLOT,16}{SWITCH_BLADE,0}\""
> > +else
> > +  ee="$node_name"
> > +fi
> > +sed -i -e "s/10.105.1.3/$sc_1_ip/" \
> > +-e "s/10.105.1.6/$sc_2_ip/" \
> > +-e "s/0020f/safEE=$ee,safDomain=domain_1/" \
> > +-e "s/1;os;Fedora;2.6.31/1;os;SUSE;2.6/" \
> > +-e "/^\/etc\/init.d/s/^/#/" \
> > +/etc/plmcd.conf
> > +cp /etc/openhpi/openhpi.conf /var/opt
> > +chmod go-rwx /var/opt/openhpi.conf
> > +echo "$path" > /etc/openhpi/openhpiclient.conf
> > +
> > +/usr/sbin/openhpid -c /var/opt/openhpi.conf
> > +
> > +# wait for hpi to read in hardware info
> > +sleep 10
> > +
> > +/usr/local/sbin/plmcd&
> > +fi
> > +
> >   /etc/init.d/opensafd start&
> > diff --git a/tools/cluster_sim_uml/build_uml
> b/tools/cluster_sim_uml/build_uml
> > index 16d49d03e..e54e45753 100755
> > --- a/tools/cluster_sim_uml/build_uml
> > +++ b/tools/cluster_sim_uml/build_uml
> > @@ -121,6 +121,73 @@ cmd_install_testprog() {
> >   cmd_mkcpio
> >   }
> >
> > +cmd_build_container_testprog() {
> > +src=$opensaf_home/samples/amf/container
> > +libd=$root/usr/local/$lib_dir
> > +installd=$root/opt/amf_demo
> > +
> > +mkdir -p "$installd"
> > +cp $src/amf_container_script $installd
> > +gcc -g -O2 -Wall -fPIC -I$opensaf_home/src/amf/saf \
> > +   -I$opensaf_home/src/ais/include \
> > +   -DSA_EXTENDED_NAME_SOURCE \
> > +   -o $installd/amf_container_demo $src/amf_container_demo.c \
> > +   -Wl,--as-needed "-Wl,-rpath-link,$libd:$libd/opensaf" "-L$libd"
> -lSaAmf -lopensaf_core
> > +
> > +echo "Creating [$root/root.cpio] ..."
> > +cmd_mkcpio
> > +}
> > +
> > +##   install_container_testprog
> > +## Build and install the AMF container demo program.
> > +##
> > +cmd_install_container_testprog() {
> > +src=$opensaf_home/samples/amf/container
> > +libd=$root/usr/local/$lib_dir
> > +installd=$root/opt/amf_demo
> > +immxml=$root/etc/opensaf/imm.xml
> > +containedXml=$src/AppConfig-contained-2N.xml
> > +containerXml=$src/AppConfig-container.xml
> > +
> > +mkdir -p $installd
> > +cp $src/amf_container_script $installd
> > +gcc -g -O2 -Wall -fPIC -I$opensaf_home/src/amf/saf \
> > +   

Re: [devel] [PATCH 1/1] plmd: fix adding and removing of invocation id to list [#197]

2018-09-18 Thread Mathi N P
Ack, Not tested.
Mathi.

On Fri, Sep 14, 2018 at 3:33 PM Alex Jones  wrote:

> Jan 22 11:09:03 localhost osafplmd[3988]: Invocation id mentioned in the
> resp, is not found in the grp->inocation_list. inv_id: 9
>
> If multiple entities are part of the same entity group, and START or
> VALIDATE
> tracking is requested, if an admin operation is done on these entities,
> once
> one response is sent the other responses are ignored. But, the entities
> that
> didn't return a successful response all report "Admin operation can not be
> performed" because they failed to process the tracking response. This is
> because when the first invocation id is removed from the list, all the
> others
> are removed, too. Now those entities are stuck in this bad state.
>
> Fix the remove routines so that only the invocation in the response is
> removed from the list.
> ---
>  src/plm/plmd/plms_utils.c | 54
> ---
>  1 file changed, 28 insertions(+), 26 deletions(-)
>
> diff --git a/src/plm/plmd/plms_utils.c b/src/plm/plmd/plms_utils.c
> index 5637cdf08..5dbfdb28a 100644
> --- a/src/plm/plmd/plms_utils.c
> +++ b/src/plm/plmd/plms_utils.c
> @@ -1516,21 +1516,22 @@ void
> plms_inv_to_trk_grp_add(PLMS_INVOCATION_TO_TRACK_INFO **list,
>  void plms_inv_to_cbk_in_grp_trk_rmv(PLMS_ENTITY_GROUP_INFO *grp,
> PLMS_TRACK_INFO *trk_info)
>  {
> -   PLMS_INVOCATION_TO_TRACK_INFO **inv_list, **prev;
> -
> -   inv_list = &(grp->invocation_list);
> -   prev = &(grp->invocation_list);
> -   while (*inv_list) {
> -   if (trk_info == (*inv_list)->track_info) {
> -   (*prev)->next = (*inv_list)->next;
> -   (*inv_list)->track_info = NULL;
> -   (*inv_list)->next = NULL;
> -   free(*inv_list);
> -   *inv_list = NULL;
> +   PLMS_INVOCATION_TO_TRACK_INFO *inv_list, *prev;
> +
> +   inv_list = grp->invocation_list;
> +   prev = grp->invocation_list;
> +   while (inv_list) {
> +   if (trk_info == inv_list->track_info) {
> +   if (prev == inv_list) {
> +   /* this is the first entry */
> +   grp->invocation_list = inv_list->next;
> +   }
> +   prev->next = inv_list->next;
> +   free(inv_list);
> return;
> }
> -   *prev = *inv_list;
> -   *inv_list = (*inv_list)->next;
> +   prev = inv_list;
> +   inv_list = inv_list->next;
> }
>
> return;
> @@ -1545,21 +1546,22 @@ void
> plms_inv_to_cbk_in_grp_trk_rmv(PLMS_ENTITY_GROUP_INFO *grp,
>  void plms_inv_to_cbk_in_grp_inv_rmv(PLMS_ENTITY_GROUP_INFO *grp,
> SaInvocationT inv_id)
>  {
> -   PLMS_INVOCATION_TO_TRACK_INFO **inv_list, **prev;
> -
> -   inv_list = &(grp->invocation_list);
> -   prev = &(grp->invocation_list);
> -   while (*inv_list) {
> -   if (inv_id == (*inv_list)->invocation) {
> -   (*prev)->next = (*inv_list)->next;
> -   (*inv_list)->track_info = NULL;
> -   (*inv_list)->next = NULL;
> -   free(*inv_list);
> -   *inv_list = NULL;
> +   PLMS_INVOCATION_TO_TRACK_INFO *inv_list, *prev;
> +
> +   inv_list = grp->invocation_list;
> +   prev = grp->invocation_list;
> +   while (inv_list) {
> +   if (inv_id == inv_list->invocation) {
> +   if (prev == inv_list) {
> +   /* this is the first entry */
> +   grp->invocation_list = inv_list->next;
> +   }
> +   prev->next = inv_list->next;
> +   free(inv_list);
> return;
> }
> -   *prev = *inv_list;
> -   *inv_list = (*inv_list)->next;
> +   prev = inv_list;
> +   inv_list = inv_list->next;
> }
>
> return;
> --
> 2.14.4
>
>

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


Re: [devel] [PATCH 1/1] plm: fix return codes for saPlmReadinessTrackResponse [#200]

2018-09-13 Thread Mathi N P
ACK,

Mathi.

On Fri, Sep 7, 2018 at 3:44 PM Alex Jones  wrote:

> saPlmReadinessTrackResponse sometimes returns SA_AIS_OK, when invalid
> parameters are passed.
>
> SaPlmReadinessTrackResponseT parameter is not checked for range. Also,
> the msg is sent asynchronously from the agent to plmd, so that errors
> from plmd cannot be passed back to the agent.
>
> Check the SaPlmReadinessTrackResponseT parameter when passed in, and
> change the message from asynch to sync, so that errors can be passed
> back.
> ---
>  src/plm/agent/plma_api.c   | 29 ++---
>  src/plm/common/plms_common_utils.c |  1 +
>  src/plm/common/plms_edu.c  |  1 +
>  src/plm/common/plms_evt.h  |  3 ++-
>  src/plm/plmd/plms_adm_fsm.c| 52
> --
>  5 files changed, 62 insertions(+), 24 deletions(-)
>
> diff --git a/src/plm/agent/plma_api.c b/src/plm/agent/plma_api.c
> index 596175e51..3ca8a8c71 100644
> --- a/src/plm/agent/plma_api.c
> +++ b/src/plm/agent/plma_api.c
> @@ -2974,6 +2974,7 @@ SaAisErrorT
> saPlmReadinessTrackResponse(SaPlmEntityGroupHandleT entityGrpHdl,
>  {
> PLMA_CB *plma_cb = plma_ctrlblk;
> PLMS_EVT plm_in_evt;
> +   PLMS_EVT *plm_out_res = NULL;
> SaAisErrorT rc = SA_AIS_OK;
> uint32_t proc_rc = NCSCC_RC_SUCCESS;
> PLMA_ENTITY_GROUP_INFO *group_info;
> @@ -2994,6 +2995,12 @@ SaAisErrorT
> saPlmReadinessTrackResponse(SaPlmEntityGroupHandleT entityGrpHdl,
> rc = SA_AIS_ERR_INVALID_PARAM;
> goto end;
> }
> +   if (response < SA_PLM_CALLBACK_RESPONSE_OK ||
> +response > SA_PLM_CALLBACK_RESPONSE_ERROR) {
> +   TRACE("response parameter is invalid");
> +   rc = SA_AIS_ERR_INVALID_PARAM;
> +   goto end;
> +   }
> if (!plma_cb->plms_svc_up) {
> LOG_ER("PLMA : PLM SERVICE DOWN");
> rc = SA_AIS_ERR_TRY_AGAIN;
> @@ -3027,10 +3034,10 @@ SaAisErrorT
> saPlmReadinessTrackResponse(SaPlmEntityGroupHandleT entityGrpHdl,
> plm_in_evt.req_evt.agent_track.track_cbk_res.invocation_id =
> invocation;
> plm_in_evt.req_evt.agent_track.track_cbk_res.response = response;
>
> -   /* Send a mds async msg to PLMS to obtain group handle for this */
> -   proc_rc = plms_mds_normal_send(plma_cb->mds_hdl,
> NCSMDS_SVC_ID_PLMA,
> -  _in_evt, plma_cb->plms_mdest_id,
> -  NCSMDS_SVC_ID_PLMS);
> +   proc_rc = plm_mds_msg_sync_send(plma_cb->mds_hdl,
> NCSMDS_SVC_ID_PLMA,
> +   NCSMDS_SVC_ID_PLMS,
> +   plma_cb->plms_mdest_id,
> _in_evt,
> +   _out_res, PLMS_MDS_SYNC_TIME);
>
> if (NCSCC_RC_SUCCESS != proc_rc) {
> LOG_ER(
> @@ -3038,7 +3045,21 @@ SaAisErrorT
> saPlmReadinessTrackResponse(SaPlmEntityGroupHandleT entityGrpHdl,
> rc = SA_AIS_ERR_TRY_AGAIN;
> goto end;
> }
> +
> +   /* Verify if the response if ok */
> +   if (!plm_out_res) {
> +   rc = SA_AIS_ERR_TRY_AGAIN;
> +   goto end;
> +   }
> +   if (plm_out_res->res_evt.error != SA_AIS_OK) {
> +   rc = plm_out_res->res_evt.error;
> +   goto end;
> +   }
> +
>  end:
> +   if (plm_out_res)
> +   plms_free_evt(plm_out_res);
> +
> TRACE_LEAVE();
> return rc;
>  }
> diff --git a/src/plm/common/plms_common_utils.c
> b/src/plm/common/plms_common_utils.c
> index c56093747..9837b8480 100644
> --- a/src/plm/common/plms_common_utils.c
> +++ b/src/plm/common/plms_common_utils.c
> @@ -148,6 +148,7 @@ SaUint32T plms_free_evt(PLMS_EVT *evt)
> case PLMS_AGENT_GRP_DEL_RES:
> case PLMS_AGENT_TRACK_START_RES:
> case PLMS_AGENT_TRACK_STOP_RES:
> +   case PLMS_AGENT_TRACK_RESP_RES:
> free(evt);
> break;
> case PLMS_AGENT_TRACK_READINESS_IMPACT_RES:
> diff --git a/src/plm/common/plms_edu.c b/src/plm/common/plms_edu.c
> index 1b0a2a8ec..d5f445cb4 100644
> --- a/src/plm/common/plms_edu.c
> +++ b/src/plm/common/plms_edu.c
> @@ -717,6 +717,7 @@ uint32_t plms_evt_test_res_type(NCSCONTEXT arg)
> case PLMS_AGENT_GRP_ADD_RES:
> case PLMS_AGENT_GRP_DEL_RES:
> case PLMS_AGENT_TRACK_STOP_RES:
> +   case PLMS_AGENT_TRACK_RESP_RES:
> case PLMS_AGENT_TRACK_READINESS_IMPACT_RES:
> return PLMS_EDU_PLMS_COMMON_RESP;
> ;
> diff --git a/src/plm/common/plms_evt.h b/src/plm/common/plms_evt.h
> index e87c6325e..557579968 100644
> --- a/src/plm/common/plms_evt.h
> +++ b/src/plm/common/plms_evt.h
> @@ -245,7 +245,8 @@ typedef enum {
>PLMS_AGENT_GRP_DEL_RES,
>PLMS_AGENT_TRACK_START_RES,
>PLMS_AGENT_TRACK_STOP_RES,
> -  

Re: [devel] [PATCH 1/1] clmd: clear admin_op and stat_change for COMPLETED plm readiness cb [#2847]

2018-05-07 Thread Mathi N P
Ack.
I would suggest(up to you) 'switchover', failover tests too after running
the adminop test.
Mathi.

On Thu, May 3, 2018 at 5:30 PM, Alex Jones  wrote:

> Sometimes CLM will reboot a node which was locked with PLM admin command.
>
> admin_op and stat_change are not being cleared in COMPLETED step in PLM
> readiness callback.
>
> Clear admin_op and stat_change.
> ---
>  src/clm/clmd/clms.h   |  2 +-
>  src/clm/clmd/clms_plm.cc  |  7 +++
>  src/clm/clmd/clms_util.cc | 12 ++--
>  3 files changed, 10 insertions(+), 11 deletions(-)
>
> diff --git a/src/clm/clmd/clms.h b/src/clm/clmd/clms.h
> index 1d9c8daf1..f7384aad0 100644
> --- a/src/clm/clmd/clms.h
> +++ b/src/clm/clmd/clms.h
> @@ -100,7 +100,7 @@ extern uint32_t clms_mds_msg_bcast(CLMS_CB *cb,
> CLMSV_MSG *bcast_msg);
>  extern SaAisErrorT clms_imm_activate(CLMS_CB *cb);
>  extern uint32_t clms_node_trackresplist_empty(CLMS_CLUSTER_NODE
> *op_node);
>  extern uint32_t clms_send_cbk_start_sub(CLMS_CB *cb, CLMS_CLUSTER_NODE
> *node);
> -extern void clms_clear_node_dep_list(CLMS_CLUSTER_NODE *node);
> +extern void clms_clear_node_dep_list(CLMS_CLUSTER_NODE *node, bool
> checkpoint);
>  extern uint32_t clms_client_del_trackresp(SaUint32T client_id);
>  extern CLMS_CLUSTER_NODE *clms_node_get_by_name(const SaNameT *name);
>  extern CLMS_CLUSTER_NODE *clms_node_getnext_by_name(const SaNameT *name);
> diff --git a/src/clm/clmd/clms_plm.cc b/src/clm/clmd/clms_plm.cc
> index 9c3076aa9..1ca1e1c66 100644
> --- a/src/clm/clmd/clms_plm.cc
> +++ b/src/clm/clmd/clms_plm.cc
> @@ -79,7 +79,7 @@ static void clms_plm_readiness_track_callback(
>   step completed will come and we need to clear node
>   list as we dont no the order of entity coming from
>   plm, better to remove dependency list on each node */
> -  clms_clear_node_dep_list(node);
> +  clms_clear_node_dep_list(node, true);
>
>if (node->nodeup &&
>trackedEntities->entities[i].expectedReadinessStatus.readinessState
> ==
> @@ -278,9 +278,8 @@ static void clms_plm_readiness_track_callback(
>   * Don't checkpoint if this is COMPLETED and nodeup is 0. Node
>   * has already been removed from standby.
>   */
> -if (step != SA_PLM_CHANGE_COMPLETED || node->nodeup) {
> -  clms_clear_node_dep_list(node);
> -}
> +clms_clear_node_dep_list(node,
> + step != SA_PLM_CHANGE_COMPLETED ||
> node->nodeup);
>  if (step == SA_PLM_CHANGE_COMPLETED) {
>if (node->stat_change == SA_TRUE) {
>  if ((node->disable_reboot == SA_FALSE) &&
> diff --git a/src/clm/clmd/clms_util.cc b/src/clm/clmd/clms_util.cc
> index dde88788e..4b2dd19e2 100644
> --- a/src/clm/clmd/clms_util.cc
> +++ b/src/clm/clmd/clms_util.cc
> @@ -601,18 +601,18 @@ done:
>  /**
>   * Clear the node dependency list,made for multiple nodes in the plm
> callback
>   */
> -void clms_clear_node_dep_list(CLMS_CLUSTER_NODE *node) {
> +void clms_clear_node_dep_list(CLMS_CLUSTER_NODE *node, bool checkpoint) {
>CLMS_CLUSTER_NODE *new_node = nullptr;
>
>node->admin_op = ADMIN_OP{};
>node->stat_change = SA_FALSE;
> -  ckpt_node_rec(node);
> +  if (checkpoint) ckpt_node_rec(node);
>while (node->dep_node_list != nullptr) {
>  new_node = node->dep_node_list;
>  new_node->stat_change = SA_FALSE;
>  new_node->admin_op = ADMIN_OP{};
>  new_node->change = SA_CLM_NODE_NO_CHANGE;
> -ckpt_node_rec(new_node);
> +if (checkpoint) ckpt_node_rec(new_node);
>  node->dep_node_list = node->dep_node_list->next;
>  new_node->next = nullptr;
>}
> @@ -670,7 +670,7 @@ uint32_t clms_clmresp_rejected(CLMS_CB *cb,
> CLMS_CLUSTER_NODE *node,
>CLMS_CLIENT_INFO *client = nullptr;
>SaAisErrorT ais_er;
>
> -  clms_clear_node_dep_list(node);
> +  clms_clear_node_dep_list(node, true);
>client = clms_client_get_by_id(trk->client_id);
>if (client != nullptr) {
>  if (client->track_flags & SA_TRACK_VALIDATE_STEP) {
> @@ -775,7 +775,7 @@ uint32_t clms_clmresp_error(CLMS_CB *cb,
> CLMS_CLUSTER_NODE *node) {
>  #ifdef ENABLE_AIS_PLM
>SaAisErrorT ais_er = SA_AIS_OK;
>
> -  clms_clear_node_dep_list(node);
> +  clms_clear_node_dep_list(node, true);
>ais_er = saPlmReadinessTrackResponse(cb->ent_group_hdl,
> node->plm_invid,
> SA_PLM_CALLBACK_RESPONSE_
> ERROR);
>if (ais_er != SA_AIS_OK) {
> @@ -856,7 +856,7 @@ uint32_t clms_clmresp_ok(CLMS_CB *cb,
> CLMS_CLUSTER_NODE *op_node,
>
>  if (ncs_patricia_tree_size(_node->trackresp) == 0) {
>/*Clear the node dependency list */
> -  clms_clear_node_dep_list(op_node);
> +  clms_clear_node_dep_list(op_node, true);
>ais_er = saPlmReadinessTrackResponse(
>cb->ent_group_hdl, op_node->plm_invid,
> SA_PLM_CALLBACK_RESPONSE_OK);
>if (ais_er != SA_AIS_OK) {
> --
> 2.13.6
>
>

Re: [devel] [PATCH 1/1] fmd: fix regression interacting with PLM [#2844]

2018-05-02 Thread Mathi N P
Ack,
Mathi.

On Mon, Apr 30, 2018 at 5:15 PM, Alex Jones  wrote:

> fmd does not pass the EE to opensaf_reboot when attempting to reset the
> peer.
>
> The legacy code passed 0 to fm_mds_async_send. The new code passes
> NCSMDS_SCOPE_NONE, but doesn't update how bcast_scope is used.
>
> Change fm_mds_async_send to check bcast_scope. If it is not
> NCSMDS_SCOPE_NONE,
> then use it. Otherwise, use the MDS dest.
> ---
>  src/fm/fmd/fm_mds.cc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/fm/fmd/fm_mds.cc b/src/fm/fmd/fm_mds.cc
> index 60db5dab1..c5b3581ee 100644
> --- a/src/fm/fmd/fm_mds.cc
> +++ b/src/fm/fmd/fm_mds.cc
> @@ -763,7 +763,7 @@ uint32_t fm_mds_async_send(FM_CB *fm_cb, NCSCONTEXT
> msg, NCSMDS_SVC_ID svc_id,
>
>  memset(&(info.info.svc_send.info.snd.i_to_dest), 0,
> sizeof(MDS_DEST));
>
> -if (bcast_scope) {
> +if (bcast_scope != NCSMDS_SCOPE_NONE) {
>info.info.svc_send.info.bcast.i_bcast_scope = bcast_scope;
>  } else {
>info.info.svc_send.info.snd.i_to_dest = i_to_dest;
> --
> 2.13.6
>
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1/1] plmd: handle admin-operation-pending for EE unlock [#2819]

2018-03-28 Thread Mathi N P
Ack,
Mathi.

On Mon, Mar 26, 2018 at 5:47 PM, Alex Jones  wrote:

> If EE unlock fails, it is never retried when management is regained. The EE
> just sits in LOCKED admin state.
>
> If EE unlock fails, the code continues as if it did succeed, setting
> readiness
> state to in-service, etc.
>
> If EE unlock fails, just return ERR_DEPLOYMENT immediately, and don't set
> anything else.
> ---
>  src/plm/plmd/plms_adm_fsm.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/src/plm/plmd/plms_adm_fsm.c b/src/plm/plmd/plms_adm_fsm.c
> index 370c30f36..fdcd6ea05 100644
> --- a/src/plm/plmd/plms_adm_fsm.c
> +++ b/src/plm/plmd/plms_adm_fsm.c
> @@ -4437,10 +4437,9 @@ static SaUint32T plms_ent_unlock(PLMS_ENTITY *ent,
> PLMS_TRACK_INFO *trk_info,
> /* Unlock the EE.*/
> unlck_err = plms_ee_unlock(ent, true, 1 /*mngt_cbk*/);
> if (NCSCC_RC_SUCCESS != unlck_err) {
> -   /* TODO: Should I return from here, sending
> failure to
> -   IMM and calling management lost callback.*/
> LOG_ER("EE unlock operation failed. Ent: %s",
>ent->dn_name_str);
> +   goto send_rsp;
> }
> }
>
> @@ -4548,6 +4547,8 @@ static SaUint32T plms_ent_unlock(PLMS_ENTITY *ent,
> PLMS_TRACK_INFO *trk_info,
>
> plms_ent_exp_rdness_status_clear(ent);
> plms_aff_ent_exp_rdness_status_clear(trk_info->aff_ent_list);
> +
> +send_rsp:
> /* Respnd to IMM.*/
> if (NCSCC_RC_SUCCESS == unlck_err) {
> ret_err = saImmOiAdminOperationResult(cb->oi_hdl,
> adm_op.inv_id,
> --
> 2.13.6
>
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 0/8] Review Request for osaf: Use Node ID instead of slot and subslot to identify a node [#2742]

2018-01-09 Thread Mathi N P
This is a good change, long pending.
The patches look okay. Iam thinking about in-service upgradeability of
especially IMM(FEVS) and CKPT!

Cheers,
Mathi.

On Thu, Dec 21, 2017 at 11:25 AM, Anders Widell 
wrote:

> Summary: ckpt: Use Node ID instead of slot and subslot to identify a node
> [#2742]
> Review request for Ticket(s): 2742
> Peer Reviewer(s): Ravi, Alex
> Pull request to:
> Affected branch(es): develop
> Development branch: ticket-2742
> Base revision: ec8a376bdeb75f0ba0d418ba7d9e8f16958b34c3
> Personal repository: git://git.code.sf.net/u/anders-w/review
>
> 
> Impacted area   Impact y/n
> 
>  Docsn
>  Build systemn
>  RPM/packaging   n
>  Configuration files y
>  Startup scripts n
>  SAF servicesy
>  OpenSAF servicesy
>  Core libraries  y
>  Samples n
>  Tests   n
>  Other   n
>
> NOTE: Patch(es) contain lines longer than 80 characers
>
> Comments (indicate scope for each "y" above):
> -
>
> We move towards a flat addressing scheme by using Node ID instead of the
> legacy
> slot-id and subslot-id to identify nodes in the cluster.
>
> revision 80a9c99e61bb5fd0ba9be11b8dbbd883e679ebf2
> Author: Anders Widell 
> Date:   Thu, 21 Dec 2017 11:15:30 +0100
>
> fm: Remove code dealing with slot and subslot [#2742]
>
>
>
> revision 0ab57addc962c020627936ddee759ec1319bfcb7
> Author: Anders Widell 
> Date:   Thu, 21 Dec 2017 11:15:30 +0100
>
> base: Remove code dealing with slot and subslot [#2742]
>
>
>
> revision 6bb8114d64b1d1c1f2568e947c78c4afaa1c15e7
> Author: Anders Widell 
> Date:   Thu, 21 Dec 2017 11:15:30 +0100
>
> plm: Use Node ID instead of slot and subslot to identify a node [#2742]
>
>
>
> revision fd7ddf09b1f8f7f6a9c706a170e0f330d3457274
> Author: Anders Widell 
> Date:   Thu, 21 Dec 2017 11:15:30 +0100
>
> msg: Use Node ID instead of slot and subslot to identify a node [#2742]
>
>
>
> revision d19633d8d62f53bb1b6e3b335688659710e8c701
> Author: Anders Widell 
> Date:   Thu, 21 Dec 2017 11:15:21 +0100
>
> msg: Convert MSG agent to C++ [#2742]
>
>
>
> revision ec64728f54cdb26d8d3f39f3fb668ccc5512d43a
> Author: Anders Widell 
> Date:   Thu, 21 Dec 2017 11:12:34 +0100
>
> imm: Use Node ID instead of slot and subslot to identify a node [#2742]
>
>
>
> revision aaa9ac98f1ff9f12f1d3da00f29c6e2546e56cef
> Author: Anders Widell 
> Date:   Thu, 21 Dec 2017 11:12:34 +0100
>
> mds: Use Node ID instead of slot and subslot to identify a node [#2742]
>
>
>
> revision d258476c6b5295d09bb2705fe25900a32c751b85
> Author: Anders Widell 
> Date:   Thu, 21 Dec 2017 11:12:34 +0100
>
> ckpt: Use Node ID instead of slot and subslot to identify a node [#2742]
>
>
>
> Complete diffstat:
> --
>  src/base/ncs_main_papi.h|   8 -
>  src/base/ncsgl_defs.h   |   7 -
>  src/ckpt/ckptd/cpd_cb.h |  14 +-
>  src/ckpt/ckptd/cpd_db.c |  22 +--
>  src/ckpt/ckptd/cpd_evt.c|  66 
>  src/ckpt/ckptd/cpd_mds.c|   6 +-
>  src/ckpt/ckptd/cpd_proc.c   |  44 ++---
>  src/ckpt/ckptd/cpd_proc.h   |   3 +-
>  src/ckpt/ckptd/cpd_sbevt.c  |   4 +-
>  src/ckpt/ckptnd/cpnd_cb.h   |  13 +-
>  src/ckpt/ckptnd/cpnd_db.c   |  19 +--
>  src/ckpt/ckptnd/cpnd_init.h |   3 +-
>  src/ckpt/ckptnd/cpnd_mds.c  |  32 ++--
>  src/ckpt/ckptnd/cpnd_proc.c |  16 +-
>  src/fm/fmd/fm_mds.c |   2 +-
>  src/fm/fmd/fmd.conf |   6 -
>  src/imm/immd/immd_cb.h  |   4 +-
>  src/imm/immd/immd_db.c  |  21 +--
>  src/imm/immd/immd_evt.c |  32 ++--
>  src/imm/immd/immd_mds.c |   3 +-
>  src/imm/immd/immd_proc.c|   9 +-
>  src/imm/immd/immd_proc.h|   3 +-
>  src/imm/immnd/immnd_mds.c   |   2 +-
>  src/mds/mds_c_db.c  |  21 ++-
>  src/mds/mds_dt2c.h  |   2 +-
>  src/mds/mds_dt_tcp.h|   2 +-
>  src/mds/mds_papi.h  |   4 +-
>  src/msg/Makefile.am |  10 +-
>  src/msg/agent/{mqa_api.c => mqa_api.cc} | 241
> ++--
>  src/msg/agent/{mqa_clbk.c => mqa_clbk.cc}   |  38 +++--
>  src/msg/agent/mqa_db.h  |   4 +-
>  src/msg/agent/mqa_def.h |  13 +-
>  

[devel] Test mail. please ignore.

2018-01-04 Thread Mathi N P

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1/1] plm: handle race condition for EE instantiation [#2514]

2018-01-04 Thread Mathi N P
It might be good to make this timeout value configurable in the plm*.conf
file.

Ack,
Mathi.


On Tue, Jan 2, 2018 at 4:53 PM, Alex Jones  wrote:

> Child EE which is a controller can get shutdown because its parent EE
> (host)
> has not connected to PLM, yet.
>
> If the controller is a VM, and the host is a payload, there is a race
> condition when instantiating the EEs. If the host doesn't connect to PLM
> first, then when the controller EE (child of host EE) connects to PLM, it
> see that the host isn't instantiated, and shuts itself down.
>
> If the controller child EE instantiates before the host has connected to
> PLM,
> set a 20 second timer. If the host doesn't instantiate within this time,
> then
> all child EEs will be shut down.
> ---
>  src/plm/common/plms_evt.h |  3 +-
>  src/plm/plmd/plms_plmc.c  | 79 ++
> +
>  src/plm/plmd/plms_utils.c | 11 ++-
>  3 files changed, 91 insertions(+), 2 deletions(-)
>
> diff --git a/src/plm/common/plms_evt.h b/src/plm/common/plms_evt.h
> index 43f4748..e87c632 100644
> --- a/src/plm/common/plms_evt.h
> +++ b/src/plm/common/plms_evt.h
> @@ -98,7 +98,8 @@ typedef enum {
>  typedef enum {
>PLMS_TMR_NONE,
>PLMS_TMR_EE_INSTANTIATING,
> -  PLMS_TMR_EE_TERMINATING
> +  PLMS_TMR_EE_TERMINATING,
> +  PLMS_TMR_EE_HOST_INSTANTIATED
>  } PLMS_TMR_EVT_TYPE;
>
>  typedef struct plms_imm_admin_op {
> diff --git a/src/plm/plmd/plms_plmc.c b/src/plm/plmd/plms_plmc.c
> index 06c8d4b..c310a86 100644
> --- a/src/plm/plmd/plms_plmc.c
> +++ b/src/plm/plmd/plms_plmc.c
> @@ -50,6 +50,8 @@ static SaUint32T 
> plms_os_info_resp_mngt_flag_clear(PLMS_ENTITY
> *);
>  static void plms_insted_dep_immi_failure_cbk_call(PLMS_ENTITY *,
>   PLMS_GROUP_ENTITY *);
>  static void plms_is_dep_set_cbk_call(PLMS_ENTITY *);
> +
> +static void plms_ee_stop_host_timer(PLMS_ENTITY *);
>  /***
> ***
>  @brief : Process instantiating event from PLMC.
>   1. Do the OS verification irrespective of previous state.
> @@ -346,6 +348,7 @@ SaUint32T plms_plmc_tcp_connect_process(PLMS_ENTITY
> *ent)
> if ((SA_PLM_EE_ADMIN_LOCKED_INSTANTIATION ==
>  ent->entity.ee_entity.saPlmEEAdminState) ||
> ((NULL != ent->parent) &&
> +   ent->parent->entity_type != PLMS_EE_ENTITY &&
>  (plms_is_rdness_state_set(ent->parent,
>SA_PLM_READINESS_OUT_OF_SERVICE)))
> ||
> (!plms_min_dep_is_ok(ent))) {
> @@ -379,6 +382,19 @@ SaUint32T plms_plmc_tcp_connect_process(PLMS_ENTITY
> *ent)
> return NCSCC_RC_FAILURE;
> }
>
> +   if (ent->parent && ent->parent->entity_type == PLMS_EE_ENTITY &&
> +   plms_is_rdness_state_set(ent->parent,
> SA_PLM_READINESS_OUT_OF_SERVICE)) {
> +   LOG_IN("host EE not instantiated yet: starting timer");
> +   ent->tmr.tmr_type = PLMS_TMR_EE_HOST_INSTANTIATED;
> +   ret_err = plms_timer_start(>tmr.timer_id,
> +   ent,
> +   SA_TIME_ONE_SECOND * 20);
> +   if (ret_err != NCSCC_RC_SUCCESS) {
> +   LOG_ER("failed to start host EE instantiated
> timer");
> +   return ret_err;
> +   }
> +   }
> +
> if (plms_is_rdness_state_set(ent, SA_PLM_READINESS_IN_SERVICE)) {
> TRACE("Ent %s is already in insvc.", ent->dn_name_str);
> return NCSCC_RC_SUCCESS;
> @@ -532,6 +548,13 @@ SaUint32T plms_plmc_tcp_connect_process(PLMS_ENTITY
> *ent)
> ret_err = plms_plmc_unlck_insvc(ent, trk_info,
> aff_ent_list_flag, is_set);
> }
> +
> +   /* If this is a host EE, stop timer for all child EEs */
> +if (ret_err == NCSCC_RC_SUCCESS && ent->entity_type ==
> PLMS_EE_ENTITY &&
> +   ent->leftmost_child) {
> +   plms_ee_stop_host_timer(ent->leftmost_child);
> +}
> +
> TRACE_LEAVE2("Return Val: %d", ret_err);
> return ret_err;
>  }
> @@ -1052,6 +1075,12 @@ SaUint32T plms_plmc_get_os_info_response(PLMS_ENTITY
> *ent,
> to insvc.*/
> ret_err = plms_plmc_unlck_insvc(
> ent, trk_info, aff_ent_list_flag,
> is_set);
> +
> +   /* If this is a host EE, stop timer for
> all child EEs */
> +   if (ret_err == NCSCC_RC_SUCCESS &&
> ent->entity_type == PLMS_EE_ENTITY &&
> +   ent->leftmost_child) {
> +   plms_ee_stop_host_timer(ent->
> leftmost_child);
> +   }
>   

Re: [devel] CLM issue #2088 not oserved now

2017-10-26 Thread Mathi N P
We can close it ravi. Okay from me.

Mathi.

On Fri, Oct 20, 2017 at 1:35 PM, Ravi Sekhar Reddy Konda <
ravisekhar.ko...@oracle.com> wrote:

> Hi Mathi & Anders,
>
>
> Regarding CLM issue #2088 "saClmClusterNodeGetAsync returns OK on a non
> member node"
>
> I am not observing this issue now
>
> here is the tests performed
>
> On two node systems
> Locked the CLM Node SC-2 and then invoked the async API returns
> ERR_UNAVAILABLE
>
>
> root@SC-2:~# clmprint -a 0x2020f
> node_id:131599(2020f)
>
> ===CLM NODE GET CALLBACK STARTS==
> Error: SA_AIS_ERR_UNAVAILABLE (31)
> Invocation: 0
> error - InvocationId wrong,expected: , received: 0
> ===CLM NODE GET CALLBACK ENDS==
>
> Let me know if the issue can be closed now
>
>
> Thanks,
> Ravi
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1/2] plmd: allow dynamic creation of EE when EE is parent [#2483]

2017-07-10 Thread Mathi N P
Ack,
Mathi.

On Mon, Jul 3, 2017 at 10:06 PM, Alex Jones  wrote:

> This ticket will allow creation of an EE dynamically when the parent is an
> EE.
> Currently this is not allowed by PLM.
> ---
>  src/plm/config/plmsv_classes.xml |  4 ++--
>  src/plm/plmd/plms_imm.c  | 15 +++
>  2 files changed, 17 insertions(+), 2 deletions(-)
>
> diff --git a/src/plm/config/plmsv_classes.xml b/src/plm/config/plmsv_
> classes.xml
> index 7f1b3f6..44dbce8 100644
> --- a/src/plm/config/plmsv_classes.xml
> +++ b/src/plm/config/plmsv_classes.xml
> @@ -27,7 +27,7 @@
> SA_INITIALIZED
> 
> 
> -   safEE
> +   saPlmEE
> SA_NAME_T
> SA_CONFIG
> SA_INITIALIZED
> @@ -50,7 +50,7 @@
> SA_INITIALIZED
> 
> 
> -   safEE
> +   saPlmEE
> SA_NAME_T
> SA_CONFIG
> SA_INITIALIZED
> diff --git a/src/plm/plmd/plms_imm.c b/src/plm/plmd/plms_imm.c
> index 264c8c3..ef61b57 100644
> --- a/src/plm/plmd/plms_imm.c
> +++ b/src/plm/plmd/plms_imm.c
> @@ -878,6 +878,8 @@ static SaAisErrorT 
> plms_imm_ccb_obj_create_cbk(SaImmOiHandleT
> imm_oi_hdl,
> if ((strncmp((char *)parent_name->value,
>  "safDomain", 9) != 0) &&
> (strncmp((char *)parent_name->value,
> +"safEE", sizeof("safEE") - 1)
> != 0) &&
> +   (strncmp((char *)parent_name->value,
>  "safHE", 5) != 0)) {
> TRACE_LEAVE2(
> "Invalid DN, object cannot be
> created");
> @@ -902,6 +904,19 @@ static SaAisErrorT 
> plms_imm_ccb_obj_create_cbk(SaImmOiHandleT
> imm_oi_hdl,
> return SA_AIS_ERR_BAD_OPERATION;
> }
> }
> +   } else if (!strncmp(attr[j]->attrName, "plmVm",
> sizeof("plmVm") - 1)) {
> +   /* RDN attribute, store the name and value */
> +   obj_rdn = *(SaStringT *)*((attr[j])->attrValues);
> +   TRACE_2("Object RDN: %s", obj_rdn);
> +   if (!parent_name || (parent_name->length !=
> +sizeof("safApp=safPlmService") - 1) ||
> +   (strncmp((char *)parent_name->value,
> +"safApp=safPlmService",
> +parent_name->length) != 0)) {
> +   TRACE_LEAVE2(
> +   "Invalid DN, object cannot be
> created");
> +   return SA_AIS_ERR_BAD_OPERATION;
> +   }
> }
> }
> if ((ccb_util_ccb_data = ccbutil_getCcbData(ccb_id)) == NULL) {
> --
> 2.7.5
>
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 2/2] plm: allow dynamic creation of EE when EE is parent [#2483]

2017-07-10 Thread Mathi N P
Ack,
Mathi.

On Mon, Jul 3, 2017 at 10:06 PM, Alex Jones  wrote:

> Fix whitespace problem
> ---
>  src/plm/config/plmsv_classes.xml | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/plm/config/plmsv_classes.xml b/src/plm/config/plmsv_
> classes.xml
> index 44dbce8..a6e8f70 100644
> --- a/src/plm/config/plmsv_classes.xml
> +++ b/src/plm/config/plmsv_classes.xml
> @@ -27,7 +27,7 @@
> SA_INITIALIZED
> 
> 
> -   saPlmEE
> +   saPlmEE
> SA_NAME_T
> SA_CONFIG
> SA_INITIALIZED
> @@ -50,7 +50,7 @@
> SA_INITIALIZED
> 
> 
> -   saPlmEE
> +   saPlmEE
> SA_NAME_T
> SA_CONFIG
> SA_INITIALIZED
> --
> 2.7.5
>
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1/1] plmd: don't reset VM if it is ourself, when parent is instantiated [#2482]

2017-07-05 Thread Mathi N P
Ack,
Mathi.

On Mon, Jul 3, 2017 at 9:27 PM, Alex Jones  wrote:

> If the controller is a VM, and the parent hypervisor instantiates, the
> controller VM is immediately reset.
>
> All VMs which are children of the hypervisor are immediately reset.
>
> Don't reset ourself if we are PLMD.
> ---
>  src/plm/plmd/plms_virt.cc | 47 ++
> +
>  1 file changed, 39 insertions(+), 8 deletions(-)
>
> diff --git a/src/plm/plmd/plms_virt.cc b/src/plm/plmd/plms_virt.cc
> index fbe2e8a..7aee6e2 100644
> --- a/src/plm/plmd/plms_virt.cc
> +++ b/src/plm/plmd/plms_virt.cc
> @@ -24,6 +24,7 @@
>
>  #include 
>  #include 
> +#include 
>  #include 
>  #include "osaf/immutil/immutil.h"
>  #include "plm/common/plms_virt.h"
> @@ -561,15 +562,45 @@ extern "C" SaUint32T plms_ee_instantiate_vm(const
> PLMS_ENTITY *entity) {
>
>TRACE_ENTER();
>
> -  // find the hypervisor and tell it to boot the vm
> -  PlmsVmmMap::iterator vmmIt(plmsVmmMap.find(entity->parent->dn_name));
> +  do {
> +bool instantiate(true);
>
> -  if (vmmIt != plmsVmmMap.end()) {
> -rc = vmmIt->second->instantiate(entity->dn_name);
> -  } else {
> -LOG_ER("unable to find hypervisor to instantiate vm: %s",
> -   entity->dn_name.value);
> -  }
> +std::string plmcdFile(SYSCONFDIR);
> +plmcdFile += "/plmcd.conf";
> +
> +std::ifstream ifs(plmcdFile.c_str(), std::ifstream::in);
> +
> +while (ifs.good()) {
> +  char myEE[SA_MAX_NAME_LENGTH];
> +
> +  ifs.getline(myEE, SA_MAX_NAME_LENGTH);
> +
> +  if (!strncmp(myEE, "safEE", sizeof("safEE") - 1)) {
> +if (!strcmp(reinterpret_cast *>(entity->dn_name.value),
> +myEE)) {
> +  TRACE("not restting myself: virtual machine %s is already
> running",
> +entity->dn_name.value);
> +  instantiate = false;
> +  rc = NCSCC_RC_SUCCESS;
> +}
> +
> +break;
> +  }
> +}
> +
> +if (!instantiate)
> +  break;
> +
> +// find the hypervisor and tell it to boot the vm
> +PlmsVmmMap::iterator vmmIt(plmsVmmMap.find(entity->parent->dn_name));
> +
> +if (vmmIt != plmsVmmMap.end()) {
> +  rc = vmmIt->second->instantiate(entity->dn_name);
> +} else {
> +  LOG_ER("unable to find hypervisor to instantiate vm: %s",
> + entity->dn_name.value);
> +}
> +  } while (false);
>
>TRACE_LEAVE();
>
> --
> 2.7.5
>
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 2/2] lck: implement saLckLimitGet [#2425]

2017-05-21 Thread Mathi N P
Iam not sure what is being in changed in the header file?
Ack,
Mathi.

On Thu, May 11, 2017 at 6:50 PM, Alex Jones  wrote:

> Fix whitespace issues.
> ---
>  src/lck/saf/saLck.h | 46 +++---
>  1 file changed, 23 insertions(+), 23 deletions(-)
>
> diff --git a/src/lck/saf/saLck.h b/src/lck/saf/saLck.h
> index f0ff90a..4786794 100644
> --- a/src/lck/saf/saLck.h
> +++ b/src/lck/saf/saLck.h
> @@ -3,19 +3,19 @@
>  ** FILE:
>  **   saLck.h
>  **
> -** DESCRIPTION:
> -**   This file provides the C language binding for the Service
> -**   Availability(TM) Forum AIS Lock Service (LCK). It contains all of
> -**   the prototypes and type definitions required for LCK.
> -**
> +** DESCRIPTION:
> +**   This file provides the C language binding for the Service
> +**   Availability(TM) Forum AIS Lock Service (LCK). It contains all of
> +**   the prototypes and type definitions required for LCK.
> +**
>  ** SPECIFICATION VERSION:
>  **   SAI-AIS-LCK-B.03.01
>  **
> -** DATE:
> +** DATE:
>  **   Thu Jul 16 2009
>  **
>  ** LEGAL:
> -**   OWNERSHIP OF SPECIFICATION AND COPYRIGHTS.
> +**   OWNERSHIP OF SPECIFICATION AND COPYRIGHTS.
>  **
>  ** Copyright(c) 2009, Service Availability(TM) Forum. All rights reserved.
>  **
> @@ -79,26 +79,26 @@ typedef enum {
>  SA_LCK_MAX_NUM_LOCKS_ID = 1
>  } SaLckLimitIdT;
>
> -typedef void
> +typedef void
>  (*SaLckResourceOpenCallbackT)(
>  SaInvocationT invocation,
>  SaLckResourceHandleT lockResourceHandle,
>  SaAisErrorT error);
>
> -typedef void
> +typedef void
>  (*SaLckLockGrantCallbackT)(
>  SaInvocationT invocation,
>  SaLckLockStatusT lockStatus,
>  SaAisErrorT error);
>
> -typedef void
> +typedef void
>  (*SaLckLockWaiterCallbackT)(
>  SaLckWaiterSignalT waiterSignal,
>  SaLckLockIdT lockId,
>  SaLckLockModeT modeHeld,
>  SaLckLockModeT modeRequested);
>
> -typedef void
> +typedef void
>  (*SaLckResourceUnlockCallbackT)(
>  SaInvocationT invocation,
>  SaAisErrorT error);
> @@ -114,32 +114,32 @@ typedef struct {
>  / LCK API function declarations **/
>  /*/
>
> -extern SaAisErrorT
> +extern SaAisErrorT
>  saLckInitialize(
> -SaLckHandleT *lckHandle,
> +SaLckHandleT *lckHandle,
>  const SaLckCallbacksT *lckCallbacks,
>  SaVersionT *version);
>
> -extern SaAisErrorT
> +extern SaAisErrorT
>  saLckSelectionObjectGet(
>  SaLckHandleT lckHandle,
>  SaSelectionObjectT *selectionObject);
>
> -extern SaAisErrorT
> +extern SaAisErrorT
>  saLckOptionCheck(
>  SaLckHandleT lckHandle,
>  SaLckOptionsT *lckOptions);
>
> -extern SaAisErrorT
> +extern SaAisErrorT
>  saLckDispatch(
>  SaLckHandleT lckHandle,
>  SaDispatchFlagsT dispatchFlags);
>
> -extern SaAisErrorT
> +extern SaAisErrorT
>  saLckFinalize(
>  SaLckHandleT lckHandle);
>
> -extern SaAisErrorT
> +extern SaAisErrorT
>  saLckResourceOpen(
>  SaLckHandleT lckHandle,
>  const SaNameT *lockResourceName,
> @@ -147,18 +147,18 @@ saLckResourceOpen(
>  SaTimeT timeout,
>  SaLckResourceHandleT *lockResourceHandle);
>
> -extern SaAisErrorT
> +extern SaAisErrorT
>  saLckResourceOpenAsync(
>  SaLckHandleT  lckHandle,
>  SaInvocationT invocation,
>  const SaNameT *lockResourceName,
>  SaLckResourceOpenFlagsT resourceFlags);
>
> -extern SaAisErrorT
> +extern SaAisErrorT
>  saLckResourceClose(
>  SaLckResourceHandleT lockResourceHandle);
>
> -extern SaAisErrorT
> +extern SaAisErrorT
>  saLckResourceLock(
>  SaLckResourceHandleT lockResourceHandle,
>  SaLckLockIdT  *lockId,
> @@ -177,12 +177,12 @@ saLckResourceLockAsync(
>  SaLckLockFlagsT lockFlags,
>  SaLckWaiterSignalT waiterSignal);
>
> -extern SaAisErrorT
> +extern SaAisErrorT
>  saLckResourceUnlock(
>  SaLckLockIdT lockId,
>  SaTimeT timeout);
>
> -extern SaAisErrorT
> +extern SaAisErrorT
>  saLckResourceUnlockAsync(
>  SaInvocationT invocation,
>  SaLckLockIdT lockId);
> --
> 2.7.4
>
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1/3] lck: integrate with CLM [#2390]

2017-05-09 Thread Mathi N P
This is after applying the patch that handles TRY_AGAIN.
Also, this patch should get tested after enabling spares(and admin ops
around that), i think. Your call as the maintainer.

Thanks,
Mathi.

On Tue, May 9, 2017 at 11:31 PM, Mathi N P <mathi.np@gmail.com> wrote:

> Hi Alex,
>
> Good work. Ack for patch 1 with some minor comments.
>
> 1)  + ver.releaseCode > 'B')
> This condition could be changed to >= ?
>
> 2) +  if (notificationBuffer->notification[i].clusterChange ==
> SA_CLM_NODE_LEFT) {
>
> Just a thought ,I think its possible for a node to become unconfigured too?
> But perhaps, the usecase would be via a node lock or shutdown which would
> eventually translate to NODE_LEFT.
> So, i guesss it is okay to handle only SA_CLM_NODE_LEFT only.
>
> 3) +SaVersionT version = { 'B', 4, 0 };
>
> The minor version is irrelevant, but may be we could use use the currently
> supported minor version, instead of 0.
>
> 4) +  if (m_GLA_VER_IS_AT_LEAST_B_3(client_info->version) &&
>
> This is a generic comment about use of macros. May be we could begin to
> move away from such macros.
> But, i understand GLSv is one of those services still heavily using macros.
>
> Cheers,
> Mathi.
>
>
> On Wed, Apr 12, 2017 at 6:43 PM, Alex Jones <alex.jo...@genband.com>
> wrote:
>
>> This patch integrates LCK with CLM.
>> ---
>>  src/lck/Makefile.am  |   8 +-
>>  src/lck/agent/gla_api.c  |  96 +
>>  src/lck/agent/gla_cb.h   |   4 +
>>  src/lck/agent/gla_evt.h  |  11 +-
>>  src/lck/agent/gla_init.c |  27 +
>>  src/lck/agent/gla_mds.c  |  56 ++
>>  src/lck/common/glsv_defs.h   |   9 +-
>>  src/lck/lckd/gld_api.c   |  29 -
>>  src/lck/lckd/gld_cb.h|   2 +-
>>  src/lck/lckd/gld_clm.cc  | 131 +++
>>  src/lck/lckd/gld_clm.h   |  17 +++
>>  src/lck/lckd/gld_evt.c   | 115 +++-
>>  src/lck/lckd/gld_evt.h   |  16 +++
>>  src/lck/lcknd/glnd_agent.c   |  23 
>>  src/lck/lcknd/glnd_api.c |  35 --
>>  src/lck/lcknd/glnd_cb.c  |  10 ++
>>  src/lck/lcknd/glnd_cb.h  |  12 +++
>>  src/lck/lcknd/glnd_client.c  |  92 
>>  src/lck/lcknd/glnd_client.h  |  10 ++
>>  src/lck/lcknd/glnd_clm.cc| 183 +++
>>  src/lck/lcknd/glnd_clm.h |  17 +++
>>  src/lck/lcknd/glnd_evt.c | 250 ++
>> +++--
>>  src/lck/lcknd/glnd_mds.c |  39 +++
>>  src/lck/lcknd/glnd_mds.h |   8 ++
>>  src/lck/lcknd/glnd_res.c |   4 +
>>  src/lck/lcknd/glnd_res_req.c |  50 +
>>  26 files changed, 1159 insertions(+), 95 deletions(-)
>>  create mode 100644 src/lck/lckd/gld_clm.cc
>>  create mode 100644 src/lck/lckd/gld_clm.h
>>  create mode 100644 src/lck/lcknd/glnd_clm.cc
>>  create mode 100644 src/lck/lcknd/glnd_clm.h
>>
>> diff --git a/src/lck/Makefile.am b/src/lck/Makefile.am
>> index b7fb47b..fe8a34c 100644
>> --- a/src/lck/Makefile.am
>> +++ b/src/lck/Makefile.am
>> @@ -152,11 +152,13 @@ bin_osaflcknd_SOURCES = \
>> src/lck/lcknd/glnd_res_req.c \
>> src/lck/lcknd/glnd_restart.c \
>> src/lck/lcknd/glnd_shm.c \
>> -   src/lck/lcknd/glnd_tmr.c
>> +   src/lck/lcknd/glnd_tmr.c \
>> +   src/lck/lcknd/glnd_clm.cc
>>
>>  bin_osaflcknd_LDADD = \
>> lib/liblck_common.la \
>> lib/libSaAmf.la \
>> +   lib/libSaClm.la \
>> lib/libopensaf_core.la
>>
>>  bin_osaflckd_CPPFLAGS = \
>> @@ -175,11 +177,13 @@ bin_osaflckd_SOURCES = \
>> src/lck/lckd/gld_red.c \
>> src/lck/lckd/gld_rsc.c \
>> src/lck/lckd/gld_standby.c \
>> -   src/lck/lckd/gld_tmr.c
>> +   src/lck/lckd/gld_tmr.c \
>> +   src/lck/lckd/gld_clm.cc
>>
>>  bin_osaflckd_LDADD = \
>> lib/liblck_common.la \
>> lib/libSaAmf.la \
>> +   lib/libSaClm.la \
>> lib/libosaf_common.la \
>> lib/libSaImmOi.la \
>> lib/libSaImmOm.la \
>> diff --git a/src/lck/agent/gla_api.c b/src/lck/agent/gla_api.c
>> index 539c71b..dbe75cd 100644
>> --- a/src/lck/agent/gla_api.c
>> +++ b/src/lck/agent/gla_api.c
>> @@ -145,6 +145,9 @@ SaAisErrorT saLckInitialize(SaLckHandleT *lckHandle,
>> }
>> rc = out_evt->error;
>> if (rc == SA_AIS_OK) {
>> +/* if the call succeeds we know glnd is a member of the cluster */
>> + gla_cb->i

Re: [devel] [PATCH 2/3] lck: add missing header file [#2390]

2017-05-09 Thread Mathi N P
Ack,
Mathi.

On Wed, Apr 12, 2017 at 6:43 PM, Alex Jones  wrote:

> Add missing header file so tests.sh can run.
> ---
>  src/lck/Makefile.am | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/src/lck/Makefile.am b/src/lck/Makefile.am
> index fe8a34c..cc621a7 100644
> --- a/src/lck/Makefile.am
> +++ b/src/lck/Makefile.am
> @@ -89,6 +89,7 @@ noinst_HEADERS += \
> src/lck/lckd/gld_amf.h \
> src/lck/lckd/gld_api.h \
> src/lck/lckd/gld_cb.h \
> +   src/lck/lckd/gld_clm.h \
> src/lck/lckd/gld_dl_api.h \
> src/lck/lckd/gld_edu.h \
> src/lck/lckd/gld_evt.h \
> --
> 2.7.4
>
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1/3] lck: integrate with CLM [#2390]

2017-05-09 Thread Mathi N P
Hi Alex,

Good work. Ack for patch 1 with some minor comments.

1)  + ver.releaseCode > 'B')
This condition could be changed to >= ?

2) +  if (notificationBuffer->notification[i].clusterChange ==
SA_CLM_NODE_LEFT) {

Just a thought ,I think its possible for a node to become unconfigured too?
But perhaps, the usecase would be via a node lock or shutdown which would
eventually translate to NODE_LEFT.
So, i guesss it is okay to handle only SA_CLM_NODE_LEFT only.

3) +SaVersionT version = { 'B', 4, 0 };

The minor version is irrelevant, but may be we could use use the currently
supported minor version, instead of 0.

4) +  if (m_GLA_VER_IS_AT_LEAST_B_3(client_info->version) &&

This is a generic comment about use of macros. May be we could begin to
move away from such macros.
But, i understand GLSv is one of those services still heavily using macros.

Cheers,
Mathi.


On Wed, Apr 12, 2017 at 6:43 PM, Alex Jones  wrote:

> This patch integrates LCK with CLM.
> ---
>  src/lck/Makefile.am  |   8 +-
>  src/lck/agent/gla_api.c  |  96 +
>  src/lck/agent/gla_cb.h   |   4 +
>  src/lck/agent/gla_evt.h  |  11 +-
>  src/lck/agent/gla_init.c |  27 +
>  src/lck/agent/gla_mds.c  |  56 ++
>  src/lck/common/glsv_defs.h   |   9 +-
>  src/lck/lckd/gld_api.c   |  29 -
>  src/lck/lckd/gld_cb.h|   2 +-
>  src/lck/lckd/gld_clm.cc  | 131 +++
>  src/lck/lckd/gld_clm.h   |  17 +++
>  src/lck/lckd/gld_evt.c   | 115 +++-
>  src/lck/lckd/gld_evt.h   |  16 +++
>  src/lck/lcknd/glnd_agent.c   |  23 
>  src/lck/lcknd/glnd_api.c |  35 --
>  src/lck/lcknd/glnd_cb.c  |  10 ++
>  src/lck/lcknd/glnd_cb.h  |  12 +++
>  src/lck/lcknd/glnd_client.c  |  92 
>  src/lck/lcknd/glnd_client.h  |  10 ++
>  src/lck/lcknd/glnd_clm.cc| 183 +++
>  src/lck/lcknd/glnd_clm.h |  17 +++
>  src/lck/lcknd/glnd_evt.c | 250 ++
> +++--
>  src/lck/lcknd/glnd_mds.c |  39 +++
>  src/lck/lcknd/glnd_mds.h |   8 ++
>  src/lck/lcknd/glnd_res.c |   4 +
>  src/lck/lcknd/glnd_res_req.c |  50 +
>  26 files changed, 1159 insertions(+), 95 deletions(-)
>  create mode 100644 src/lck/lckd/gld_clm.cc
>  create mode 100644 src/lck/lckd/gld_clm.h
>  create mode 100644 src/lck/lcknd/glnd_clm.cc
>  create mode 100644 src/lck/lcknd/glnd_clm.h
>
> diff --git a/src/lck/Makefile.am b/src/lck/Makefile.am
> index b7fb47b..fe8a34c 100644
> --- a/src/lck/Makefile.am
> +++ b/src/lck/Makefile.am
> @@ -152,11 +152,13 @@ bin_osaflcknd_SOURCES = \
> src/lck/lcknd/glnd_res_req.c \
> src/lck/lcknd/glnd_restart.c \
> src/lck/lcknd/glnd_shm.c \
> -   src/lck/lcknd/glnd_tmr.c
> +   src/lck/lcknd/glnd_tmr.c \
> +   src/lck/lcknd/glnd_clm.cc
>
>  bin_osaflcknd_LDADD = \
> lib/liblck_common.la \
> lib/libSaAmf.la \
> +   lib/libSaClm.la \
> lib/libopensaf_core.la
>
>  bin_osaflckd_CPPFLAGS = \
> @@ -175,11 +177,13 @@ bin_osaflckd_SOURCES = \
> src/lck/lckd/gld_red.c \
> src/lck/lckd/gld_rsc.c \
> src/lck/lckd/gld_standby.c \
> -   src/lck/lckd/gld_tmr.c
> +   src/lck/lckd/gld_tmr.c \
> +   src/lck/lckd/gld_clm.cc
>
>  bin_osaflckd_LDADD = \
> lib/liblck_common.la \
> lib/libSaAmf.la \
> +   lib/libSaClm.la \
> lib/libosaf_common.la \
> lib/libSaImmOi.la \
> lib/libSaImmOm.la \
> diff --git a/src/lck/agent/gla_api.c b/src/lck/agent/gla_api.c
> index 539c71b..dbe75cd 100644
> --- a/src/lck/agent/gla_api.c
> +++ b/src/lck/agent/gla_api.c
> @@ -145,6 +145,9 @@ SaAisErrorT saLckInitialize(SaLckHandleT *lckHandle,
> }
> rc = out_evt->error;
> if (rc == SA_AIS_OK) {
> +/* if the call succeeds we know glnd is a member of the cluster */
> + gla_cb->isClusterMember = true;
> +
> /* create the client node and populate it */
> client_info =
> gla_client_tree_find_and_add(gla_cb, out_evt->handle,
> true);
> @@ -154,6 +157,9 @@ SaAisErrorT saLckInitialize(SaLckHandleT *lckHandle,
> goto err;
> }
>
> +client_info->isStale = false;
> + memcpy(_info->version, version, sizeof(SaVersionT));
> +
> /* copy the callbacks */
> if (lckCallbacks)
> memcpy((void *)_info->lckCallbk,
> @@ -259,6 +265,14 @@ SaAisErrorT saLckSelectionObjectGet(SaLckHandleT
> lckHandle,
> goto done;
> }
>
> +  /* are we a member of the cluster? */
> +  if (m_GLA_VER_IS_AT_LEAST_B_3(client_info->version)) {
> +if (!gla_cb->isClusterMember || client_info->isStale) {
> +  rc = SA_AIS_ERR_UNAVAILABLE;
> +  goto done;
> +}
> +  }
> +
> /* everything's fine.. pass the sel obj to the appl */
>  

Re: [devel] [PATCH 0 of 1] Review Request for clmd: checkpoint full node record in CCB modify cbk [#2265]

2017-02-05 Thread Mathi N P
Hi Praveen,

Difficult flows to catch, good work.

Cheers,
Mathi.

On Fri, Feb 3, 2017 at 12:52 PM, Anders Widell 
wrote:

> Good work! We will re-test with the correction applied.
>
> thanks,
>
> Anders Widell
>
>
> On 02/03/2017 10:23 AM, praveen.malv...@oracle.com wrote:
> > Summary: clmd: checkpoint full node record in CCB modify cbk [#2265]
> > Review request for Trac Ticket(s): #2265
> > Peer Reviewer(s): Anders Widell
> > Pull request to: <>
> > Affected branch(es): ALL
> > Development branch: <>
> >
> > 
> > Impacted area   Impact y/n
> > 
> >   Docsn
> >   Build systemn
> >   RPM/packaging   n
> >   Configuration files n
> >   Startup scripts n
> >   SAF servicesy
> >   OpenSAF servicesn
> >   Core libraries  n
> >   Samples n
> >   Tests   n
> >   Other   n
> >
> >
> > Comments (indicate scope for each "y" above):
> > -
> >
> > changeset d7dfb6227c5cff876426c68f5847b0f450b2e26e
> > Author:   Praveen Malviya 
> > Date: Fri, 03 Feb 2017 14:49:37 +0530
> >
> >   clmd: checkpoint full node record in CCB modify cbk [#2265]
> >
> >   In the reported issue standby CLMD asserts while processing async
> update
> >   related to node.
> >
> >   While standby controller is joining the cluster and a clm node is
> added
> >   using CCB operations then standby may not read this object from
> IMM. This
> >   can happen when active is still processing apply callback and
> standby has
> >   finised reading from IMM. Also if standby CLMD is still not
> visible to
> >   active CLMD via MBCSV then active will not checkpoint this newly
> added node.
> >   If this node does not come up before standby CLMD joins cluster
> active will
> >   not get nodeid of new node and hence it will not be added in
> node_id db.
> >   During cold sync phase active shares only node_id db with standby.
> Thus this
> >   new node will not be available in standby db. Now if a user
> modifies any
> >   attribute of this new node via CCB, active will checkpoint this
> information.
> >   Since standby CLMD does not have this node it asserts while
> searching for
> >   node.
> >
> >   Patch fixes the problem by sending full record of newly added node
> during
> >   CCB modification. Upon receiving this record, standby will add
> this new node
> >   in its db.
> >
> >
> > Complete diffstat:
> > --
> >   src/clm/clmd/clms_imm.c   |  24 ++--
> >   src/clm/clmd/clms_mbcsv.c |  23 +++
> >   src/clm/clmd/clms_mbcsv.h |   1 +
> >   3 files changed, 34 insertions(+), 14 deletions(-)
> >
> >
> > Testing Commands:
> > -
> > Tested with steps given in comment part of ticket.
> >
> > Testing, Expected Results:
> > --
> > Standby not crashed.
> >
> > 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