Bottom: a8e8aa49b3591176bc809c876eb5943ae719ce0d
-Top: a8e8aa49b3591176bc809c876eb5943ae719ce0d
+Top: d65a2839777e9248477661e92509a1f24ef35537
Author: Sean Hefty <sean.hefty@intel.com>
Date: 2011-01-20 09:30:45 -0800
Define option to auto-generate addresses
-Add an option to the acm_opts.cfg file to instruct the ib_acm
-service to automatically generate the address list. This will
-make it easier to support dynamic changes to system configuration.
+Add an option that instructs the ib_acm service to automatically
+generate the address configureation file. This will
+make it easier to handle dynamic changes to system configuration.
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
---
-
+diff --git a/man/ib_acm.1 b/man/ib_acm.1
+index acf6a1d..16d899d 100644
+--- a/man/ib_acm.1
++++ b/man/ib_acm.1
+@@ -4,8 +4,25 @@ ib_acm \- address and route resolution services for InfiniBand.
+ .SH SYNOPSIS
+ .sp
+ .nf
+-\fIib_acm\fR
++\fIib_acm\fR [-D] [-A addr_file] [-a] [-O option_file]
+ .fi
++.SH "OPTIONS"
++.TP
++\-D
++Runs the ib_acm service as a daemon.
++.TP
++\-A addr_file
++Specifies the address configuration file. The ib_acm service uses the
++contents of this file to assign addresses to local devices and ports.
++.TP
++\-a
++If specified, indicates that the ib_acm service should automatically
++generate the address configuration file and update it based on certain
++network events.
++.TP
++\-O option_file
++Specifies the option configuration file. The ib_acm service uses the
++contents of this file to override any default configuration options.
+ .SH "DESCRIPTION"
+ The IB ACM implements and provides a framework for name,
+ address, and route (path) resolution services over InfiniBand.
+diff --git a/src/acm.c b/src/acm.c
+index 1f3c470..0338e80 100644
+--- a/src/acm.c
++++ b/src/acm.c
+@@ -209,6 +209,7 @@ PER_THREAD char log_data[ACM_MAX_ADDRESS];
+
+ static char *opts_file = "/etc/ibacm/acm_opts.cfg";
+ static char *addr_file = "/etc/ibacm/acm_addr.cfg";
++static int auto_addr = 0;
+ static char log_file[128] = "/var/log/ibacm.log";
+ static int log_level = 0;
+ static char lock_file[128] = "/var/lock/ibacm.pid";
+@@ -2861,7 +2862,7 @@ static FILE *acm_open_addr_file(void)
+ {
+ FILE *f;
+
+- if ((f = fopen(addr_file, "r")))
++ if (!auto_addr && (f = fopen(addr_file, "r")))
+ return f;
+
+ acm_log(0, "notice - generating acm_addr.cfg file\n");
+@@ -2920,6 +2921,7 @@ static void show_usage(char *program)
+ printf(" [-D] - run as a daemon\n");
+ printf(" [-A addr_file] - address configuration file\n");
+ printf(" (default %s/%s\n", ACM_DEST_DIR, ACM_ADDR_FILE);
++ printf(" [-a] - automatically generate and update addresses\n");
+ printf(" [-O option_file] - option configuration file\n");
+ printf(" (default %s/%s\n", ACM_DEST_DIR, ACM_OPTS_FILE);
+ }
+@@ -2938,6 +2940,9 @@ int CDECL_FUNC main(int argc, char **argv)
+ case 'A':
+ addr_file = optarg;
+ break;
++ case 'a':
++ auto_addr = 1;
++ break;
+ case 'O':
+ opts_file = optarg;
+ break;
+++ /dev/null
-Bottom: a8e8aa49b3591176bc809c876eb5943ae719ce0d
-Top: d65a2839777e9248477661e92509a1f24ef35537
-Author: Sean Hefty <sean.hefty@intel.com>
-Date: 2011-01-20 11:32:27 -0800
-
-Refresh of autoaddr
-
----
-
-diff --git a/man/ib_acm.1 b/man/ib_acm.1
-index acf6a1d..16d899d 100644
---- a/man/ib_acm.1
-+++ b/man/ib_acm.1
-@@ -4,8 +4,25 @@ ib_acm \- address and route resolution services for InfiniBand.
- .SH SYNOPSIS
- .sp
- .nf
--\fIib_acm\fR
-+\fIib_acm\fR [-D] [-A addr_file] [-a] [-O option_file]
- .fi
-+.SH "OPTIONS"
-+.TP
-+\-D
-+Runs the ib_acm service as a daemon.
-+.TP
-+\-A addr_file
-+Specifies the address configuration file. The ib_acm service uses the
-+contents of this file to assign addresses to local devices and ports.
-+.TP
-+\-a
-+If specified, indicates that the ib_acm service should automatically
-+generate the address configuration file and update it based on certain
-+network events.
-+.TP
-+\-O option_file
-+Specifies the option configuration file. The ib_acm service uses the
-+contents of this file to override any default configuration options.
- .SH "DESCRIPTION"
- The IB ACM implements and provides a framework for name,
- address, and route (path) resolution services over InfiniBand.
-diff --git a/src/acm.c b/src/acm.c
-index 1f3c470..0338e80 100644
---- a/src/acm.c
-+++ b/src/acm.c
-@@ -209,6 +209,7 @@ PER_THREAD char log_data[ACM_MAX_ADDRESS];
-
- static char *opts_file = "/etc/ibacm/acm_opts.cfg";
- static char *addr_file = "/etc/ibacm/acm_addr.cfg";
-+static int auto_addr = 0;
- static char log_file[128] = "/var/log/ibacm.log";
- static int log_level = 0;
- static char lock_file[128] = "/var/lock/ibacm.pid";
-@@ -2861,7 +2862,7 @@ static FILE *acm_open_addr_file(void)
- {
- FILE *f;
-
-- if ((f = fopen(addr_file, "r")))
-+ if (!auto_addr && (f = fopen(addr_file, "r")))
- return f;
-
- acm_log(0, "notice - generating acm_addr.cfg file\n");
-@@ -2920,6 +2921,7 @@ static void show_usage(char *program)
- printf(" [-D] - run as a daemon\n");
- printf(" [-A addr_file] - address configuration file\n");
- printf(" (default %s/%s\n", ACM_DEST_DIR, ACM_ADDR_FILE);
-+ printf(" [-a] - automatically generate and update addresses\n");
- printf(" [-O option_file] - option configuration file\n");
- printf(" (default %s/%s\n", ACM_DEST_DIR, ACM_OPTS_FILE);
- }
-@@ -2938,6 +2940,9 @@ int CDECL_FUNC main(int argc, char **argv)
- case 'A':
- addr_file = optarg;
- break;
-+ case 'a':
-+ auto_addr = 1;
-+ break;
- case 'O':
- opts_file = optarg;
- break;