public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* cluster: RHEL5 - qdiskd: Warn if we find >1 label with the same name
@ 2009-02-27 15:05 Lon Hohberger
  0 siblings, 0 replies; 2+ messages in thread
From: Lon Hohberger @ 2009-02-27 15:05 UTC (permalink / raw)
  To: cluster-cvs-relay

Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=992658141fa495d902715fdba44f74dcbca8c8c8
Commit:        992658141fa495d902715fdba44f74dcbca8c8c8
Parent:        7fb6327e27bd880185e69449d6c8aae6a6ef12b1
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:03:56 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 3727563..e235883 100644
--- a/cman/qdisk/main.c
+++ b/cman/qdisk/main.c
@@ -1523,8 +1523,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 5623e7e..d41c832 100644
--- a/cman/qdisk/proc.c
+++ b/cman/qdisk/proc.c
@@ -248,7 +248,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);
 	}
 
@@ -265,7 +265,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) {


^ permalink raw reply	[flat|nested] 2+ messages in thread

* cluster: RHEL5 - qdiskd: Warn if we find >1 label with the same name
@ 2009-02-27 14:57 Lon Hohberger
  0 siblings, 0 replies; 2+ messages in thread
From: Lon Hohberger @ 2009-02-27 14:57 UTC (permalink / raw)
  To: cluster-cvs-relay

Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=714dfb2b160aa37e225dfbd4584422c66dbedc96
Commit:        714dfb2b160aa37e225dfbd4584422c66dbedc96
Parent:        1fe224ebf9a023a2a781c7d33661128bc2e5582a
Author:        Lon Hohberger <lhh@redhat.com>
AuthorDate:    Thu Feb 26 15:23:59 2009 -0500
Committer:     Lon Hohberger <lhh@redhat.com>
CommitterDate: Fri Feb 27 09:56:33 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 |    8 ++++++++
 cman/qdisk/proc.c |    4 ++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/cman/qdisk/main.c b/cman/qdisk/main.c
index 3727563..57ac1ed 100644
--- a/cman/qdisk/main.c
+++ b/cman/qdisk/main.c
@@ -1523,8 +1523,16 @@ main(int argc, char **argv)
 					 ctx.qc_label);
 			check_stop_cman(&ctx);
 			goto out;
+<<<<<<< HEAD:cman/qdisk/main.c
 		}
 		/* 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);
+  		}
+>>>>>>> da3d354... qdiskd: Warn if we find >1 label with the same name:cman/qdisk/main.c
 
 		if (ctx.qc_device)
 			free(ctx.qc_device);
diff --git a/cman/qdisk/proc.c b/cman/qdisk/proc.c
index 5623e7e..d41c832 100644
--- a/cman/qdisk/proc.c
+++ b/cman/qdisk/proc.c
@@ -248,7 +248,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);
 	}
 
@@ -265,7 +265,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) {


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-02-27 15:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-27 15:05 cluster: RHEL5 - qdiskd: Warn if we find >1 label with the same name Lon Hohberger
  -- strict thread matches above, loose matches on Subject: below --
2009-02-27 14:57 Lon Hohberger

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).