[ofa-general] [PATCH] opensm: no interactive games in daemon mode

Sasha Khapyorsky sashak at voltaire.com
Thu Nov 15 02:10:06 PST 2007


When running in daemon mode don't run interactive guid chooser. And if
guid was not selected do not fail - pass zero to osm_vendor_bind() it
will try to select port automatically.

Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---
 opensm/opensm/main.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/opensm/opensm/main.c b/opensm/opensm/main.c
index 0a58a16..13c9f70 100644
--- a/opensm/opensm/main.c
+++ b/opensm/opensm/main.c
@@ -393,6 +393,9 @@ ib_net64_t get_port_guid(IN osm_opensm_t * p_osm, uint64_t port_guid)
 		return (attr_array[i].port_guid);
 	}
 
+	if (p_osm->subn.opt.daemon)
+		return 0;
+
 	/* More than one possible port - list all ports and let the user
 	 * to choose. */
 	while (done_flag == FALSE) {
@@ -956,12 +959,6 @@ int main(int argc, char *argv[])
 	if (opt.guid == 0 || cl_hton64(opt.guid) == CL_HTON64(INVALID_GUID))
 		opt.guid = get_port_guid(&osm, opt.guid);
 
-	if (opt.guid == 0) {
-		printf("Error: Could not get port guid\n");
-		status = IB_ERROR;
-		goto Exit;
-	}
-
 	if (cache_options == TRUE
 	    && osm_subn_write_conf_file(&opt) != IB_SUCCESS)
 		printf("\nosm_subn_write_conf_file failed!\n");
-- 
1.5.3.rc2.29.gc4640f




More information about the general mailing list