This is the mail archive of the cluster-cvs@sourceware.org mailing list for the cluster.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

cluster: STABLE2 - qdiskd: Warn if we find >1 label with the same name


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=abfd395f0dca54a3bdb9d47b52b2d49818a932e2
Commit:        abfd395f0dca54a3bdb9d47b52b2d49818a932e2
Parent:        9cf3a5850186714bbadfec75f427d481d3c5468a
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:49:12 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 e26e1fc..4964595 100644
--- a/cman/qdisk/main.c
+++ b/cman/qdisk/main.c
@@ -1471,8 +1471,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 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) {


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]