@@ -2018,15 +2018,20 @@ int
get_state (struct path * pp)
{
struct checker * c = &pp->checker;
- int state;
+ int state, lvl;
state = checker_get_state(c);
- condlog(3, "%s: %s state = %s", pp->dev,
+
+ lvl = state == pp->oldstate || state == PATH_PENDING ? 4 : 3;
+ condlog(lvl, "%s: %s state = %s", pp->dev,
checker_name(c), checker_state_name(state));
if (state != PATH_UP && state != PATH_GHOST &&
strlen(checker_message(c)))
- condlog(3, "%s: %s checker%s",
+ condlog(lvl, "%s: %s checker%s",
pp->dev, checker_name(c), checker_message(c));
+ if (state != PATH_PENDING)
+ pp->oldstate = state;
+
return state;
}
@@ -375,6 +375,7 @@ struct path {
int state;
int dmstate;
int chkrstate;
+ int oldstate;
int failcount;
int priority;
int pgindex;
Even at verbosity level 3, it isn't interesting and actually disturbing to see every successful state and pending state logged by multipathd. Suppress these messages at level 3. Signed-off-by: Martin Wilck <mwilck@suse.com> --- libmultipath/discovery.c | 11 ++++++++--- libmultipath/structs.h | 1 + 2 files changed, 9 insertions(+), 3 deletions(-)