Search
j0ke.net Open Build Service
>
Projects
>
GFS
>
multipath-tools
> multipath-tools-quieten-callouts
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File multipath-tools-quieten-callouts of Package multipath-tools
commit c6a3f14a8921b897f8dca89595f0632dbdc0a24c Author: Hannes Reinecke <hare@suse.de> Date: Thu Mar 20 12:00:42 2008 +0100 Don't print failure messages for callouts by default Calling 'multipath -ll' on devices with paths results in lots of error messages; they really should be suppressed for the normal output. The user can always have them printed out by increasing verbosity. References: 358551 Signed-off-by: Hannes Reinecke <hare@suse.de> diff --git a/libmultipath/callout.c b/libmultipath/callout.c index d4bed07..8a2687b 100644 --- a/libmultipath/callout.c +++ b/libmultipath/callout.c @@ -10,6 +10,7 @@ #include <unistd.h> #include <sys/types.h> #include <stdlib.h> +#include <fcntl.h> #include <sys/wait.h> #include <errno.h> @@ -33,7 +34,7 @@ int execute_program(char *path, char *value, int len) int retval; int count; int status; - int fds[2]; + int fds[2], null_fd; pid_t pid; char *pos; char arg[PROGRAM_SIZE]; @@ -79,6 +80,14 @@ int execute_program(char *path, char *value, int len) if (dup(fds[1]) < 0) return -1; + /* Ignore writes to stderr */ + null_fd = open("/dev/null", O_WRONLY); + if (null_fd > 0){ + close(STDERR_FILENO); + dup(null_fd); + close(null_fd); + } + retval = execvp(argv[0], argv); exit(-1); diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c index 3d5d2cd..ea782c4 100644 --- a/libmultipath/discovery.c +++ b/libmultipath/discovery.c @@ -636,8 +636,8 @@ get_state (struct path * pp) } pp->state = checker_check(c); condlog(3, "%s: state = %i", pp->dev, pp->state); - if (pp->state == PATH_DOWN) - condlog(2, "%s: checker msg is \"%s\"", + if (pp->state == PATH_DOWN && strlen(checker_message(c))) + condlog(3, "%s: checker msg is \"%s\"", pp->dev, checker_message(c)); return 0; } @@ -655,7 +655,7 @@ get_prio (struct path * pp) } pp->priority = prio_getprio(pp->prio, pp); if (pp->priority < 0) { - condlog(0, "%s: %s prio error", pp->dev, prio_name(pp->prio)); + condlog(3, "%s: %s prio error", pp->dev, prio_name(pp->prio)); pp->priority = PRIO_UNDEF; return 1; } @@ -676,7 +676,7 @@ get_uid (struct path * pp) condlog(0, "error formatting uid callout command"); memset(pp->wwid, 0, WWID_SIZE); } else if (execute_program(buff, pp->wwid, WWID_SIZE)) { - condlog(0, "error calling out %s", buff); + condlog(3, "error calling out %s", buff); memset(pp->wwid, 0, WWID_SIZE); return 1; } diff --git a/libprio/alua.c b/libprio/alua.c index 64f41f7..32e9b05 100644 --- a/libprio/alua.c +++ b/libprio/alua.c @@ -21,6 +21,7 @@ #define ALUA_PRIO_NOT_SUPPORTED 1 #define ALUA_PRIO_RTPG_FAILED 2 #define ALUA_PRIO_GETAAS_FAILED 3 +#define ALUA_PRIO_TPGS_FAILED 4 int get_alua_info(int fd) @@ -37,7 +38,7 @@ get_alua_info(int fd) rc = get_target_port_group_support(fd); if (rc < 0) - return rc; + return -ALUA_PRIO_TPGS_FAILED; if (rc == TPGS_NONE) return -ALUA_PRIO_NOT_SUPPORTED; @@ -84,6 +85,9 @@ int prio_alua(struct path * pp) case ALUA_PRIO_GETAAS_FAILED: condlog(0, "%s: couln't get asymmetric access state", pp->dev); break; + case ALUA_PRIO_TPGS_FAILED: + condlog(3, "%s: couln't get supported alua states", pp->dev); + break; } } return rc;