Ack, code review only

Regards,
Ravi 

-----Original Message-----
From: Alex Jones [mailto:alex.jo...@genband.com] 
Sent: Friday, November 10, 2017 2:54 AM
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: fix PLM to run on OpenSUSE Leap 42.2 [#2480]

plmd fails to execute functions in libplms_hpi.so after it is dlopened and 
dlsym'd.

HPI is not linked against libplms_hpi.so, and because the library is dlopened 
with LAZY, trying to execute any saHpiXXX call fails to resolve the symbol. PLM 
then exits. There are also some multiply defined symbols.

Link libplms_hpi.so against the HPI lib. And make variables declared in header 
files "extern".
---
 src/plm/Makefile.am       | 4 ++--
 src/plm/common/plms_hrb.h | 2 +-
 src/plm/common/plms_hsm.h | 4 ++--
 src/plm/plmd/plms_virt.cc | 1 +
 4 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/plm/Makefile.am b/src/plm/Makefile.am index 285989a..581cb17 
100644
--- a/src/plm/Makefile.am
+++ b/src/plm/Makefile.am
@@ -108,7 +108,8 @@ nodist_EXTRA_lib_libplms_hpi_la_SOURCES = dummy.cc
 
 lib_libplms_hpi_la_LIBADD = \
        lib/libplmc.la \
-       lib/libplmc_utils.la
+       lib/libplmc_utils.la \
+       @HPI_LIBS@
 
 lib_LTLIBRARIES += lib/libSaPlm.la
 
@@ -204,7 +205,6 @@ bin_osafplmd_SOURCES = \
        src/plm/plmd/plms_virt.cc
 
 bin_osafplmd_LDADD = \
-       @HPI_LIBS@ \
        @LIBVIRT_LIBS@ \
        lib/libosaf_common.la \
        lib/libopensaf_core.la \
diff --git a/src/plm/common/plms_hrb.h b/src/plm/common/plms_hrb.h index 
c1a3b9b..929fe7a 100644
--- a/src/plm/common/plms_hrb.h
+++ b/src/plm/common/plms_hrb.h
@@ -53,7 +53,7 @@ typedef struct plms_hrb_cb {
   SYSF_MBX mbx; /* PLMS HRBs mailbox  */  } PLMS_HRB_CB;
 
-PLMS_HRB_CB *hrb_cb;
+extern PLMS_HRB_CB *hrb_cb;
 
 /* Function Declarations */
 SaUint32T plms_hrb_initialize(void);
diff --git a/src/plm/common/plms_hsm.h b/src/plm/common/plms_hsm.h index 
89f2cce..4b33327 100644
--- a/src/plm/common/plms_hsm.h
+++ b/src/plm/common/plms_hsm.h
@@ -44,9 +44,9 @@ typedef struct {
   SaNtfHandleT plm_ntf_hdl;
 } PLMS_HSM_CB;
 
-PLMS_HSM_CB *hsm_cb;
+extern PLMS_HSM_CB *hsm_cb;
 
-HSM_HA_STATE hsm_ha_state;
+extern HSM_HA_STATE hsm_ha_state;
 
 /* Function Declarations */
 SaUint32T plms_hsm_initialize(PLMS_HPI_CONFIG *hpi_cfg); diff --git 
a/src/plm/plmd/plms_virt.cc b/src/plm/plmd/plms_virt.cc index 7aee6e2..e9f44af 
100644
--- a/src/plm/plmd/plms_virt.cc
+++ b/src/plm/plmd/plms_virt.cc
@@ -26,6 +26,7 @@
 #include <cstring>
 #include <fstream>
 #include <set>
+#include "osaf/configmake.h"
 #include "osaf/immutil/immutil.h"
 #include "plm/common/plms_virt.h"
 #include "plm/common/plms.h"
--
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