]> git.ipfire.org Git - people/amarx/ipfire-3.x.git/blame - multipath-tools/patches/0009-RH-multipathd-blacklist-all-by-default.patch
ulogd2: Fix syntax error in makefile.
[people/amarx/ipfire-3.x.git] / multipath-tools / patches / 0009-RH-multipathd-blacklist-all-by-default.patch
CommitLineData
dc01aad8
SS
1From 61b2002c6b2752c15b431e400cd614edc8c5b039 Mon Sep 17 00:00:00 2001
2From: Fabio M. Di Nitto <fdinitto@redhat.com>
3Date: Mon, 19 Oct 2009 07:05:45 +0200
4Subject: [PATCH 09/12] RH: multipathd blacklist all by default
5
6If there is no configuration installed on the system, blacklist
7everything by default.
8
9BZ#528059
10
11Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
12---
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(-)
18
19diff --git a/libmultipath/config.c b/libmultipath/config.c
20index e7e962e..5aa1ab0 100644
21--- a/libmultipath/config.c
22+++ b/libmultipath/config.c
23@@ -19,6 +19,7 @@
24 #include "blacklist.h"
25 #include "defaults.h"
26 #include "prio.h"
27+#include "version.h"
28
29 static int
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");
33 goto out;
34 }
35+ } else {
36+ condlog(0, "/etc/multipath.conf does not exist, blacklisting all devices.");
37+ condlog(0, "A default multipath.conf file is located at");
38+ condlog(0,
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");
44+ goto out;
45+ }
46+ if (store_ble(conf->blist_devnode, strdup(".*"),
47+ ORIGIN_NO_CONFIG)) {
48+ condlog(0, "cannot store default no-config blacklist\n");
49+ goto out;
50+ }
51 }
52-
53 /*
54 * remove duplica in hwtable. config file takes precedence
55 * over build-in hwtable
56diff --git a/libmultipath/config.h b/libmultipath/config.h
57index 86b1320..7e90e75 100644
58--- a/libmultipath/config.h
59+++ b/libmultipath/config.h
60@@ -5,6 +5,7 @@
61
62 #define ORIGIN_DEFAULT 0
63 #define ORIGIN_CONFIG 1
64+#define ORIGIN_NO_CONFIG 2
65
66 enum devtypes {
67 DEV_NONE,
68--
691.6.5.1
70