From 0937dae15a93c3fe2d3429a54495aac4960816eb Mon Sep 17 00:00:00 2001 From: Christophe Varoqui Date: Thu, 3 May 2007 09:37:33 +0200 Subject: [all] Path group timeout handling The config file keyword is pg_timeout. Takes value in seconds. Default is none. Can be set in defaults, hardware or multipath configlets. From Redhat resync. --- libmultipath/configure.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'libmultipath/configure.c') diff --git a/libmultipath/configure.c b/libmultipath/configure.c index fba04a4..9632fb4 100644 --- a/libmultipath/configure.c +++ b/libmultipath/configure.c @@ -60,6 +60,7 @@ setup_map (struct multipath * mpp) select_rr_weight(mpp); select_minio(mpp); select_no_path_retry(mpp); + select_pg_timeout(mpp); /* * assign paths to path groups -- start with no groups and all paths @@ -174,8 +175,9 @@ select_action (struct multipath * mpp, vector curmp) mpp->alias); return; } - if (!mpp->no_path_retry && /* let features be handled by the daemon */ - strncmp(cmpp->features, mpp->features, strlen(mpp->features))) { + if (!mpp->no_path_retry && !mpp->pg_timeout && + (strlen(cmpp->features) != strlen(mpp->features) || + strcmp(cmpp->features, mpp->features))) { mpp->action = ACT_RELOAD; condlog(3, "%s: set ACT_RELOAD (features change)", mpp->alias); @@ -502,6 +504,12 @@ coalesce_paths (struct vectors * vecs, vector newmp, char * refwwid) else dm_queue_if_no_path(mpp->alias, 1); } + if (mpp->pg_timeout != PGTIMEOUT_UNDEF) { + if (mpp->pg_timeout == -PGTIMEOUT_NONE) + dm_set_pg_timeout(mpp->alias, 0); + else + dm_set_pg_timeout(mpp->alias, mpp->pg_timeout); + } if (newmp) { if (mpp->action != ACT_REJECT) { -- cgit v1.2.3