summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2010-07-05 10:11:21 +1000
committerNeilBrown <neilb@suse.de>2010-09-06 11:03:43 +1000
commit5527fc74620ecc831d7c854c200e34211ceb63de (patch)
tree2c4801f0fe00c037607325078a1babfa015550a7 /config.c
parent8efb9d16ac4026ca237a2d887240543b1763b634 (diff)
Add policy framework.
Policy can be stated as lines in mdadm.conf like: POLICY type=disk path=pci-0000:00:1f.2-* action=ignore domain=onboard This defines two distinct policies which apply to any disk (but not partition) device reached through the pci device 0000:00:1f.2. The policies are "action=ignore" which means certain actions will ignore the device, and "domain=onboard" which means all such devices as treated as being united under the name 'onboard'. This patch just adds data structures and code to read and manipulate them. Future patches will actually use them. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'config.c')
-rw-r--r--config.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/config.c b/config.c
index 541a85d8..3baf7af4 100644
--- a/config.c
+++ b/config.c
@@ -75,7 +75,7 @@ char DefaultConfFile[] = CONFFILE;
char DefaultAltConfFile[] = CONFFILE2;
enum linetype { Devices, Array, Mailaddr, Mailfrom, Program, CreateDev,
- Homehost, AutoMode, LTEnd };
+ Homehost, AutoMode, Policy, PartPolicy, LTEnd };
char *keywords[] = {
[Devices] = "devices",
[Array] = "array",
@@ -85,6 +85,8 @@ char *keywords[] = {
[CreateDev]= "create",
[Homehost] = "homehost",
[AutoMode] = "auto",
+ [Policy] = "policy",
+ [PartPolicy]="part-policy",
[LTEnd] = NULL
};
@@ -767,6 +769,12 @@ void load_conffile(void)
case AutoMode:
autoline(line);
break;
+ case Policy:
+ policyline(line, rule_policy);
+ break;
+ case PartPolicy:
+ policyline(line, rule_part);
+ break;
default:
fprintf(stderr, Name ": Unknown keyword %s\n", line);
}