public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
From: Lon Hohberger <lon@fedoraproject.org>
To: cluster-cvs-relay@redhat.com
Subject: cluster: STABLE2 - qdiskd: Warn if we find >1 label with the same name
Date: Fri, 27 Feb 2009 15:03:00 -0000	[thread overview]
Message-ID: <20090227150234.AC432120154@lists.fedorahosted.org> (raw)

Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=02a1c9e46bd6b8644dade2578d07a36856f9fed1
Commit:        02a1c9e46bd6b8644dade2578d07a36856f9fed1
Parent:        7d1c1c20719ff4d714df7bfd698eb6c39124294f
Author:        Lon Hohberger <lhh@redhat.com>
AuthorDate:    Fri Feb 27 10:01:43 2009 -0500
Committer:     Lon Hohberger <lhh@redhat.com>
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 <lhh@redhat.com>
---
 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) {


             reply	other threads:[~2009-02-27 15:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-27 15:03 Lon Hohberger [this message]
  -- strict thread matches above, loose matches on Subject: below --
2009-02-27 14:51 Lon Hohberger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090227150234.AC432120154@lists.fedorahosted.org \
    --to=lon@fedoraproject.org \
    --cc=cluster-cvs-relay@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).