diff -up opensm-3.3.13/opensm/main.c.config opensm-3.3.13/opensm/main.c --- opensm-3.3.13/opensm/main.c.config 2012-03-02 10:35:26.783996345 -0500 +++ opensm-3.3.13/opensm/main.c 2012-03-02 10:46:33.471939369 -0500 @@ -131,6 +131,13 @@ static void show_usage(void) " The name of the OpenSM config file. When not specified\n" " " OSM_DEFAULT_CONFIG_FILE " will be used (if exists).\n\n"); + printf("--extra-config, -E \n" + " The name of an OpenSM config file used to over ride\n" + " the entries in the primary config file. This is\n" + " useful when you have more than one opensm instance\n" + " to manage and you want them all to have a central,\n" + " shared set of options and you want a second, smaller\n" + " config file to hold their fabric specific options.\n\n"); printf("--create-config, -c \n" " OpenSM will dump its configuration to the specified file and exit.\n" " This is a way to generate OpenSM configuration file template.\n\n"); @@ -569,10 +576,10 @@ int main(int argc, char *argv[]) boolean_t run_once_flag = FALSE; int32_t vendor_debug = 0; int next_option; - char *conf_template = NULL, *config_file = NULL; + char *conf_template, *config_file, *extra_config_file; uint32_t val; const char *const short_option = - "F:c:i:w:O:f:ed:D:g:l:L:s:t:a:u:m:X:R:zM:U:S:P:Y:ANBIQvVhoryxp:n:q:k:C:G:H:"; + "F:E:c:i:w:O:f:ed:D:g:l:L:s:t:a:u:m:X:R:zM:U:S:P:Y:ANBIQvVhoryxp:n:q:k:C:G:H:"; /* In the array below, the 2nd parameter specifies the number @@ -584,6 +591,7 @@ int main(int argc, char *argv[]) const struct option long_option[] = { {"version", 0, NULL, 12}, {"config", 1, NULL, 'F'}, + {"extra-config", 1, NULL, 'E'}, {"create-config", 1, NULL, 'c'}, {"debug", 1, NULL, 'd'}, {"guid", 1, NULL, 'g'}, @@ -647,6 +655,7 @@ int main(int argc, char *argv[]) {"torus_config", 1, NULL, 10}, {NULL, 0, NULL, 0} /* Required at the end of the array */ }; + conf_template = config_file = extra_config_file = NULL; /* force stdout to be line-buffered */ setvbuf(stdout, NULL, _IOLBF, BUFSIZ); @@ -672,6 +681,11 @@ int main(int argc, char *argv[]) config_file = optarg; printf("Config file is `%s`:\n", config_file); break; + case 'E': + extra_config_file = optarg; + printf("Extra Config file is `%s`:\n", + extra_config_file); + break; default: break; } @@ -687,6 +701,11 @@ int main(int argc, char *argv[]) if (osm_subn_parse_conf_file(config_file, &opt) < 0) printf("\nFail to parse config file \'%s\'\n", config_file); + if (extra_config_file) + if (osm_subn_parse_conf_file(extra_config_file, &opt) < 0) + printf("\nFailed to parse extra config file `%s`\n", + extra_config_file); + printf("Command Line Arguments:\n"); do { next_option = getopt_long_only(argc, argv, short_option,