From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32501 invoked by alias); 27 Feb 2009 15:03:03 -0000 Received: (qmail 32347 invoked by alias); 27 Feb 2009 15:03:02 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43,SPF_HELO_PASS X-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43,SPF_HELO_PASS X-Spam-Check-By: sourceware.org X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bastion.fedora.phx.redhat.com Subject: cluster: STABLE2 - qdiskd: Warn if we find >1 label with the same name To: cluster-cvs-relay@redhat.com X-Project: Cluster Project X-Git-Module: cluster.git X-Git-Refname: refs/heads/STABLE2 X-Git-Reftype: branch X-Git-Oldrev: 7d1c1c20719ff4d714df7bfd698eb6c39124294f X-Git-Newrev: 02a1c9e46bd6b8644dade2578d07a36856f9fed1 From: Lon Hohberger Message-Id: <20090227150234.AC432120154@lists.fedorahosted.org> Date: Fri, 27 Feb 2009 15:03:00 -0000 X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 Mailing-List: contact cluster-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cluster-cvs-owner@sourceware.org X-SW-Source: 2009-q1/txt/msg00621.txt.bz2 Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=02a1c9e46bd6b8644dade2578d07a36856f9fed1 Commit: 02a1c9e46bd6b8644dade2578d07a36856f9fed1 Parent: 7d1c1c20719ff4d714df7bfd698eb6c39124294f Author: Lon Hohberger AuthorDate: Fri Feb 27 10:01:43 2009 -0500 Committer: Lon Hohberger CommitterDate: Fri Feb 27 10:01:43 2009 -0500 qdiskd: Warn if we find >1 label with the same name Signed-off-by: Lon Hohberger --- cman/qdisk/main.c | 7 +++++-- cman/qdisk/proc.c | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/cman/qdisk/main.c b/cman/qdisk/main.c index e26e1fc..70cc052 100644 --- a/cman/qdisk/main.c +++ b/cman/qdisk/main.c @@ -1471,8 +1471,11 @@ main(int argc, char **argv) ctx.qc_label); check_stop_cman(&ctx); goto out; - } - /* XXX Multiple matches: do we care? */ + } else if (ret > 0) { + clulog_and_print(LOG_WARNING, "%d matches found for " + "label '%s'; please use 'device=' " + "instead!\n", ret, ctx.qc_label); + } if (ctx.qc_device) free(ctx.qc_device); diff --git a/cman/qdisk/proc.c b/cman/qdisk/proc.c index 2f0b6b0..583cf2d 100644 --- a/cman/qdisk/proc.c +++ b/cman/qdisk/proc.c @@ -228,7 +228,7 @@ find_partitions(const char *label, char *devname, size_t devlen, int print) } } - if (dargs.count == 1 && label) { + if (dargs.count >= 1 && label) { snprintf(devname, devlen, "%s", dargs.devnode->devpath->path); } @@ -245,7 +245,7 @@ find_partitions(const char *label, char *devname, size_t devlen, int print) return 0; /* more than one match */ - return 1; + return dargs.count; not_found: if (dh) {