diff options
author | NeilBrown <neilb@suse.com> | 2015-07-27 03:01:08 +0200 |
---|---|---|
committer | NeilBrown <neilb@suse.com> | 2015-07-27 03:01:08 +0200 |
commit | 653299b6991b0a3a5a136d4f547e7675980c9095 (patch) | |
tree | 939ba768702dd86c67a0acdda880da4982cff290 /config.c | |
parent | Release mdadm-3.3.3 (diff) | |
parent | Reuse calc_bitmap_size to reduce code size (diff) | |
download | mdadm-653299b6991b0a3a5a136d4f547e7675980c9095.tar.xz mdadm-653299b6991b0a3a5a136d4f547e7675980c9095.zip |
Merge branch 'cluster'
Now that 3.3.3 is out, it is time to include the cluster-support code.
Signed-off-by: NeilBrown <neilb@suse.com>
Diffstat (limited to 'config.c')
-rw-r--r-- | config.c | 27 |
1 files changed, 26 insertions, 1 deletions
@@ -77,7 +77,7 @@ char DefaultAltConfFile[] = CONFFILE2; char DefaultAltConfDir[] = CONFFILE2 ".d"; enum linetype { Devices, Array, Mailaddr, Mailfrom, Program, CreateDev, - Homehost, AutoMode, Policy, PartPolicy, LTEnd }; + Homehost, HomeCluster, AutoMode, Policy, PartPolicy, LTEnd }; char *keywords[] = { [Devices] = "devices", [Array] = "array", @@ -86,6 +86,7 @@ char *keywords[] = { [Program] = "program", [CreateDev]= "create", [Homehost] = "homehost", + [HomeCluster] = "homecluster", [AutoMode] = "auto", [Policy] = "policy", [PartPolicy]="part-policy", @@ -562,6 +563,21 @@ void homehostline(char *line) } } +static char *home_cluster = NULL; +void homeclusterline(char *line) +{ + char *w; + + for (w=dl_next(line); w != line ; w=dl_next(w)) { + if (home_cluster == NULL) { + if (strcasecmp(w, "<none>")==0) + home_cluster = xstrdup(""); + else + home_cluster = xstrdup(w); + } + } +} + char auto_yes[] = "yes"; char auto_no[] = "no"; char auto_homehost[] = "homehost"; @@ -724,6 +740,9 @@ void conf_file(FILE *f) case Homehost: homehostline(line); break; + case HomeCluster: + homeclusterline(line); + break; case AutoMode: autoline(line); break; @@ -884,6 +903,12 @@ char *conf_get_homehost(int *require_homehostp) return home_host; } +char *conf_get_homecluster(void) +{ + load_conffile(); + return home_cluster; +} + struct createinfo *conf_get_create_info(void) { load_conffile(); |