From: Yehuda Sadeh Date: Tue, 3 Mar 2009 01:19:47 +0000 (-0800) Subject: conf: fix erronous scoping X-Git-Tag: v0.7~67 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d9f8db25724708e7e9dd49b20c47f096441a0b05;p=ceph.git conf: fix erronous scoping --- diff --git a/src/config.cc b/src/config.cc index 5af8ebfe3a0..42ff71435e9 100644 --- a/src/config.cc +++ b/src/config.cc @@ -333,6 +333,10 @@ struct config_option { #define OPTION(section, name, schar, type, def_val) OPTION_##type(section, name, schar, type, def_val) +#define OPTION_ALT(section, conf_name, name, schar, type, def_val) \ + { STRINGIFY(section), NULL, STRINGIFY(conf_name), \ + &g_conf.name, STRINGIFY(def_val), type, schar } + static struct config_option config_optionsp[] = { OPTION(global, num_mon, 0, INT, 1), OPTION(global, num_mds, 0, INT, 1), @@ -382,11 +386,11 @@ static struct config_option config_optionsp[] = { OPTION(debug, debug_tp, 0, INT, 0), OPTION(clock, clock_lock, 0, BOOL, false), OPTION(clock, clock_tare, 0, BOOL, false), - OPTION(messenger, ms_tcp_nodelay, 0, BOOL, true), - OPTION(messenger, ms_retry_interval, 0, DOUBLE, 2.0), // how often to attempt reconnect - OPTION(messenger, ms_fail_interval, 0, DOUBLE, 15.0), // fail after this long - OPTION(messenger, ms_die_on_failure, 0, BOOL, false), - OPTION(messenger, ms_nocrc, 0, BOOL, false), + OPTION_ALT(messenger, tcp_nodelay, ms_tcp_nodelay, 0, BOOL, true), + OPTION_ALT(messenger, retry_interval, ms_retry_interval, 0, DOUBLE, 2.0), // how often to attempt reconnect + OPTION_ALT(messenger, fail_interval, ms_fail_interval, 0, DOUBLE, 15.0), // fail after this long + OPTION_ALT(messenger, die_on_failure, ms_die_on_failure, 0, BOOL, false), + OPTION_ALT(messenger, no_crc, ms_nocrc, 0, BOOL, false), OPTION(mon, mon_tick_interval, 0, INT, 5), OPTION(mon, mon_osd_down_out_interval, 0, INT, 5), // seconds OPTION(mon, mon_lease, 0, FLOAT, 5), // lease interval @@ -790,10 +794,10 @@ void parse_config_options(std::vector& args, bool open) break; } + } - if (optn == opt_len) + if (optn == opt_len) nargs.push_back(args[i]); - } } // open log file?