Use state name in get_state()
authorHannes Reinecke <hare@suse.de>
Wed, 18 May 2011 07:34:13 +0000 (09:34 +0200)
committerHannes Reinecke <hare@suse.de>
Wed, 18 May 2011 07:34:13 +0000 (09:34 +0200)
Rather than to display the numerical value we should be returning
the path status string.

Signed-off-by: Hannes Reinecke <hare@suse.de>
libmultipath/discovery.c

index 3bcd7f9..ef4e2a9 100644 (file)
@@ -806,7 +806,7 @@ get_state (struct path * pp, int daemon)
        if (!conf->checker_timeout)
                sysfs_get_timeout(pp->sysdev, &(c->timeout));
        state = checker_check(c);
        if (!conf->checker_timeout)
                sysfs_get_timeout(pp->sysdev, &(c->timeout));
        state = checker_check(c);
-       condlog(3, "%s: state = %i", pp->dev, state);
+       condlog(3, "%s: state = %s", pp->dev, checker_state_name(state));
        if (state == PATH_DOWN && strlen(checker_message(c)))
                condlog(3, "%s: checker msg is \"%s\"",
                        pp->dev, checker_message(c));
        if (state == PATH_DOWN && strlen(checker_message(c)))
                condlog(3, "%s: checker msg is \"%s\"",
                        pp->dev, checker_message(c));