[ofa-general] [PATCH 5/7] Add --with-qos-policy-conf to configure

Ira Weiny weiny2 at llnl.gov
Tue Nov 13 16:08:48 PST 2007


>From 6df9c989499df81d87eec4251770e8b84c8dd4d3 Mon Sep 17 00:00:00 2001
From: Ira K. Weiny <weiny2 at llnl.gov>
Date: Sun, 11 Nov 2007 17:41:41 -0800
Subject: [PATCH] Add --with-qos-policy-conf to configure.

   As well as adding this option, change the default location/name for this
   file to be <sysconfdir>/<opensm-conf-sub-dir>/<file> to be consistent with
   other config files.

Signed-off-by: Ira K. Weiny <weiny2 at llnl.gov>
---
 opensm/configure.in              |   20 ++++++++++++++++++++
 opensm/include/opensm/osm_base.h |   14 +++++++++++---
 2 files changed, 31 insertions(+), 3 deletions(-)

diff --git a/opensm/configure.in b/opensm/configure.in
index f6b4dd1..14fd60a 100644
--- a/opensm/configure.in
+++ b/opensm/configure.in
@@ -112,6 +112,26 @@ AC_DEFINE_UNQUOTED(HAVE_DEFAULT_NODENAME_MAP,
 	["$CONF_DIR/$NODENAMEMAPFILE"],
 	[Define a default node name map file])
 
+dnl Check for a different QOS policy file
+QOS_POLICY_FILE=qos-policy.conf
+AC_MSG_CHECKING(for --with-qos-policy-conf)
+AC_ARG_WITH(qos-policy-conf,
+    AC_HELP_STRING([--with-qos-policy-conf=file],
+                   [define a QOS policy config file (default qos-policy.conf)]),
+    [ case "$withval" in
+    no)
+        ;;
+    *)
+        withqospolicyconf=yes
+        QOS_POLICY_FILE=$withval
+        ;;
+    esac ]
+)
+AC_MSG_RESULT(${withqospolicyconf=no})
+AC_DEFINE_UNQUOTED(HAVE_DEFAULT_QOS_POLICY_FILE,
+	["$CONF_DIR/$QOS_POLICY_FILE"],
+	[Define a QOS policy config file])
+
 dnl select example event plugin or not
 OPENIB_OSM_DEFAULT_EVENT_PLUGIN_SEL
 
diff --git a/opensm/include/opensm/osm_base.h b/opensm/include/opensm/osm_base.h
index 26ef067..c8695a0 100644
--- a/opensm/include/opensm/osm_base.h
+++ b/opensm/include/opensm/osm_base.h
@@ -48,6 +48,10 @@
 #ifndef _OSM_BASE_H_
 #define _OSM_BASE_H_
 
+#if HAVE_CONFIG_H
+#  include <config.h>
+#endif				/* HAVE_CONFIG_H */
+
 #ifdef __WIN__
 #include <vendor/winosm_common.h>
 #define OSM_CDECL __cdecl
@@ -236,9 +240,13 @@ BEGIN_C_DECLS
 */
 #ifdef __WIN__
 #define OSM_DEFAULT_QOS_POLICY_FILE strcat(GetOsmCachePath(), "osm-qos-policy.conf")
-#else
-#define OSM_DEFAULT_QOS_POLICY_FILE "/etc/ofa/opensm-qos-policy.conf"
-#endif
+#else /* !__WIN__ */
+#   ifdef HAVE_DEFAULT_QOS_POLICY_FILE
+#      define OSM_DEFAULT_QOS_POLICY_FILE HAVE_DEFAULT_QOS_POLICY_FILE
+#   else /* !HAVE_DEFAULT_QOS_POLICY_FILE */
+#      define OSM_DEFAULT_QOS_POLICY_FILE "/etc/ofa/opensm-qos-policy.conf"
+#   endif /* HAVE_DEFAULT_QOS_POLICY_FILE */
+#endif /* __WIN__ */
 /***********/
 
 /****d* OpenSM: Base/OSM_DEFAULT_SWEEP_INTERVAL_SECS
-- 
1.5.1

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-Add-with-qos-policy-conf-to-configure.patch
Type: application/octet-stream
Size: 2598 bytes
Desc: not available
URL: <http://lists.openfabrics.org/pipermail/general/attachments/20071113/34b65ec6/attachment.obj>


More information about the general mailing list