[ofa-general] [PATCH 5/6] Add switch_map_name to opts file.

Ira Weiny weiny2 at llnl.gov
Thu Oct 25 11:43:42 PDT 2007


>From 5f1db5f3444e21f3c78e42c047d1e440ac35ac66 Mon Sep 17 00:00:00 2001
From: Ira K. Weiny <weiny2 at llnl.gov>
Date: Thu, 25 Oct 2007 09:31:21 -0700
Subject: [PATCH] Add switch_map_name to opts file.


Signed-off-by: Ira K. Weiny <weiny2 at llnl.gov>
---
 opensm/opensm/osm_opensm.c |    2 +-
 opensm/opensm/osm_subnet.c |   10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/opensm/opensm/osm_opensm.c b/opensm/opensm/osm_opensm.c
index 53f4f8b..5fa4383 100644
--- a/opensm/opensm/osm_opensm.c
+++ b/opensm/opensm/osm_opensm.c
@@ -312,7 +312,7 @@ osm_opensm_init(IN osm_opensm_t * const p_osm,
 		goto Exit;
 	}
 
-	p_osm->switch_map = create_switch_map(NULL);
+	p_osm->switch_map = create_switch_map(p_opt->switch_map_name);
 
       Exit:
 	osm_log(&p_osm->log, OSM_LOG_FUNCS, "osm_opensm_init: ]\n");	/* Format Waived */
diff --git a/opensm/opensm/osm_subnet.c b/opensm/opensm/osm_subnet.c
index 829c82b..9bc6940 100644
--- a/opensm/opensm/osm_subnet.c
+++ b/opensm/opensm/osm_subnet.c
@@ -445,6 +445,7 @@ void osm_subn_set_default_opt(IN osm_subn_opt_t * const p_opt)
 #endif				/* ENABLE_OSM_PERF_MGR */
 
 	p_opt->event_plugin_name = OSM_DEFAULT_EVENT_PLUGIN_NAME;
+	p_opt->switch_map_name = NULL;
 
 	p_opt->dump_files_dir = getenv("OSM_TMP_DIR");
 	if (!p_opt->dump_files_dir || !(*p_opt->dump_files_dir))
@@ -1245,6 +1246,9 @@ ib_api_status_t osm_subn_parse_conf_file(IN osm_subn_opt_t * const p_opts)
 		opts_unpack_charp("event_plugin_name",
 				  p_key, p_val, &p_opts->event_plugin_name);
 
+		opts_unpack_charp("switch_map_name",
+				  p_key, p_val, &p_opts->switch_map_name);
+
 		subn_parse_qos_options("qos",
 				       p_key, p_val, &p_opts->qos_options);
 
@@ -1504,6 +1508,12 @@ ib_api_status_t osm_subn_write_conf_file(IN osm_subn_opt_t * const p_opts)
 		"event_plugin_name %s\n\n", p_opts->event_plugin_name);
 
 	fprintf(opts_file,
+		"#\n# Switch Map for mapping switch GUID's to more descirptive node descriptors\n"
+		"# (man ibnetdiscover for more information)\n#\n"
+		"switch_map_name %s\n\n",
+		p_opts->switch_map_name ? p_opts->switch_map_name : "(null)");
+
+	fprintf(opts_file,
 		"#\n# DEBUG FEATURES\n#\n"
 		"# The log flags used\n"
 		"log_flags 0x%02x\n\n"
-- 
1.5.1

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-Add-switch_map_name-to-opts-file.patch
Type: application/octet-stream
Size: 2234 bytes
Desc: not available
URL: <http://lists.openfabrics.org/pipermail/general/attachments/20071025/f04fd88e/attachment.obj>


More information about the general mailing list