Version: 1
-Previous: e38c07ccdc1cad20e182d1385fc1d8b1ca9835a5
-Head: a2b702c11c98eb1065bb8831d28e07979155c2a2
+Previous: 2c2c1a0dba8b71bce6822ced649913c7712ab699
+Head: d293a5ef33b1bab9897aabd748b3559b91dfeb15
Applied:
ibacm-update-man-page: 740d2536b9ba2ae764fffcc2205c656771bde779
ibacm-add-provider-man-page: a2b702c11c98eb1065bb8831d28e07979155c2a2
+ ibacm-prov-export-a-function-t: d293a5ef33b1bab9897aabd748b3559b91dfeb15
Unapplied:
suse: 7076e2a00570a3cda4e4ce034419399a23ebfb0a
dev-name2ip: 8e00708e882239292492e13aa51c82042255933c
--- /dev/null
+Bottom: 8cedf3c95809cfc78f8f716b0872e121ebce2987
+Top: 07014405cca6b5e9bb67a82361b2ec1d634f6281
+Author: Kaike Wan <kaike.wan@intel.com>
+Date: 2014-06-20 08:54:43 -0700
+
+ibacm/prov: export a function to return config file name
+
+Instead of exposing the ibacm configuration file name directly, this patch
+exports a function to return the configuration file name. This provides better
+encapsulation.
+
+Signed-off-by: Kaike Wan <kaike.wan@intel.com>
+
+
+---
+
+diff --git a/include/infiniband/acm_prov.h b/include/infiniband/acm_prov.h
+index dcfdf5f..9e299b9 100644
+--- a/include/infiniband/acm_prov.h
++++ b/include/infiniband/acm_prov.h
+@@ -82,7 +82,6 @@ struct acm_provider {
+
+ /* Variables exported from core */
+ extern atomic_t counter[ACM_MAX_COUNTER];
+-extern char *opts_file;
+
+ int provider_query(struct acm_provider **info, uint32_t *version);
+
+@@ -117,4 +116,6 @@ acm_alloc_sa_mad(const struct acm_endpoint *endpoint, void *context,
+ extern void acm_free_sa_mad(struct acm_sa_mad *mad);
+ extern int acm_send_sa_mad(struct acm_sa_mad *mad);
+
++extern char * acm_get_opts_file(void);
++
+ #endif /* ACM_PROV_H */
+diff --git a/prov/acmp/src/acmp.c b/prov/acmp/src/acmp.c
+index 45ad03b..5db62e2 100644
+--- a/prov/acmp/src/acmp.c
++++ b/prov/acmp/src/acmp.c
+@@ -2776,6 +2776,7 @@ static void acmp_set_options(void)
+ FILE *f;
+ char s[120];
+ char opt[32], value[256];
++ char *opts_file = acm_get_opts_file();
+
+ if (!(f = fopen(opts_file, "r")))
+ return;
+diff --git a/src/acm.c b/src/acm.c
+index 6d18ac5..97b773e 100644
+--- a/src/acm.c
++++ b/src/acm.c
+@@ -186,7 +186,7 @@ static struct sa_data {
+ * Service options - may be set through ibacm_opts.cfg file.
+ */
+ static char *acme = IBACM_BIN_PATH "/ib_acme -A";
+-char *opts_file = ACM_CONF_DIR "/" ACM_OPTS_FILE;
++static char *opts_file = ACM_CONF_DIR "/" ACM_OPTS_FILE;
+ static char *addr_file = ACM_CONF_DIR "/" ACM_ADDR_FILE;
+ static char log_file[128] = "/var/log/ibacm.log";
+ static int log_level = 0;
+@@ -256,6 +256,11 @@ int ib_any_gid(union ibv_gid *gid)
+ return ((gid->global.subnet_prefix | gid->global.interface_id) == 0);
+ }
+
++char * acm_get_opts_file(void)
++{
++ return opts_file;
++}
++
+ static struct acmc_prov_context *
+ acm_alloc_prov_context(struct acm_provider *prov)
+ {