[libmultipath] blacklist exceptions
On IBM System z we often have the problem that we have attached
several hundred devices. In case we want to use only a few of them
with mp-tools, we have to blacklist all others. For that reason I have
introduced a blacklist_exceptions keyword for the multipath.conf which
fills an internal exception list.
Additionally this patch adds two commands to the multipathd cli to
display blacklist rules and blacklisted devices.
A multipath.conf like:
------------------- snip --------------------
blacklist {
devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
devnode "^hd[a-z][[0-9]*]"
devnode "^cciss!c[0-9]d[0-9]*[p[0-9]*]"
devnode "^dasd[a-z]+[0-9]*"
}
blacklist_exceptions {
devnode "^dasd[c-d]+[0-9]*"
}
------------------- snap --------------------
All DASD devices are blacklisted except dasdc and
dasdd and corresponding partitions, which are listed in
the blacklist:exceptions section.
This example would produce the following output in the
"multipathd -k" cli:
------------------- snip --------------------
multipathd> show blacklist
device node rules:
- blacklist:
(config file rule) ^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*
(config file rule) ^hd[a-z][[0-9]*]
(config file rule) ^cciss!c[0-9]d[0-9]*[p[0-9]*]
(config file rule) ^dasd[a-z]+[0-9]*
(default rule) ^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*
(default rule) ^hd[a-z]
(default rule) ^cciss!c[0-9]d[0-9]*
- exceptions:
(config file rule) ^dasd[c-d]+[0-9]*
wwid rules:
- blacklist:
<empty>
- exceptions:
<empty>
device rules:
- blacklist:
(default rule) DGC:LUNZ
multipathd>
multipathd> show devices
available block devices:
dasda (blacklisted)
dasdb (blacklisted)
dasdc
dasdd
dm-0 (blacklisted)
dm-1 (blacklisted)
dm-2 (blacklisted)
dm-3 (blacklisted)
dm-4 (blacklisted)
dm-5 (blacklisted)
dm-6 (blacklisted)
loop0 (blacklisted)
loop1 (blacklisted)
loop2 (blacklisted)
loop3 (blacklisted)
loop4 (blacklisted)
loop5 (blacklisted)
loop6 (blacklisted)
loop7 (blacklisted)
ram0 (blacklisted)
ram10 (blacklisted)
ram11 (blacklisted)
ram12 (blacklisted)
ram13 (blacklisted)
ram14 (blacklisted)
ram15 (blacklisted)
ram1 (blacklisted)
ram2 (blacklisted)
ram3 (blacklisted)
ram4 (blacklisted)
ram5 (blacklisted)
ram6 (blacklisted)
ram7 (blacklisted)
ram8 (blacklisted)
ram9 (blacklisted)
sda
sdb
sdc
sdd
multipathd>
------------------- snap --------------------
Signed-off-by: Volker Sameske <sameske@de.ibm.com>
17 files changed: