1 From 61b2002c6b2752c15b431e400cd614edc8c5b039 Mon Sep 17 00:00:00 2001
2 From: Fabio M. Di Nitto <fdinitto@redhat.com>
3 Date: Mon, 19 Oct 2009 07:05:45 +0200
4 Subject: [PATCH 09/12] RH: multipathd blacklist all by default
6 If there is no configuration installed on the system, blacklist
11 Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
13 :100644 100644 e7e962e... 5aa1ab0... M libmultipath/config.c
14 :100644 100644 86b1320... 7e90e75... M libmultipath/config.h
15 libmultipath/config.c | 18 +++++++++++++++++-
16 libmultipath/config.h | 1 +
17 2 files changed, 18 insertions(+), 1 deletions(-)
19 diff --git a/libmultipath/config.c b/libmultipath/config.c
20 index e7e962e..5aa1ab0 100644
21 --- a/libmultipath/config.c
22 +++ b/libmultipath/config.c
24 #include "blacklist.h"
30 hwe_strmatch (struct hwentry *hwe1, struct hwentry *hwe2)
31 @@ -463,8 +464,23 @@ load_config (char * file)
32 condlog(0, "error parsing config file");
36 + condlog(0, "/etc/multipath.conf does not exist, blacklisting all devices.");
37 + condlog(0, "A default multipath.conf file is located at");
39 +"/usr/share/doc/device-mapper-multipath-%d.%d.%d/multipath.conf",
40 + MULTIPATH_VERSION(VERSION_CODE));
41 + conf->blist_devnode = vector_alloc();
42 + if (!conf->blist_devnode) {
43 + condlog(0, "cannot allocate blacklist\n");
46 + if (store_ble(conf->blist_devnode, strdup(".*"),
47 + ORIGIN_NO_CONFIG)) {
48 + condlog(0, "cannot store default no-config blacklist\n");
54 * remove duplica in hwtable. config file takes precedence
55 * over build-in hwtable
56 diff --git a/libmultipath/config.h b/libmultipath/config.h
57 index 86b1320..7e90e75 100644
58 --- a/libmultipath/config.h
59 +++ b/libmultipath/config.h
62 #define ORIGIN_DEFAULT 0
63 #define ORIGIN_CONFIG 1
64 +#define ORIGIN_NO_CONFIG 2