public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
* LVM2/tools reporter.c
@ 2010-11-17 22:26 mornfall
  0 siblings, 0 replies; 4+ messages in thread
From: mornfall @ 2010-11-17 22:26 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mornfall@sourceware.org	2010-11-17 22:26:43

Modified files:
	tools          : reporter.c 

Log message:
	The _free_vg that is created as a placeholder when reporting segments in pvs
	was lacking the (vgmem) pool. We now create that pool. There is at least one
	more such VG (_dummy_vg) which is pool-less. I am not sure what is the right
	way to go about this, but this is currently necessary to fix a segfault
	introduced by using vgmem in the reporter in Dave's lvseg lvm2app patches.
	
	Signed-off-by: Petr Rockai <prockai@redhat.com>

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/reporter.c.diff?cvsroot=lvm2&r1=1.62&r2=1.63

--- LVM2/tools/reporter.c	2010/07/09 15:34:48	1.62
+++ LVM2/tools/reporter.c	2010/11/17 22:26:42	1.63
@@ -64,6 +64,9 @@
 		.name = (char *)"",
 	};
 
+        if (!(_free_vg.vgmem = dm_pool_create("_free_vg", 10240)))
+            return ECMD_FAILED;
+
 	struct logical_volume _free_logical_volume = {
 		.vg = vg ?: &_free_vg,
 		.name = (char *) "",
@@ -103,10 +106,11 @@
 
 	if (!report_object(handle, vg, seg ? seg->lv : &_free_logical_volume, pvseg->pv,
 			   seg ? : &_free_lv_segment, pvseg)) {
-		stack;
 		ret = ECMD_FAILED;
+                goto_out;
 	}
-
+ out:
+        dm_pool_destroy(_free_vg.vgmem);
 	return ret;
 }
 


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

* LVM2/tools reporter.c
@ 2010-04-23 19:10 snitzer
  0 siblings, 0 replies; 4+ messages in thread
From: snitzer @ 2010-04-23 19:10 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	snitzer@sourceware.org	2010-04-23 19:10:21

Modified files:
	tools          : reporter.c 

Log message:
	Remove redundant check in _lvs_single now that the caller
	(process_each_lv_in_vg) provides it.
	
	Also, removing this check from _lvs_single now allows displaying hidden
	LVs that are specifically named on the command line.

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

--- LVM2/tools/reporter.c	2010/03/16 15:30:49	1.59
+++ LVM2/tools/reporter.c	2010/04/23 19:10:20	1.60
@@ -33,9 +33,6 @@
 static int _lvs_single(struct cmd_context *cmd, struct logical_volume *lv,
 		       void *handle)
 {
-	if (!arg_count(cmd, all_ARG) && !lv_is_visible(lv))
-		return ECMD_PROCESSED;
-
 	if (!report_object(handle, lv->vg, lv, NULL, NULL, NULL)) {
 		stack;
 		return ECMD_FAILED;


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

* LVM2/tools reporter.c
@ 2009-01-10 17:21 agk
  0 siblings, 0 replies; 4+ messages in thread
From: agk @ 2009-01-10 17:21 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2009-01-10 17:21:17

Modified files:
	tools          : reporter.c 

Log message:
	...and a few more uninitialised dummy fields.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/reporter.c.diff?cvsroot=lvm2&r1=1.42&r2=1.43

--- LVM2/tools/reporter.c	2008/12/04 15:54:27	1.42
+++ LVM2/tools/reporter.c	2009/01/10 17:21:17	1.43
@@ -88,9 +88,12 @@
 
         _free_lv_segment.segtype = get_segtype_from_string(cmd, "free");
 	_free_lv_segment.len = pvseg->len;
+	dm_list_init(&_free_lv_segment.tags);
+	dm_list_init(&_free_lv_segment.origin_list);
 	dm_list_init(&_free_logical_volume.tags);
 	dm_list_init(&_free_logical_volume.segments);
 	dm_list_init(&_free_logical_volume.segs_using_this_lv);
+	dm_list_init(&_free_logical_volume.snapshot_segs);
 
 	if (!report_object(handle, vg, seg ? seg->lv : &_free_logical_volume, pvseg->pv,
 			   seg ? : &_free_lv_segment, pvseg))


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

* LVM2/tools reporter.c
@ 2007-01-27  2:32 agk
  0 siblings, 0 replies; 4+ messages in thread
From: agk @ 2007-01-27  2:32 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

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

Modified files:
	tools          : reporter.c 

Log message:
	fix pvsegs report too

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

--- LVM2/tools/reporter.c	2007/01/27 02:09:06	1.19
+++ LVM2/tools/reporter.c	2007/01/27 02:32:31	1.20
@@ -150,6 +150,18 @@
 	return process_each_pv_in_vg(cmd, vg, NULL, handle, &_pvs_single);
 }
 
+static int _pvsegs_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, &_pvsegs_single);
+}
+
 static int _report(struct cmd_context *cmd, int argc, char **argv,
 		   report_type_t report_type)
 {
@@ -323,7 +335,7 @@
 					    report_handle, &_pvsegs_single);
 		else
 			r = process_each_vg(cmd, argc, argv, LCK_VG_READ, 0,
-					    report_handle, &_pvs_in_vg);
+					    report_handle, &_pvsegs_in_vg);
 		break;
 	}
 


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

end of thread, other threads:[~2010-11-17 22:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-17 22:26 LVM2/tools reporter.c mornfall
  -- strict thread matches above, loose matches on Subject: below --
2010-04-23 19:10 snitzer
2009-01-10 17:21 agk
2007-01-27  2:32 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).