public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
* LVM2 ./WHATS_NEW tools/reporter.c
@ 2007-02-14 15:18 agk
  0 siblings, 0 replies; 5+ messages in thread
From: agk @ 2007-02-14 15:18 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2007-02-14 15:18:31

Modified files:
	.              : WHATS_NEW 
	tools          : reporter.c 

Log message:
	Fix a leak in a reporting error path.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.574&r2=1.575
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/reporter.c.diff?cvsroot=lvm2&r1=1.20&r2=1.21

--- LVM2/WHATS_NEW	2007/02/13 16:10:14	1.574
+++ LVM2/WHATS_NEW	2007/02/14 15:18:30	1.575
@@ -1,5 +1,6 @@
 Version 2.02.23 - 
 ====================================
+  Fix a leak in a reporting error path (2.02.19).
 
 Version 2.02.22 - 13th February 2007
 ====================================
--- LVM2/tools/reporter.c	2007/01/27 02:32:31	1.20
+++ LVM2/tools/reporter.c	2007/02/14 15:18:31	1.21
@@ -286,7 +286,7 @@
 	if (!(report_handle = report_init(cmd, options, keys, &report_type,
 					  separator, aligned, buffered,
 					  headings)))
-		return 0;
+		return_0;
 
 	/* Ensure options selected are compatible */
 	if (report_type & SEGS)
@@ -295,6 +295,7 @@
 		report_type |= PVS;
 	if ((report_type & LVS) && (report_type & PVS)) {
 		log_error("Can't report LV and PV fields at the same time");
+		dm_report_free(report_handle);
 		return 0;
 	}
 


^ permalink raw reply	[flat|nested] 5+ messages in thread
* LVM2 ./WHATS_NEW tools/reporter.c
@ 2010-06-17 13:15 mbroz
  0 siblings, 0 replies; 5+ messages in thread
From: mbroz @ 2010-06-17 13:15 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2010-06-17 13:15:52

Modified files:
	.              : WHATS_NEW 
	tools          : reporter.c 

Log message:
	Fix exit code when requesting help using documented -o help option.
	
	IOW fix lvs -o help
	...
	Command failed with status code 5.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1616&r2=1.1617
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/reporter.c.diff?cvsroot=lvm2&r1=1.60&r2=1.61

--- LVM2/WHATS_NEW	2010/06/17 12:48:54	1.1616
+++ LVM2/WHATS_NEW	2010/06/17 13:15:51	1.1617
@@ -1,5 +1,6 @@
 Version 2.02.68 -
 ===============================
+  Fix exit code when requesting help using documented -o help option.
   Do not use internal DLM lock definitions in generic LVM2 clvmd code.
   Add dmeventd man page.
   Update lvresize/extend/reduce manpages with --nofsck, --resizefs options.
--- LVM2/tools/reporter.c	2010/04/23 19:10:20	1.60
+++ LVM2/tools/reporter.c	2010/06/17 13:15:52	1.61
@@ -362,6 +362,8 @@
 					  separator, aligned, buffered,
 					  headings, field_prefixes, quoted,
 					  columns_as_rows))) {
+		if (!strcasecmp(options, "help") || !strcmp(options, "?"))
+			return r;
 		stack;
 		return ECMD_FAILED;
 	}


^ permalink raw reply	[flat|nested] 5+ messages in thread
* LVM2 ./WHATS_NEW tools/reporter.c
@ 2008-01-20  1:23 agk
  0 siblings, 0 replies; 5+ messages in thread
From: agk @ 2008-01-20  1:23 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2008-01-20 01:23:46

Modified files:
	.              : WHATS_NEW 
	tools          : reporter.c 

Log message:
	Fix pvs, vgs, lvs error exit status on some error paths.
	(note -o help is now considered error)

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.773&r2=1.774
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/reporter.c.diff?cvsroot=lvm2&r1=1.33&r2=1.34

--- LVM2/WHATS_NEW	2008/01/19 12:36:37	1.773
+++ LVM2/WHATS_NEW	2008/01/20 01:23:46	1.774
@@ -1,5 +1,6 @@
 Version 2.02.32 -
 ===================================
+  Fix pvs, vgs, lvs error exit status on some error paths.
 
 Version 2.02.31 - 19th January 2008
 ===================================
--- LVM2/tools/reporter.c	2008/01/07 20:42:57	1.33
+++ LVM2/tools/reporter.c	2008/01/20 01:23:46	1.34
@@ -240,13 +240,13 @@
 		opts = arg_str_value(cmd, options_ARG, "");
 		if (!opts || !*opts) {
 			log_error("Invalid options string: %s", opts);
-			return 0;
+			return EINVALID_CMD_LINE;
 		}
 		if (*opts == '+') {
 			if (!(str = dm_pool_alloc(cmd->mem,
 					 strlen(options) + strlen(opts) + 1))) {
 				log_error("options string allocation failed");
-				return 0;
+				return ECMD_FAILED;
 			}
 			strcpy(str, options);
 			strcat(str, ",");
@@ -273,8 +273,10 @@
 
 	if (!(report_handle = report_init(cmd, options, keys, &report_type,
 					  separator, aligned, buffered,
-					  headings)))
-		return_0;
+					  headings))) {
+		stack;
+		return ECMD_FAILED;
+	}
 
 	/* Ensure options selected are compatible */
 	if (report_type & SEGS)
