2009-10-27 09:58:59 +00:00
|
|
|
From 8191fb07d8212e29ad44370abb60e174e1c34bb5 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Fabio M. Di Nitto <fdinitto@redhat.com>
|
|
|
|
Date: Tue, 13 Oct 2009 08:15:15 +0200
|
|
|
|
Subject: [PATCH 01/12] RH: queue without daemon
|
|
|
|
|
|
|
|
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
|
2009-07-29 22:54:07 +00:00
|
|
|
---
|
2009-10-27 09:58:59 +00:00
|
|
|
:100644 100644 50a728c... 86b1320... M libmultipath/config.h
|
|
|
|
:100644 100644 ee4de68... 7888e8e... M libmultipath/dict.c
|
|
|
|
:100644 100644 afd1246... 2e7a0d1... M libmultipath/structs.h
|
|
|
|
:100644 100644 c222da4... 9afa615... M multipath.conf.annotated
|
|
|
|
:100644 100644 3e0fd6e... 44d1329... M multipath.conf.synthetic
|
|
|
|
:100644 100644 41a9bd0... 90de6df... M multipathd/main.c
|
2009-07-29 22:54:07 +00:00
|
|
|
libmultipath/config.h | 1 +
|
|
|
|
libmultipath/dict.c | 35 +++++++++++++++++++++++++++++++++++
|
|
|
|
libmultipath/structs.h | 6 ++++++
|
|
|
|
multipath.conf.annotated | 9 +++++++++
|
|
|
|
multipath.conf.synthetic | 1 +
|
|
|
|
multipathd/main.c | 5 +++++
|
2009-10-27 09:58:59 +00:00
|
|
|
6 files changed, 57 insertions(+), 0 deletions(-)
|
2009-07-29 22:54:07 +00:00
|
|
|
|
2010-01-23 01:39:39 +00:00
|
|
|
Index: multipath-tools/libmultipath/config.h
|
|
|
|
===================================================================
|
|
|
|
--- multipath-tools.orig/libmultipath/config.h
|
|
|
|
+++ multipath-tools/libmultipath/config.h
|
|
|
|
@@ -74,6 +74,7 @@ struct config {
|
2009-07-29 22:54:07 +00:00
|
|
|
int pg_timeout;
|
|
|
|
int max_fds;
|
|
|
|
int force_reload;
|
|
|
|
+ int queue_without_daemon;
|
|
|
|
int daemon;
|
|
|
|
int flush_on_last_del;
|
|
|
|
int attribute_flags;
|
2010-01-23 01:39:39 +00:00
|
|
|
Index: multipath-tools/libmultipath/dict.c
|
|
|
|
===================================================================
|
|
|
|
--- multipath-tools.orig/libmultipath/dict.c
|
|
|
|
+++ multipath-tools/libmultipath/dict.c
|
|
|
|
@@ -362,6 +362,28 @@ def_no_path_retry_handler(vector strvec)
|
2009-07-29 22:54:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
+def_queue_without_daemon(vector strvec)
|
|
|
|
+{
|
|
|
|
+ char * buff;
|
|
|
|
+
|
|
|
|
+ buff = set_value(strvec);
|
|
|
|
+ if (!buff)
|
|
|
|
+ return 1;
|
|
|
|
+
|
|
|
|
+ if (!strncmp(buff, "off", 3) || !strncmp(buff, "no", 2) ||
|
|
|
|
+ !strncmp(buff, "0", 1))
|
|
|
|
+ conf->queue_without_daemon = QUE_NO_DAEMON_OFF;
|
|
|
|
+ else if (!strncmp(buff, "on", 2) || !strncmp(buff, "yes", 3) ||
|
|
|
|
+ !strncmp(buff, "1", 1))
|
|
|
|
+ conf->queue_without_daemon = QUE_NO_DAEMON_ON;
|
|
|
|
+ else
|
|
|
|
+ conf->queue_without_daemon = QUE_NO_DAEMON_UNDEF;
|
|
|
|
+
|
|
|
|
+ free(buff);
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static int
|
|
|
|
def_pg_timeout_handler(vector strvec)
|
|
|
|
{
|
|
|
|
int pg_timeout;
|
2010-01-23 01:39:39 +00:00
|
|
|
@@ -1944,6 +1966,18 @@ snprint_def_no_path_retry (char * buff,
|
2009-07-29 22:54:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
+snprint_def_queue_without_daemon (char * buff, int len, void * data)
|
|
|
|
+{
|
|
|
|
+ switch (conf->queue_without_daemon) {
|
|
|
|
+ case QUE_NO_DAEMON_OFF:
|
|
|
|
+ return snprintf(buff, len, "no");
|
|
|
|
+ case QUE_NO_DAEMON_ON:
|
|
|
|
+ return snprintf(buff, len, "yes");
|
|
|
|
+ }
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static int
|
|
|
|
snprint_def_pg_timeout (char * buff, int len, void * data)
|
|
|
|
{
|
|
|
|
if (conf->pg_timeout == DEFAULT_PGTIMEOUT)
|
2010-01-23 01:39:39 +00:00
|
|
|
@@ -2029,6 +2063,7 @@ init_keywords(void)
|
2009-07-29 22:54:07 +00:00
|
|
|
install_keyword("max_fds", &max_fds_handler, &snprint_max_fds);
|
|
|
|
install_keyword("rr_weight", &def_weight_handler, &snprint_def_rr_weight);
|
|
|
|
install_keyword("no_path_retry", &def_no_path_retry_handler, &snprint_def_no_path_retry);
|
|
|
|
+ install_keyword("queue_without_daemon", &def_queue_without_daemon, &snprint_def_queue_without_daemon);
|
|
|
|
install_keyword("pg_timeout", &def_pg_timeout_handler, &snprint_def_pg_timeout);
|
|
|
|
install_keyword("flush_on_last_del", &def_flush_on_last_del_handler, &snprint_def_flush_on_last_del);
|
|
|
|
install_keyword("user_friendly_names", &names_handler, &snprint_def_user_friendly_names);
|
2010-01-23 01:39:39 +00:00
|
|
|
Index: multipath-tools/libmultipath/structs.h
|
|
|
|
===================================================================
|
|
|
|
--- multipath-tools.orig/libmultipath/structs.h
|
|
|
|
+++ multipath-tools/libmultipath/structs.h
|
2009-07-29 22:54:07 +00:00
|
|
|
@@ -63,6 +63,12 @@ enum pgstates {
|
|
|
|
PGSTATE_ACTIVE
|
|
|
|
};
|
|
|
|
|
|
|
|
+enum queue_without_daemon_states {
|
|
|
|
+ QUE_NO_DAEMON_UNDEF,
|
|
|
|
+ QUE_NO_DAEMON_OFF,
|
|
|
|
+ QUE_NO_DAEMON_ON,
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
enum pgtimeouts {
|
|
|
|
PGTIMEOUT_UNDEF,
|
|
|
|
PGTIMEOUT_NONE
|
2010-01-23 01:39:39 +00:00
|
|
|
Index: multipath-tools/multipath.conf.annotated
|
|
|
|
===================================================================
|
|
|
|
--- multipath-tools.orig/multipath.conf.annotated
|
|
|
|
+++ multipath-tools/multipath.conf.annotated
|
2009-10-27 09:58:59 +00:00
|
|
|
@@ -153,6 +153,15 @@
|
2009-07-29 22:54:07 +00:00
|
|
|
# no_path_retry queue
|
|
|
|
#
|
|
|
|
# #
|
|
|
|
+# # name : queue_without_daemon
|
|
|
|
+# # scope : multipathd
|
|
|
|
+# # desc : If set to "no", multipathd will disable queueing for all
|
|
|
|
+# # devices when it is shut down.
|
|
|
|
+# # values : yes|no
|
|
|
|
+# # default : yes
|
|
|
|
+# queue_without_daemon no
|
|
|
|
+#
|
|
|
|
+# #
|
|
|
|
# # name : user_friendly_names
|
|
|
|
# # scope : multipath
|
|
|
|
# # desc : If set to "yes", using the bindings file
|
2010-01-23 01:39:39 +00:00
|
|
|
Index: multipath-tools/multipath.conf.synthetic
|
|
|
|
===================================================================
|
|
|
|
--- multipath-tools.orig/multipath.conf.synthetic
|
|
|
|
+++ multipath-tools/multipath.conf.synthetic
|
2009-07-29 22:54:07 +00:00
|
|
|
@@ -16,6 +16,7 @@
|
|
|
|
# rr_weight priorities
|
|
|
|
# failback immediate
|
|
|
|
# no_path_retry fail
|
|
|
|
+# queue_without_daemon no
|
|
|
|
# user_friendly_names no
|
|
|
|
# mode 644
|
|
|
|
# uid 0
|
2010-01-23 01:39:39 +00:00
|
|
|
Index: multipath-tools/multipathd/main.c
|
|
|
|
===================================================================
|
|
|
|
--- multipath-tools.orig/multipathd/main.c
|
|
|
|
+++ multipath-tools/multipathd/main.c
|
2009-07-29 22:54:07 +00:00
|
|
|
@@ -1334,6 +1334,8 @@ child (void * param)
|
|
|
|
pthread_t check_thr, uevent_thr, uxlsnr_thr;
|
|
|
|
pthread_attr_t log_attr, misc_attr;
|
|
|
|
struct vectors * vecs;
|
|
|
|
+ struct multipath * mpp;
|
|
|
|
+ int i;
|
|
|
|
|
|
|
|
mlockall(MCL_CURRENT | MCL_FUTURE);
|
|
|
|
|
|
|
|
@@ -1422,6 +1424,9 @@ child (void * param)
|
|
|
|
*/
|
|
|
|
block_signal(SIGHUP, NULL);
|
|
|
|
lock(vecs->lock);
|
|
|
|
+ if (conf->queue_without_daemon == QUE_NO_DAEMON_OFF)
|
|
|
|
+ vector_foreach_slot(vecs->mpvec, mpp, i)
|
|
|
|
+ dm_queue_if_no_path(mpp->alias, 0);
|
|
|
|
remove_maps_and_stop_waiters(vecs);
|
|
|
|
free_pathvec(vecs->pathvec, FREE_PATHS);
|
|
|
|
|