diff options
author | Christophe Varoqui <christophe.varoqui@opensvc.com> | 2010-01-21 23:46:19 +0100 |
---|---|---|
committer | Christophe Varoqui <christophe.varoqui@opensvc.com> | 2010-01-22 00:32:33 +0100 |
commit | 61f573527edafcb41a6eca52d779d2744fe00c56 (patch) | |
tree | 25d0cc7d4e9099e11aa245aa1920ab62923be7a3 | |
parent | 179576b74716600e7738290a3a51158648a2be50 (diff) | |
download | multipath-tools-61f573527edafcb41a6eca52d779d2744fe00c56.tar.gz multipath-tools-61f573527edafcb41a6eca52d779d2744fe00c56.tar.bz2 multipath-tools-61f573527edafcb41a6eca52d779d2744fe00c56.zip |
[lib] don't pretend config file has setup parameters
we already have fallbacks coming from propsel.c functions.
This change make 'multipath -v3' correctly report what set
the value of a parameter (mpe, hwe, cf or internal)
-rw-r--r-- | libmultipath/config.c | 22 | ||||
-rw-r--r-- | libmultipath/propsel.c | 24 |
2 files changed, 22 insertions, 24 deletions
diff --git a/libmultipath/config.c b/libmultipath/config.c index e7e962e..fbe2125 100644 --- a/libmultipath/config.c +++ b/libmultipath/config.c @@ -520,32 +520,12 @@ load_config (char * file) if (!conf->mptable) goto out; } - if (conf->selector == NULL) - conf->selector = set_default(DEFAULT_SELECTOR); - if (conf->udev_dir == NULL) conf->udev_dir = set_default(DEFAULT_UDEVDIR); - if (conf->getuid == NULL) - conf->getuid = set_default(DEFAULT_GETUID); - - if (conf->features == NULL) - conf->features = set_default(DEFAULT_FEATURES); - - if (conf->hwhandler == NULL) - conf->hwhandler = set_default(DEFAULT_HWHANDLER); - - if (!conf->selector || !conf->udev_dir || !conf->multipath_dir || - !conf->getuid || !conf->features || - !conf->hwhandler) + if (!conf->udev_dir || !conf->multipath_dir) goto out; - if (!conf->prio_name) - conf->prio_name = set_default(DEFAULT_PRIO); - - if (!conf->checker_name) - conf->checker_name = set_default(DEFAULT_CHECKER); - return 0; out: free_config(conf); diff --git a/libmultipath/propsel.c b/libmultipath/propsel.c index b534ae2..efaa31b 100644 --- a/libmultipath/propsel.c +++ b/libmultipath/propsel.c @@ -203,7 +203,13 @@ select_selector (struct multipath * mp) mp->alias, mp->selector); return 0; } - mp->selector = conf->selector; + if (conf->selector) { + mp->selector = conf->selector; + condlog(3, "%s: selector = %s (config file default)", + mp->alias, mp->selector); + return 0; + } + mp->selector = set_default(DEFAULT_SELECTOR); condlog(3, "%s: selector = %s (internal default)", mp->alias, mp->selector); return 0; @@ -244,7 +250,13 @@ select_features (struct multipath * mp) mp->alias, mp->features); return 0; } - mp->features = conf->features; + if (conf->features) { + mp->features = conf->features; + condlog(3, "%s: features = %s (config file default)", + mp->alias, mp->features); + return 0; + } + mp->features = set_default(DEFAULT_FEATURES); condlog(3, "%s: features = %s (internal default)", mp->alias, mp->features); return 0; @@ -259,7 +271,13 @@ select_hwhandler (struct multipath * mp) mp->alias, mp->hwhandler); return 0; } - mp->hwhandler = conf->hwhandler; + if (conf->hwhandler) { + mp->hwhandler = conf->hwhandler; + condlog(3, "%s: hwhandler = %s (config file default)", + mp->alias, mp->hwhandler); + return 0; + } + mp->hwhandler = set_default(DEFAULT_HWHANDLER); condlog(3, "%s: hwhandler = %s (internal default)", mp->alias, mp->hwhandler); return 0; |