@@ -284,7 +286,7 @@
 	if ((report_type & LVS) && (report_type & PVS) && !args_are_pvs) {
 		log_error("Can't report LV and PV fields at the same time");
 		dm_report_free(report_handle);
-		return 0;
+		return ECMD_FAILED;
 	}
 
 	/* Change report type if fields specified makes this necessary */


^ permalink raw reply	[flat|nested] 5+ messages in thread
* LVM2 ./WHATS_NEW tools/reporter.c
@ 2007-01-27  2:09 agk
  0 siblings, 0 replies; 5+ messages in thread
From: agk @ 2007-01-27  2:09 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2007-01-27 02:09:06

Modified files:
	.              : WHATS_NEW 
	tools          : reporter.c 

Log message:
	Fix vgs to treat args as VGs even when PV fields are displayed.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.563&r2=1.564
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/reporter.c.diff?cvsroot=lvm2&r1=1.18&r2=1.19

--- LVM2/WHATS_NEW	2007/01/26 17:15:16	1.563
+++ LVM2/WHATS_NEW	2007/01/27 02:09:05	1.564
@@ -1,5 +1,6 @@
 Version 2.02.21 -
 ===================================
+  Fix vgs to treat args as VGs even when PV fields are displayed.
   Fix md signature check to handle both endiannesses.
 
 Version 2.02.20 - 25th January 2007
--- LVM2/tools/reporter.c	2007/01/25 14:37:48	1.18
+++ LVM2/tools/reporter.c	2007/01/27 02:09:06	1.19
@@ -138,6 +138,18 @@
 	return ret;
 }
 
+static int _pvs_in_vg(struct cmd_context *cmd, const char *vg_name,
+		      struct volume_group *vg, int consistent,
+		      void *handle)
+{
+	if (!vg) {
+		log_error("Volume group %s not found", vg_name);
+		return ECMD_FAILED;
+	}                     
+
+	return process_each_pv_in_vg(cmd, vg, NULL, handle, &_pvs_single);
+}
+
 static int _report(struct cmd_context *cmd, int argc, char **argv,
 		   report_type_t report_type)
 {
@@ -146,8 +158,8 @@
 	char *str;
 	const char *keys = NULL, *options = NULL, *separator;
 	int r = ECMD_PROCESSED;
-
 	int aligned, buffered, headings;
+	unsigned args_are_pvs;
 
 	aligned = find_config_tree_int(cmd, "report/aligned",
 				  DEFAULT_REP_ALIGNED);
@@ -158,6 +170,8 @@
 	separator = find_config_tree_str(cmd, "report/separator",
 				    DEFAULT_REP_SEPARATOR);
 
+	args_are_pvs = (report_type == PVS || report_type == PVSEGS) ? 1 : 0;
+
 	switch (report_type) {
 	case LVS:
 		keys = find_config_tree_str(cmd, "report/lvs_sort",
@@ -292,16 +306,24 @@
 				    report_handle, &_vgs_single);
 		break;
 	case PVS:
-		r = process_each_pv(cmd, argc, argv, NULL, report_handle,
-				    &_pvs_single);
+		if (args_are_pvs)
+			r = process_each_pv(cmd, argc, argv, NULL,
+					    report_handle, &_pvs_single);
+		else
+			r = process_each_vg(cmd, argc, argv, LCK_VG_READ, 0,
+					    report_handle, &_pvs_in_vg);
 		break;
 	case SEGS:
 		r = process_each_lv(cmd, argc, argv, LCK_VG_READ, report_handle,
 				    &_lvsegs_single);
 		break;
 	case PVSEGS:
-		r = process_each_pv(cmd, argc, argv, NULL, report_handle,
-				    &_pvsegs_single);
+		if (args_are_pvs)
+			r = process_each_pv(cmd, argc, argv, NULL,
+					    report_handle, &_pvsegs_single);
+		else
+			r = process_each_vg(cmd, argc, argv, LCK_VG_READ, 0,
+					    report_handle, &_pvs_in_vg);
 		break;
 	}
 


^ permalink raw reply	[flat|nested] 5+ messages in thread
* LVM2 ./WHATS_NEW tools/reporter.c
@ 2004-05-24 14:14 agk
  0 siblings, 0 replies; 5+ messages in thread
From: agk @ 2004-05-24 14:14 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2004-05-24 14:14:11

Modified files:
	.              : WHATS_NEW 
	tools          : reporter.c 

Log message:
	Fix a pvs error path.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.35&r2=1.36
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/tools/reporter.c.diff?cvsroot=lvm2&r1=1.2&r2=1.3


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

end of thread, other threads:[~2010-06-17 13:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-14 15:18 LVM2 ./WHATS_NEW tools/reporter.c agk
  -- strict thread matches above, loose matches on Subject: below --
2010-06-17 13:15 mbroz
2008-01-20  1:23 agk
2007-01-27  2:09 agk
2004-05-24 14:14 agk

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