public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Alex Netes <alexne-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Cc: Ira Weiny <weiny2-i2BcT+NCU+M@public.gmane.org>,
	Hal Rosenstock <hal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	"linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [Patch opensm] Allow for easily configuring multiple fabrics on one opensm server
Date: Fri, 02 Mar 2012 10:47:10 -0500	[thread overview]
Message-ID: <4F50EB7E.20900@redhat.com> (raw)
In-Reply-To: <4F50E7CE.6050204-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>


[-- Attachment #1.1: Type: text/plain, Size: 1394 bytes --]

On 3/2/2012 10:31 AM, Doug Ledford wrote:
> On 3/2/2012 5:30 AM, Alex Netes wrote:
>> What the default opensm.conf would be used for? Just as a reference to the
>> default values?
> 
> No, he's referring to having a default config file that is parsed, then
> an override config file that is parsed where you only put options you
> want to update in the override config file.  That way you could have,
> for instance, a default opensm.conf in the normal location and totally
> unedited so that it gets updated with each update of the opensm rpm,
> then you could create an opensm.conf.1 that is empty except for just a
> guid setting, a subnet_prefix setting, maybe a cache dir setting, etc.
> In that way, if say the default routing engine gets a new option in the
> future, your override config file won't already be populated with the
> old stuff.  It's a means of inheritance that is functionally identical
> to specifying all this stuff on the command line, but doesn't require a
> huge command line or a complex init script.

And for what it's worth, it could be as simply done as the attached
(untested, but compiled) patch.

-- 
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
              GPG KeyID: 0E572FDD
	      http://people.redhat.com/dledford

Infiniband specific RPMs available at
	      http://people.redhat.com/dledford/Infiniband

[-- Attachment #1.2: opensm-config.patch --]
[-- Type: text/plain, Size: 3087 bytes --]

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 <file-name>\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 <file-name>\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,

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 898 bytes --]

  parent reply	other threads:[~2012-03-02 15:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-29  5:01 [Patch opensm] Allow for easily configuring multiple fabrics on one opensm server Doug Ledford
     [not found] ` <4F4DB11C.5080203-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-02-29 19:22   ` Ira Weiny
     [not found]     ` <20120229112229.136f25b7.weiny2-i2BcT+NCU+M@public.gmane.org>
2012-02-29 19:47       ` Doug Ledford
     [not found]         ` <20120301021501.GB961@bukharin.us.cray.com>
     [not found]           ` <20120301021501.GB961-7GFyYy+Av7rWWZS0+0nfmVaTQe2KTcn/@public.gmane.org>
2012-03-01 13:31             ` Doug Ledford
     [not found]               ` <4F4F7A4B.4060007-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-03-05 12:52                 ` Hal Rosenstock
     [not found]                   ` <4F54B707.1070606-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2012-03-05 15:28                     ` Doug Ledford
     [not found]                       ` <2962b1d0-a679-45d0-a82b-5d624e2081f9-HOthUlaS0a9+R5eDjrG6zsCp5Q1pQRjfhaY/URYTgi6ny3qCrzbmXA@public.gmane.org>
2012-03-05 15:53                         ` Hal Rosenstock
     [not found]                           ` <4F54E177.9030302-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2012-03-05 17:25                             ` Doug Ledford
2012-03-01 22:46             ` Ira Weiny
     [not found]               ` <20120301144645.09aa0d80.weiny2-i2BcT+NCU+M@public.gmane.org>
2012-03-02 10:13                 ` Alex Netes
2012-03-02 10:30       ` Alex Netes
2012-03-02 15:31         ` Doug Ledford
     [not found]           ` <4F50E7CE.6050204-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-03-02 15:47             ` Doug Ledford [this message]
2012-03-05 20:51         ` Ira Weiny

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F50EB7E.20900@redhat.com \
    --to=dledford-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=alexne-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=hal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=weiny2-i2BcT+NCU+M@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox