HI Alex,

Ack, but a minor change
In the util routine plms_is_chld, rhe return code variable name is "ret_err",
please change it to "is_child". Because this routine  returns true or false 
based on whether it is child or not, but does not return any error.
I understand it is existing code only, as you are modifying its better to 
correct it.

Thanks,
Ravi

-----Original Message-----
From: Alex Jones [mailto:alex.jo...@genband.com] 
Sent: Friday, November 10, 2017 7:55 PM
To: mathi.np....@gmail.com; Ravi Sekhar Reddy Konda 
<ravisekhar.ko...@oracle.com>
Cc: opensaf-devel@lists.sourceforge.net; Alex Jones <alex.jo...@genband.com>
Subject: [PATCH 1/1] plm: terminate child EEs when parent is terminated [#2572]

If the hypervisor EE is terminated by shutting down plmcd on the host, the 
child EEs (VMs) are not terminated and put into Uninstantiated state. Then when 
plmcd is restarted on the host, the child VMs are not started or restarted 
because PLM thinks they are instantiated.

Logic is wrong in plms_plmc_tcp_disconnect_process when checking for child EEs.

Terminate child EEs when the host is terminated.
---
 src/plm/common/plms_utils.h | 2 +-
 src/plm/plmd/plms_plmc.c    | 6 ++----
 src/plm/plmd/plms_utils.c   | 4 ++--
 3 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/src/plm/common/plms_utils.h b/src/plm/common/plms_utils.h index 
551e1f8..5292e15 100644
--- a/src/plm/common/plms_utils.h
+++ b/src/plm/common/plms_utils.h
@@ -17,7 +17,7 @@
 #define PLM_COMMON_PLMS_UTILS_H_
 
 uint32_t plms_anc_chld_dep_adm_flag_is_set(PLMS_ENTITY *, PLMS_GROUP_ENTITY 
*); -uint32_t plms_is_chld(PLMS_ENTITY *, PLMS_ENTITY *);
+bool plms_is_chld(PLMS_ENTITY *, PLMS_ENTITY *);
 void plms_affected_ent_list_get(PLMS_ENTITY *, PLMS_GROUP_ENTITY **, SaBoolT); 
 uint32_t plms_chld_get(PLMS_ENTITY *, PLMS_GROUP_ENTITY **);  uint32_t 
plms_aff_he_find(PLMS_GROUP_ENTITY *, PLMS_GROUP_ENTITY **); diff --git 
a/src/plm/plmd/plms_plmc.c b/src/plm/plmd/plms_plmc.c index 8c694d9..0667099 
100644
--- a/src/plm/plmd/plms_plmc.c
+++ b/src/plm/plmd/plms_plmc.c
@@ -615,8 +615,7 @@ SaUint32T plms_plmc_tcp_disconnect_process(PLMS_ENTITY *ent)
                        }
 
                        /* Terminate all the dependent EEs.*/
-                       if (NCSCC_RC_SUCCESS !=
-                           plms_is_chld(ent, head->plm_entity)) {
+                       if (plms_is_chld(ent, head->plm_entity)) {
                                ret_err = plms_ee_term(head->plm_entity, false,
                                                       true /*mngt_cbk*/);
                                if (NCSCC_RC_SUCCESS != ret_err) {
@@ -2605,8 +2604,7 @@ SaUint32T plms_ee_term_failed_tmr_exp(PLMS_ENTITY *ent)
                            SA_PLM_NTFID_STATE_CHANGE_DEP);
 
                        /* Terminate all the dependent EEs.*/
-                       if (NCSCC_RC_SUCCESS !=
-                           plms_is_chld(ent, head->plm_entity)) {
+                       if (plms_is_chld(ent, head->plm_entity)) {
                                ret_err = plms_ee_term(head->plm_entity, false,
                                                       true /*mngt_cbk*/);
                                if (NCSCC_RC_SUCCESS != ret_err) {
diff --git a/src/plm/plmd/plms_utils.c b/src/plm/plmd/plms_utils.c index 
3d3b5eb..267b88b 100644
--- a/src/plm/plmd/plms_utils.c
+++ b/src/plm/plmd/plms_utils.c
@@ -840,9 +840,9 @@ void plms_aff_chld_ent_list_get(PLMS_ENTITY *root_ent, 
PLMS_ENTITY *ent,
 @return                : false - If ent is not a child of root.
                  true - If ent is a child of root.
 ******************************************************************************/
-SaUint32T plms_is_chld(PLMS_ENTITY *root, PLMS_ENTITY *ent)
+bool plms_is_chld(PLMS_ENTITY *root, PLMS_ENTITY *ent)
 {
-       SaUint32T ret_err;
+       bool ret_err;
        PLMS_GROUP_ENTITY *chld_list = NULL;
 
        TRACE_ENTER2("Root Entity: %s", root->dn_name_str);
--
2.9.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

Reply via email to