From patchwork Wed Apr 29 04:41:34 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: bmarzins@sourceware.org X-Patchwork-Id: 20553 Received: from hormel.redhat.com (hormel1.redhat.com [209.132.177.33]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n3T4ft7t021895 for ; Wed, 29 Apr 2009 04:41:55 GMT Received: from listman.util.phx.redhat.com (listman.util.phx.redhat.com [10.8.4.110]) by hormel.redhat.com (Postfix) with ESMTP id 6E000619516; Wed, 29 Apr 2009 00:41:54 -0400 (EDT) Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by listman.util.phx.redhat.com (8.13.1/8.13.1) with ESMTP id n3T4fql5015213 for ; Wed, 29 Apr 2009 00:41:52 -0400 Received: from mx3.redhat.com (mx3.redhat.com [172.16.48.32]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n3T4fqrQ023810 for ; Wed, 29 Apr 2009 00:41:52 -0400 Received: from sourceware.org (sourceware.org [209.132.176.174]) by mx3.redhat.com (8.13.8/8.13.8) with SMTP id n3T4fY5J007630 for ; Wed, 29 Apr 2009 00:41:35 -0400 Received: (qmail 9578 invoked by uid 9475); 29 Apr 2009 04:41:34 -0000 Date: 29 Apr 2009 04:41:34 -0000 Message-ID: <20090429044134.9576.qmail@sourceware.org> From: bmarzins@sourceware.org To: dm-cvs@sourceware.org, dm-devel@redhat.com X-RedHat-Spam-Score: -3.949 X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 X-Scanned-By: MIMEDefang 2.63 on 172.16.48.32 X-loop: dm-devel@redhat.com Cc: Subject: [dm-devel] multipath-tools ./multipath.conf.annotated lib ... X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.5 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com CVSROOT: /cvs/dm Module name: multipath-tools Branch: RHEL5_FC6 Changes by: bmarzins@sourceware.org 2009-04-29 04:41:33 Modified files: . : multipath.conf.annotated libmultipath : config.c defaults.h dict.c Log message: Fix for bz #471854 Port of Hannes Reinecke's verbosity patch from upstream. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipath.conf.annotated.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.18.2.10&r2=1.18.2.11 http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/config.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.19.2.7&r2=1.19.2.8 http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/defaults.h.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.7&r2=1.7.2.1 http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/dict.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.17.2.9&r2=1.17.2.10 --- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel --- multipath-tools/multipath.conf.annotated 2009/01/16 22:47:31 1.18.2.10 +++ multipath-tools/multipath.conf.annotated 2009/04/29 04:41:32 1.18.2.11 @@ -16,6 +16,16 @@ # udev_dir /dev # # # +# # name : verbosity +# # scope : multipath & multipathd +# # desc : The verbosity level of the command. It can be overridden by +# # the -v command line option. +# # values : 0-6 +# # default : 2 +# # +# verbosity 3 +# +# # # # name : polling_interval # # scope : multipathd # # desc : interval between two path checks in seconds --- multipath-tools/libmultipath/config.c 2008/09/04 20:09:48 1.19.2.7 +++ multipath-tools/libmultipath/config.c 2009/04/29 04:41:33 1.19.2.8 @@ -407,7 +407,7 @@ * internal defaults */ if (!conf->verbosity) - conf->verbosity = 2; + conf->verbosity = DEFAULT_VERBOSITY; conf->dev_type = DEV_NONE; conf->minio = 1000; --- multipath-tools/libmultipath/defaults.h 2006/06/06 18:32:43 1.7 +++ multipath-tools/libmultipath/defaults.h 2009/04/29 04:41:33 1.7.2.1 @@ -11,6 +11,7 @@ #define DEFAULT_NO_PATH_RETRY NO_PATH_RETRY_UNDEF #define DEFAULT_PGTIMEOUT -PGTIMEOUT_NONE #define DEFAULT_USER_FRIENDLY_NAMES 0 +#define DEFAULT_VERBOSITY 2 #define DEFAULT_CHECKINT 5 #define MAX_CHECKINT(a) (a << 2) --- multipath-tools/libmultipath/dict.c 2008/12/02 20:24:24 1.17.2.9 +++ multipath-tools/libmultipath/dict.c 2009/04/29 04:41:33 1.17.2.10 @@ -35,6 +35,17 @@ } static int +verbosity_handler(vector strvec) +{ + char * buff; + + buff = VECTOR_SLOT(strvec, 1); + conf->verbosity = atoi(buff); + + return 0; +} + +static int udev_dir_handler(vector strvec) { conf->udev_dir = set_value(strvec); @@ -1651,6 +1662,14 @@ } static int +snprint_def_verbosity (char * buff, int len, void * data) +{ + if (conf->checkint == DEFAULT_VERBOSITY) + return 0; + return snprintf(buff, len, "%i", conf->verbosity); +} + +static int snprint_def_udev_dir (char * buff, int len, void * data) { if (!conf->udev_dir) @@ -1927,6 +1946,8 @@ init_keywords(void) { install_keyword_root("defaults", NULL); + install_keyword("verbosity", &verbosity_handler, &snprint_def_verbosity) +; install_keyword("polling_interval", &polling_interval_handler, &snprint_def_polling_interval); install_keyword("udev_dir", &udev_dir_handler, &snprint_def_udev_dir); install_keyword("selector", &def_selector_handler, &snprint_def_selector);