[ofw] Allow opensm to read the command line parameters

Tzachi Dar tzachid at mellanox.co.il
Mon Aug 16 13:42:39 PDT 2010


My fix is needed in order to make opensm params work. One can simply run "opensm --help" and see that it ignores it.

We can also fix the getopt. Does anyone know where is the Linux implementation of it?

Thanks
Tzachi

From: Smith, Stan [mailto:stan.smith at intel.com]
Sent: Monday, August 16, 2010 8:31 PM
To: Tzachi Dar; ofw at lists.openfabrics.org
Cc: Yevgeny Kliteynik
Subject: RE: Allow opensm to read the command line parameters

Tzachi,
  As  you know there are numerous differences between Windows OpenSM and the Linux OpenSM.

Some differences are being resolved slowly as the Linux community resists changes for Windows (no offense intended), while others likely will not be resolved as they are Windows environment issues (Windows Service creation/run interface vs. Linux daemon process creation interface).
Windows OpenSM is close, although some assembly is required; measured in differencing files and figuring out the 'right' choice, which used to take weeks and now is down to a few hours.
For each Linux OpenSM release, the Windows code base takes step in getting closer to the Linux OpenSM code base.
I don't disagree with your thoughts in that keeping the same code base is a win for all parties - work-in-progress.  :-)

The 'optind = 0; ' was required by getopt() to make the code work correctly.
I agree with Sean, that since OpenSM no longer has a local version of getopt() we should 'fix' the Windows getopt() to correctly handle the situation if that is the correct direction.

stan.

________________________________
From: ofw-bounces at lists.openfabrics.org [mailto:ofw-bounces at lists.openfabrics.org] On Behalf Of Tzachi Dar
Sent: Monday, August 16, 2010 5:30 AM
To: ofw at lists.openfabrics.org
Cc: Yevgeny Kliteynik
Subject: [ofw] Allow opensm to read the command line parameters
Please note that although  this solution works for opensm it creates a change from the Linux code base.
A different solution might be needed if we want to keep the same code base .

Thanks
Tzachi


Index: opensm/main.c
===================================================================
--- opensm/main.c          (revision 6229)
+++ opensm/main.c       (working copy)
@@ -725,7 +725,7 @@
                                }
                } while (next_option != -1);

-              optind = 0;                          /* reset command line */
+             optind = 1;                          /* reset command line */

                if (config_file && osm_subn_parse_conf_file(config_file, &opt) < 0)
                                printf("\nFail to parse config file \'%s\'\n", config_file);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20100816/e9abcf23/attachment.html>


More information about the ofw mailing list