public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
* LVM2 ./WHATS_NEW tools/toollib.c
@ 2011-11-18 19:19 zkabelac
  0 siblings, 0 replies; 23+ messages in thread
From: zkabelac @ 2011-11-18 19:19 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-11-18 19:19:23

Modified files:
	.              : WHATS_NEW 
	tools          : toollib.c 

Log message:
	Skip non-virtual snapshots for availability
	
	Change the behavior of availability change.
	With this patch the lvgchange returns success
	when VG is properly changed.
	
	It skips non-virtual origins from being changes when
	only 'vg' is specified as lvchange -a parameter.
	
	Before this change we had this:
	
	$> lvs -a
	LV    VG   Attr     LSize   Pool Origin
	lvol0 mvg  owi-a-s- 128.00k
	lvol1 mvg  owi-a-s- 128.00k
	lvol2 mvg  swi-a-s-   1.25m      lvol0
	lvol3 mvg  swi-a-s-   1.25m      lvol1
	
	$> lvchange -an mvg ; echo $?
	Can't change snapshot logical volume "lvol2".
	Can't change snapshot logical volume "lvol3".
	5
	
	$> lvs -a
	LV    VG   Attr     LSize   Pool Origin
	lvol0 mvg  owi---s- 128.00k
	lvol1 mvg  owi---s- 128.00k
	lvol2 mvg  swi---s-   1.25m      lvol0
	lvol3 mvg  swi---s-   1.25m      lvol1
	
	$> lvchange -ay mvg ; echo $?
	Can't change snapshot logical volume "lvol2".
	Can't change snapshot logical volume "lvol3".
	5
	
	$> lvs
	LV    VG   Attr     LSize   Pool Origin
	lvol0 mvg  owi-a-s- 128.00k
	lvol1 mvg  owi-a-s- 128.00k
	lvol2 mvg  swi-a-s-   1.25m      lvol0
	lvol3 mvg  swi-a-s-   1.25m      lvol1
	
	After commit:
	
	$> lvs -a
	LV    VG   Attr     LSize   Pool Origin
	lvol0 mvg  owi-a-s- 128.00k
	lvol1 mvg  owi-a-s- 128.00k
	lvol2 mvg  swi-a-s-   1.25m      lvol0
	lvol3 mvg  swi-a-s-   1.25m      lvol1
	
	$> lvchange -an mvg ; echo $?
	0
	
	$> lvs -a
	LV    VG   Attr     LSize   Pool Origin
	lvol0 mvg  owi---s- 128.00k
	lvol1 mvg  owi---s- 128.00k
	lvol2 mvg  swi---s-   1.25m      lvol0
	lvol3 mvg  swi---s-   1.25m      lvol1
	
	$> lvchange -ay mvg ; echo $?
	0
	
	$> lvs -a
	LV    VG   Attr     LSize   Pool Origin
	lvol0 mvg  owi-a-s- 128.00k
	lvol1 mvg  owi-a-s- 128.00k
	lvol2 mvg  swi-a-s-   1.25m      lvol0
	lvol3 mvg  swi-a-s-   1.25m      lvol1

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2186&r2=1.2187
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/toollib.c.diff?cvsroot=lvm2&r1=1.235&r2=1.236

--- LVM2/WHATS_NEW	2011/11/15 17:32:12	1.2186
+++ LVM2/WHATS_NEW	2011/11/18 19:19:22	1.2187
@@ -1,5 +1,6 @@
 Version 2.02.89 - 
 ==================================
+  Skip non-virtual origins for availability change for lvchange.
   Adjusted mirror region size only for mirrors and raids.
   Reorder prompt conditions for removal of active volumes.
   Avoid 'mda inconsistency' by properly registering UNLABELLED_PV flag (2.02.86).
--- LVM2/tools/toollib.c	2011/11/12 22:44:11	1.235
+++ LVM2/tools/toollib.c	2011/11/18 19:19:22	1.236
@@ -123,6 +123,12 @@
 		if (lvl->lv->status & SNAPSHOT)
 			continue;
 
+		/* Skip availability change for non-virt snaps when processing all LVs */
+		/* FIXME: pass process_all to process_single_lv() */
+		if (process_all && arg_count(cmd, available_ARG) &&
+		    lv_is_cow(lvl->lv) && !lv_is_virtual_origin(origin_from_cow(lvl->lv)))
+			continue;
+
 		if (lv_is_virtual_origin(lvl->lv) && !arg_count(cmd, all_ARG))
 			continue;
 


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

* LVM2 ./WHATS_NEW tools/toollib.c
@ 2012-01-25 21:52 zkabelac
  0 siblings, 0 replies; 23+ messages in thread
From: zkabelac @ 2012-01-25 21:52 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2012-01-25 21:52:53

Modified files:
	.              : WHATS_NEW 
	tools          : toollib.c 

Log message:
	Limit alignment to 32bit values
	
	to get the same behavior on 32/64 machines.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2241&r2=1.2242
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/toollib.c.diff?cvsroot=lvm2&r1=1.237&r2=1.238

--- LVM2/WHATS_NEW	2012/01/25 21:43:51	1.2241
+++ LVM2/WHATS_NEW	2012/01/25 21:52:53	1.2242
@@ -1,5 +1,6 @@
 Version 2.02.89 - 
 ==================================
+  Limit alignment to 32bit values.
   Check for correctness of uint64 dev_size value.
   Rename origin_only parameter to more generic flag use_layer for lv_info().
   Thin pools have segment fields thin_count, zero, transaction_id.
--- LVM2/tools/toollib.c	2012/01/05 15:38:19	1.237
+++ LVM2/tools/toollib.c	2012/01/25 21:52:53	1.238
@@ -1438,7 +1438,7 @@
 	}
 	pp->data_alignment = arg_uint64_value(cmd, dataalignment_ARG, UINT64_C(0));
 
-	if (pp->data_alignment > ULONG_MAX) {
+	if (pp->data_alignment > UINT32_MAX) {
 		log_error("Physical volume data alignment is too big.");
 		return 0;
 	}
@@ -1457,7 +1457,7 @@
 	}
 	pp->data_alignment_offset = arg_uint64_value(cmd, dataalignmentoffset_ARG, UINT64_C(0));
 
-	if (pp->data_alignment_offset > ULONG_MAX) {
+	if (pp->data_alignment_offset > UINT32_MAX) {
 		log_error("Physical volume data alignment offset is too big.");
 		return 0;
 	}


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

* LVM2 ./WHATS_NEW tools/toollib.c
@ 2011-02-18 15:02 zkabelac
  0 siblings, 0 replies; 23+ messages in thread
From: zkabelac @ 2011-02-18 15:02 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-02-18 15:02:26

Modified files:
	.              : WHATS_NEW 
	tools          : toollib.c 

Log message:
	Add some backtraces for error paths in process_each_lv

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1920&r2=1.1921
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/toollib.c.diff?cvsroot=lvm2&r1=1.220&r2=1.221

--- LVM2/WHATS_NEW	2011/02/18 14:47:28	1.1920
+++ LVM2/WHATS_NEW	2011/02/18 15:02:25	1.1921
@@ -1,5 +1,6 @@
 Version 2.02.85 - 
 ===================================
+  Add stack backtraces for error paths in process_each_lv().
   Fixing some const cast gcc warnings in the code.
   Use char* arithmetic in _text_write(), _text_read() & send_message().
   Fix compilation when devmapper is dissabled.
--- LVM2/tools/toollib.c	2011/02/18 14:47:31	1.220
+++ LVM2/tools/toollib.c	2011/02/18 15:02:25	1.221
@@ -169,8 +169,10 @@
 		}
 		if (ret > ret_max)
 			ret_max = ret;
-		if (sigint_caught())
+		if (sigint_caught()) {
+			stack;
 			return ret_max;
+		}
 	}
 
 	if (lvargs_supplied && lvargs_matched != dm_list_size(arg_lvnames)) {
@@ -253,8 +255,10 @@
 				while (*lv_name == '/')
 					lv_name++;
 				if (!(vgname = extract_vgname(cmd, vgname))) {
-					if (ret_max < ECMD_FAILED)
+					if (ret_max < ECMD_FAILED) {
+						stack;
 						ret_max = ECMD_FAILED;
+					}
 					continue;
 				}
 			} else if (!dev_dir_found &&
@@ -348,8 +352,10 @@
 						    tags_arg, &failed_lvnames,
 						    handle, process_single_lv);
 			if (ret != ECMD_PROCESSED ||
-			    dm_list_empty(&failed_lvnames))
+			    dm_list_empty(&failed_lvnames)) {
+				stack;
 				break;
+			}
 
 			/* Try again with failed LVs in this VG */
 			dm_list_init(&lvnames);
@@ -357,6 +363,7 @@
 
 			free_cmd_vgs(&cmd_vgs);
 			if (!cmd_vg_read(cmd, &cmd_vgs)) {
+				stack;
 				ret = ECMD_FAILED; /* break */
 				break;
 			}
@@ -366,8 +373,10 @@
 
 		free_cmd_vgs(&cmd_vgs);
 		/* FIXME: logic for breaking command is not consistent */
-		if (sigint_caught())
+		if (sigint_caught()) {
+			stack;
 			return ECMD_FAILED;
+		}
 	}
 
 	return ret_max;


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

* LVM2 ./WHATS_NEW tools/toollib.c
@ 2010-11-23 20:39 zkabelac
  0 siblings, 0 replies; 23+ messages in thread
From: zkabelac @ 2010-11-23 20:39 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2010-11-23 20:39:14

Modified files:
	.              : WHATS_NEW 
	tools          : toollib.c 

Log message:
	Move arg_vgnames from local scope
	
	As gcc puts probably all vars on stack this bug was not noticed in runtime.
	Patch fixes referencing local scope list variable.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1804&r2=1.1805
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/toollib.c.diff?cvsroot=lvm2&r1=1.213&r2=1.214

--- LVM2/WHATS_NEW	2010/11/23 18:29:06	1.1804
+++ LVM2/WHATS_NEW	2010/11/23 20:39:13	1.1805
@@ -1,5 +1,6 @@
 Version 2.02.78 - 
 ====================================
+  Fix out-of-scope variable usage in process_each_lv().
   Fix dm_task_destroy(NULL) call in _node_clear_table() error path.
   Fix resource leak in _rm_blks().
   Suppress 'No PV label' message when removing several PVs without mdas.
--- LVM2/tools/toollib.c	2010/11/23 01:56:02	1.213
+++ LVM2/tools/toollib.c	2010/11/23 20:39:14	1.214
@@ -198,6 +198,7 @@
 	struct dm_list failed_lvnames;
 	struct dm_list tags, lvnames;
 	struct dm_list arg_lvnames;	/* Cmdline vgname or vgname/lvname */
+	struct dm_list arg_vgnames;
 	char *vglv;
 	size_t vglv_sz;
 
@@ -208,8 +209,6 @@
 	dm_list_init(&failed_lvnames);
 
 	if (argc) {
-		struct dm_list arg_vgnames;
-
 		log_verbose("Using logical volume(s) on command line");
 		dm_list_init(&arg_vgnames);
 


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

* LVM2 ./WHATS_NEW tools/toollib.c
@ 2010-05-21 14:15 zkabelac
  0 siblings, 0 replies; 23+ messages in thread
From: zkabelac @ 2010-05-21 14:15 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2010-05-21 14:15:39

Modified files:
	.              : WHATS_NEW 
	tools          : toollib.c 

Log message:
	Replicator: use cmd_vg for process_each_lv_in_vg()
	
	As for _process_one_vg() we need similar retry loop for
	process_each_lv_in_vg(). This patch retries to process
	failed LVs with reopened VGs.
	
	Patch does not add any extra repeated invocations if there is not
	found any missing VG during LV processing.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1586&r2=1.1587
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/toollib.c.diff?cvsroot=lvm2&r1=1.200&r2=1.201

--- LVM2/WHATS_NEW	2010/05/21 14:11:13	1.1586
+++ LVM2/WHATS_NEW	2010/05/21 14:15:39	1.1587
@@ -1,6 +1,7 @@
 Version 2.02.67 -
 ===============================
-  Update _process_one_vg() to work with cmd_vg struture.
+  Update process_each_lv_in_vg() to use cmd_vg structure.
+  Update _process_one_vg() to work with cmd_vg structure.
   Add functions for read and release VGs list.
   Add find_replicator_vgs() to discover all needed VGs for replicator-dev LV.
   Add functions for handling cmd_vg structure.
--- LVM2/tools/toollib.c	2010/05/21 14:11:13	1.200
+++ LVM2/tools/toollib.c	2010/05/21 14:15:39	1.201
@@ -155,6 +155,7 @@
 		if (!process_lv)
 			continue;
 
+		lvl->lv->vg->cmd_missing_vgs = 0;
 		ret = process_single_lv(cmd, lvl->lv, handle);
 		if (ret != ECMD_PROCESSED && failed_lvnames) {
 			lv_name = dm_pool_strdup(cmd->mem, lvl->lv->name);
@@ -163,6 +164,8 @@
 				log_error("Allocation failed for str_list.");
 				return ECMD_FAILED;
 			}
+			if (lvl->lv->vg->cmd_missing_vgs)
+				ret = ECMD_PROCESSED;
 		}
 		if (ret > ret_max)
 			ret_max = ret;
@@ -190,7 +193,9 @@
 	struct dm_list *tags_arg;
 	struct dm_list *vgnames;	/* VGs to process */
 	struct str_list *sll, *strl;
-	struct volume_group *vg;
+	struct cmd_vg *cvl_vg;
+	struct dm_list cmd_vgs;
+	struct dm_list failed_lvnames;
 	struct dm_list tags, lvnames;
 	struct dm_list arg_lvnames;	/* Cmdline vgname or vgname/lvname */
 	char *vglv;
@@ -200,6 +205,7 @@
 
 	dm_list_init(&tags);
 	dm_list_init(&arg_lvnames);
+	dm_list_init(&failed_lvnames);
 
 	if (argc) {
 		struct dm_list arg_vgnames;
@@ -295,13 +301,17 @@
 		}
 	}
 
-	vg = NULL;
 	dm_list_iterate_items(strl, vgnames) {
 		vgname = strl->str;
-		vg = vg_read(cmd, vgname, NULL, flags);
+		dm_list_init(&cmd_vgs);
+		if (!(cvl_vg = cmd_vg_add(cmd->mem, &cmd_vgs,
+					  vgname, NULL, flags))) {
+			stack;
+			return ECMD_FAILED;
+		}
 
-		if (vg_read_error(vg)) {
-			vg_release(vg);
+		if (!cmd_vg_read(cmd, &cmd_vgs)) {
+			cmd_vg_release(&cmd_vgs);
 			if (ret_max < ECMD_FAILED) {
 				log_error("Skipping volume group %s", vgname);
 				ret_max = ECMD_FAILED;
@@ -327,17 +337,34 @@
 						  dm_pool_strdup(cmd->mem,
 								 lv_name + 1))) {
 					log_error("strlist allocation failed");
-					unlock_and_release_vg(cmd, vg, vgname);
+					cmd_vg_release(&cmd_vgs);
 					return ECMD_FAILED;
 				}
 			}
 		}
 
-		ret = process_each_lv_in_vg(cmd, vg, &lvnames, tags_arg,
-					    NULL, handle, process_single_lv);
-		unlock_and_release_vg(cmd, vg, vgname);
+		while (!sigint_caught()) {
+			ret = process_each_lv_in_vg(cmd, cvl_vg->vg, &lvnames,
+						    tags_arg, &failed_lvnames,
+						    handle, process_single_lv);
+			if (ret != ECMD_PROCESSED ||
+			    dm_list_empty(&failed_lvnames))
+				break;
+
+			/* Try again with failed LVs in this VG */
+			dm_list_init(&lvnames);
+			dm_list_splice(&lvnames, &failed_lvnames);
+
+			cmd_vg_release(&cmd_vgs);
+			if (!cmd_vg_read(cmd, &cmd_vgs)) {
+				ret = ECMD_FAILED; /* break */
+				break;
+			}
+		}
 		if (ret > ret_max)
 			ret_max = ret;
+
+		cmd_vg_release(&cmd_vgs);
 		/* FIXME: logic for breaking command is not consistent */
 		if (sigint_caught())
 			return ECMD_FAILED;


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

* LVM2 ./WHATS_NEW tools/toollib.c
@ 2010-05-21 14:11 zkabelac
  0 siblings, 0 replies; 23+ messages in thread
From: zkabelac @ 2010-05-21 14:11 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2010-05-21 14:11:13

Modified files:
	.              : WHATS_NEW 
	tools          : toollib.c 

Log message:
	Replicator: use cmd_vg list for _process_one_vg()
	
	Patch modifes behavior of _process_one_vg().
	
	In the first pass vg_read() collectis for replicator sorted list of
	additional VGs during lock_vol().
	If any other VG is needed by the replicator and it is not yet opened
	then next iteration loop is taken with all collected VGs.
	
	Flag vg->cmd_missing_vgs detects missing VGs.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1585&r2=1.1586
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/toollib.c.diff?cvsroot=lvm2&r1=1.199&r2=1.200

--- LVM2/WHATS_NEW	2010/05/21 14:07:16	1.1585
+++ LVM2/WHATS_NEW	2010/05/21 14:11:13	1.1586
@@ -1,5 +1,6 @@
 Version 2.02.67 -
 ===============================
+  Update _process_one_vg() to work with cmd_vg struture.
   Add functions for read and release VGs list.
   Add find_replicator_vgs() to discover all needed VGs for replicator-dev LV.
   Add functions for handling cmd_vg structure.
--- LVM2/tools/toollib.c	2010/05/21 12:21:52	1.199
+++ LVM2/tools/toollib.c	2010/05/21 14:11:13	1.200
@@ -432,37 +432,51 @@
 			   uint32_t flags, void *handle, int ret_max,
 			   process_single_vg_fn_t process_single_vg)
 {
-	struct volume_group *vg;
+	struct dm_list cmd_vgs;
+	struct cmd_vg *cvl_vg;
 	int ret = 0;
 
 	log_verbose("Finding volume group \"%s\"", vg_name);
 
-	vg = vg_read(cmd, vg_name, vgid, flags);
-	/* Allow FAILED_INCONSISTENT through only for vgcfgrestore */
-	if (vg_read_error(vg) &&
-	    !((vg_read_error(vg) == FAILED_INCONSISTENT) &&
-	      (flags & READ_ALLOW_INCONSISTENT))) {
-		ret_max = ECMD_FAILED;
-		goto_out;
-	}
+	dm_list_init(&cmd_vgs);
+	if (!(cvl_vg = cmd_vg_add(cmd->mem, &cmd_vgs, vg_name, vgid, flags)))
+		return_0;
+
+	for (;;) {
+		/* FIXME: consistent handling of command break */
+		if (sigint_caught()) {
+                        ret = ECMD_FAILED;
+			break;
+		}
+		if (!cmd_vg_read(cmd, &cmd_vgs))
+			/* Allow FAILED_INCONSISTENT through only for vgcfgrestore */
+			if (vg_read_error(cvl_vg->vg) &&
+			    (!((flags & READ_ALLOW_INCONSISTENT) &&
+			       (vg_read_error(cvl_vg->vg) == FAILED_INCONSISTENT)))) {
+				ret = ECMD_FAILED;
+				break;
+			}
+
+		if (!dm_list_empty(tags) &&
+		    /* Only process if a tag matches or it's on arg_vgnames */
+		    !str_list_match_item(arg_vgnames, vg_name) &&
+		    !str_list_match_list(tags, &cvl_vg->vg->tags))
+			break;
 
-	if (!dm_list_empty(tags)) {
-		/* Only process if a tag matches or it's on arg_vgnames */
-		if (!str_list_match_item(arg_vgnames, vg_name) &&
-		    !str_list_match_list(tags, &vg->tags))
-			goto out;
+		ret = process_single_vg(cmd, vg_name, cvl_vg->vg, handle);
+
+		if (vg_read_error(cvl_vg->vg)) /* FAILED_INCONSISTENT */
+			break;
+
+		if (!cvl_vg->vg->cmd_missing_vgs)
+			break;
+
+		cmd_vg_release(&cmd_vgs);
 	}
 
-	if ((ret = process_single_vg(cmd, vg_name, vg,
-				  handle)) > ret_max)
-		ret_max = ret;
+	cmd_vg_release(&cmd_vgs);
 
-out:
-	if (vg_read_error(vg))
-		vg_release(vg);
-	else
-		unlock_and_release_vg(cmd, vg, vg_name);
-	return ret_max;
+	return (ret > ret_max) ? ret : ret_max;
 }
 
 int process_each_vg(struct cmd_context *cmd, int argc, char **argv,


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

* LVM2 ./WHATS_NEW tools/toollib.c
@ 2010-05-21 12:19 zkabelac
  0 siblings, 0 replies; 23+ messages in thread
From: zkabelac @ 2010-05-21 12:19 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2010-05-21 12:19:23

Modified files:
	.              : WHATS_NEW 
	tools          : toollib.c 

Log message:
	Return ECMD_FAILED for break in process_each_lv() and process_each_segment_in_lv()

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1574&r2=1.1575
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/toollib.c.diff?cvsroot=lvm2&r1=1.197&r2=1.198

--- LVM2/WHATS_NEW	2010/05/20 23:21:53	1.1574
+++ LVM2/WHATS_NEW	2010/05/21 12:19:22	1.1575
@@ -1,5 +1,6 @@
 Version 2.02.67 -
 ===============================
+  Return ECMD_FAILED for break in process_each_lv() and process_each_segment_in_lv().
 
 Version 2.02.66 - 20th May 2010
 ===============================
--- LVM2/tools/toollib.c	2010/05/06 11:15:56	1.197
+++ LVM2/tools/toollib.c	2010/05/21 12:19:22	1.198
@@ -329,8 +329,9 @@
 		unlock_and_release_vg(cmd, vg, vgname);
 		if (ret > ret_max)
 			ret_max = ret;
+		/* FIXME: logic for breaking command is not consistent */
 		if (sigint_caught())
-			break;
+			return ECMD_FAILED;
 	}
 
 	return ret_max;
@@ -408,8 +409,9 @@
 		ret = process_single_seg(cmd, seg, handle);
 		if (ret > ret_max)
 			ret_max = ret;
+		/* FIXME: logic for breaking command is not consistent */
 		if (sigint_caught())
-			break;
+			return ECMD_FAILED;
 	}
 
 	return ret_max;


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

* LVM2 ./WHATS_NEW tools/toollib.c
@ 2010-04-14  2:19 agk
  0 siblings, 0 replies; 23+ messages in thread
From: agk @ 2010-04-14  2:19 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2010-04-14 02:19:49

Modified files:
	.              : WHATS_NEW 
	tools          : toollib.c 

Log message:
	Only pass visible LVs to tools in cmdline VG name/tag expansions without -a

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1516&r2=1.1517
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/toollib.c.diff?cvsroot=lvm2&r1=1.193&r2=1.194

--- LVM2/WHATS_NEW	2010/04/13 23:57:41	1.1516
+++ LVM2/WHATS_NEW	2010/04/14 02:19:49	1.1517
@@ -1,5 +1,6 @@
 Version 2.02.63 -  
 ================================
+  Only pass visible LVs to tools in cmdline VG name/tag expansions without -a.
   Use typedefs for toollib process_each functions.
   Use C locales and use_mlockall for clvmd.
   Refactor code related to vg->pvs list and add pv->vg link.
--- LVM2/tools/toollib.c	2010/04/13 23:57:41	1.193
+++ LVM2/tools/toollib.c	2010/04/14 02:19:49	1.194
@@ -125,6 +125,13 @@
 		if (lv_is_virtual_origin(lvl->lv) && !arg_count(cmd, all_ARG))
 			continue;
 
+		/*
+		 * Only let hidden LVs through it --all was used or the LVs 
+		 * were specifically named on the command line.
+		 */
+		if (!lvargs_supplied && !lv_is_visible(lvl->lv) && !arg_count(cmd, all_ARG))
+			continue;
+
 		/* Should we process this LV? */
 		if (process_all)
 			process_lv = 1;


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

* LVM2 ./WHATS_NEW tools/toollib.c
@ 2009-11-24 16:13 mbroz
  0 siblings, 0 replies; 23+ messages in thread
From: mbroz @ 2009-11-24 16:13 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2009-11-24 16:13:03

Modified files:
	.              : WHATS_NEW 
	tools          : toollib.c 

Log message:
	Do not try to unlock VG which is not locked.
	
	If the vg_read() returned error, no lock was taken,
	so always call vg_release().
	
	Otherwise this can happen because of missing FAILED_*:
	
	# vgchange -a y x --ignorelockingfailure
	Volume group "x" not found
	Internal error: Attempt to unlock unlocked VG x

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1325&r2=1.1326
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/toollib.c.diff?cvsroot=lvm2&r1=1.178&r2=1.179

--- LVM2/WHATS_NEW	2009/11/24 16:11:37	1.1325
+++ LVM2/WHATS_NEW	2009/11/24 16:13:02	1.1326
@@ -1,5 +1,6 @@
 Version 2.02.56 - 
 ====================================
+  Do not try to unlock VG which is not locked in _process_one_vg.
   Move persistent filter dump to more appropriate place.
   Refresh device filters before full device rescan in lvmcache.
   Return error status if vgchange fails to activate some volume.
--- LVM2/tools/toollib.c	2009/11/01 20:03:24	1.178
+++ LVM2/tools/toollib.c	2009/11/24 16:13:03	1.179
@@ -452,8 +452,7 @@
 		ret_max = ret;
 
 out:
-	if ((vg_read_error(vg) == FAILED_ALLOCATION)||
-	    (vg_read_error(vg) == FAILED_LOCKING))
+	if (vg_read_error(vg))
 		vg_release(vg);
 	else
 		unlock_and_release_vg(cmd, vg, vg_name);


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

* LVM2 ./WHATS_NEW tools/toollib.c
@ 2009-09-29 20:33 agk
  0 siblings, 0 replies; 23+ messages in thread
From: agk @ 2009-09-29 20:33 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2009-09-29 20:33:49

Modified files:
	.              : WHATS_NEW 
	tools          : toollib.c 

Log message:
	look up pvmove by pvmove LV when PVMOVE flag is set

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1281&r2=1.1282
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/toollib.c.diff?cvsroot=lvm2&r1=1.171&r2=1.172

--- LVM2/WHATS_NEW	2009/09/29 20:22:35	1.1281
+++ LVM2/WHATS_NEW	2009/09/29 20:33:49	1.1282
@@ -1,6 +1,5 @@
 Version 2.02.54 -
 =====================================
-  Don't attempt to restart pvmoves when deactivating LVs in vgchange.
   Restart lvconverts in vgchange by sharing lv_spawn_background_polling.
   Generalise polldaemon code by changing mirror-specific variable names.
   Don't attempt to deactivate an LV if any of its snapshots are in use.
--- LVM2/tools/toollib.c	2009/09/29 20:22:35	1.171
+++ LVM2/tools/toollib.c	2009/09/29 20:33:49	1.172
@@ -1253,7 +1253,12 @@
 {
 	const char *pvname;
 
-	if ((lv->status & LOCKED) &&
+	if ((lv->status & PVMOVE) &&
+	    (pvname = get_pvmove_pvname_from_lv_mirr(lv))) {
+		log_verbose("Spawning background pvmove process for %s",
+			    pvname);
+		pvmove_poll(cmd, pvname, 1);
+	} else if ((lv->status & LOCKED) &&
 	    (pvname = get_pvmove_pvname_from_lv(lv))) {
 		log_verbose("Spawning background pvmove process for %s",
 			    pvname);


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

* LVM2 ./WHATS_NEW tools/toollib.c
@ 2009-08-24 11:37 mbroz
  0 siblings, 0 replies; 23+ messages in thread
From: mbroz @ 2009-08-24 11:37 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2009-08-24 11:37:21

Modified files:
	.              : WHATS_NEW 
	tools          : toollib.c 

Log message:
	Fix global locking in PV reporting commands (2.02.49).

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1243&r2=1.1244
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/toollib.c.diff?cvsroot=lvm2&r1=1.166&r2=1.167

--- LVM2/WHATS_NEW	2009/08/20 07:03:02	1.1243
+++ LVM2/WHATS_NEW	2009/08/24 11:37:20	1.1244
@@ -1,5 +1,6 @@
 Version 2.02.52 -
 =================================
+  Fix global locking in PV reporting commands (2.02.49).
   Fix pvcreate string termination in duplicate uuid warning message.
   Fix pvcreate on a partition (2.02.51).
   Fix vgcfgrestore error paths when locking fails (2.02.49).
--- LVM2/tools/toollib.c	2009/07/21 11:10:49	1.166
+++ LVM2/tools/toollib.c	2009/08/24 11:37:21	1.167
@@ -643,7 +643,7 @@
 
 	dm_list_init(&tags);
 
-	if (lock_global && !lock_vol(cmd, VG_GLOBAL, LCK_READ)) {
+	if (lock_global && !lock_vol(cmd, VG_GLOBAL, LCK_VG_READ)) {
 		log_error("Unable to obtain global lock.");
 		return ECMD_FAILED;
 	}


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

* LVM2 ./WHATS_NEW tools/toollib.c
@ 2009-07-21 11:10 agk
  0 siblings, 0 replies; 23+ messages in thread
From: agk @ 2009-07-21 11:10 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2009-07-21 11:10:49

Modified files:
	.              : WHATS_NEW 
	tools          : toollib.c 

Log message:
	Return EINVALID_CMD_LINE not success when invalid VG name format is used.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1193&r2=1.1194
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/toollib.c.diff?cvsroot=lvm2&r1=1.165&r2=1.166

--- LVM2/WHATS_NEW	2009/07/16 03:25:26	1.1193
+++ LVM2/WHATS_NEW	2009/07/21 11:10:49	1.1194
@@ -1,5 +1,6 @@
 Version 2.02.50 - 
 ================================
+  Return EINVALID_CMD_LINE not success when invalid VG name format is used.
   Remove unnecessary messages after vgcreate/vgsplit refactor (2.02.49).
   Add log_errno to set a specific errno and replace log_error in due course.
   Add lvm_errno and lvm_errmsg to liblvm to obtain failure information.
--- LVM2/tools/toollib.c	2009/07/15 20:02:48	1.165
+++ LVM2/tools/toollib.c	2009/07/21 11:10:49	1.166
@@ -482,6 +482,8 @@
 				if (!validate_name(vg_name + 1)) {
 					log_error("Skipping invalid tag %s",
 						  vg_name);
+					if (ret_max < EINVALID_CMD_LINE)
+						ret_max = EINVALID_CMD_LINE;
 					continue;
 				}
 				if (!str_list_add(cmd->mem, &tags,
@@ -497,6 +499,8 @@
 			if (strchr(vg_name, '/')) {
 				log_error("Invalid volume group name: %s",
 					  vg_name);
+				if (ret_max < EINVALID_CMD_LINE)
+					ret_max = EINVALID_CMD_LINE;
 				continue;
 			}
 			if (!str_list_add(cmd->mem, &arg_vgnames,


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

* LVM2 ./WHATS_NEW tools/toollib.c
@ 2009-05-27 13:23 agk
  0 siblings, 0 replies; 23+ messages in thread
From: agk @ 2009-05-27 13:23 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2009-05-27 13:23:42

Modified files:
	.              : WHATS_NEW 
	tools          : toollib.c 

Log message:
	Skip virtual origins in process_each_lv_in_vg(). (mbroz)

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1126&r2=1.1127
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/toollib.c.diff?cvsroot=lvm2&r1=1.153&r2=1.154

--- LVM2/WHATS_NEW	2009/05/27 13:19:34	1.1126
+++ LVM2/WHATS_NEW	2009/05/27 13:23:41	1.1127
@@ -1,5 +1,6 @@
 Version 2.02.48 - 
 ===============================
+  Skip virtual origins in process_each_lv_in_vg().
   Fix counting of virtual origin LVs in vg_validate.
   Attempt to load dm-zero module if zero target needed but not present.
 
--- LVM2/tools/toollib.c	2009/05/21 03:04:53	1.153
+++ LVM2/tools/toollib.c	2009/05/27 13:23:42	1.154
@@ -122,6 +122,9 @@
 		if (lvl->lv->status & SNAPSHOT)
 			continue;
 
+		if (lv_is_virtual_origin(lvl->lv))
+			continue;
+
 		/* Should we process this LV? */
 		if (process_all)
 			process_lv = 1;


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

* LVM2 ./WHATS_NEW tools/toollib.c
@ 2009-04-10  9:54 mbroz
  0 siblings, 0 replies; 23+ messages in thread
From: mbroz @ 2009-04-10  9:54 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2009-04-10 09:54:36

Modified files:
	.              : WHATS_NEW 
	tools          : toollib.c 

Log message:
	Always return exit error status when locking of volume group fails.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1082&r2=1.1083
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/toollib.c.diff?cvsroot=lvm2&r1=1.146&r2=1.147

--- LVM2/WHATS_NEW	2009/04/10 09:53:42	1.1082
+++ LVM2/WHATS_NEW	2009/04/10 09:54:36	1.1083
@@ -1,5 +1,6 @@
 Version 2.02.46 - 
 ================================
+  Always return exit error status when locking of volume group fails.
   Fix mirror log convert validation question.
   Avoid referencing files from DESTDIR during build process.
   Avoid creating some static libraries without static_link.
--- LVM2/tools/toollib.c	2009/04/08 12:53:20	1.146
+++ LVM2/tools/toollib.c	2009/04/10 09:54:36	1.147
@@ -285,6 +285,7 @@
 			continue;	/* FIXME Unnecessary? */
 		if (!lock_vol(cmd, vgname, lock_type)) {
 			log_error("Can't lock %s: skipping", vgname);
+			ret_max = ECMD_FAILED;
 			continue;
 		}
 		if (lock_type & LCK_WRITE)
@@ -442,7 +443,7 @@
 
 	if (!lock_vol(cmd, vg_name, lock_type)) {
 		log_error("Can't lock volume group %s: skipping", vg_name);
-		return ret_max;
+		return ECMD_FAILED;
 	}
 
 	log_verbose("Finding volume group \"%s\"", vg_name);
@@ -745,6 +746,7 @@
 			dm_list_iterate_items(sll, vgnames) {
 				if (!lock_vol(cmd, sll->str, lock_type)) {
 					log_error("Can't lock %s: skipping", sll->str);
+					ret_max = ECMD_FAILED;
 					continue;
 				}
 				if (!(vg = vg_read_internal(cmd, sll->str, NULL, &consistent))) {


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

* LVM2 ./WHATS_NEW tools/toollib.c
@ 2008-06-10 15:25 wysochanski
  0 siblings, 0 replies; 23+ messages in thread
From: wysochanski @ 2008-06-10 15:25 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	wysochanski@sourceware.org	2008-06-10 15:25:38

Modified files:
	.              : WHATS_NEW 
	tools          : toollib.c 

Log message:
	Add ommitted unlock_vg() call when sigint_caught() during vg processing.
	
	Specific test case:
	1. pvcreate /dev/loop1; vgcreate vg1 /dev/loop1; lvcreate -L 64M -n lv1 vg1
	2. vgremove vg1 (will prompt user)
	3. CTRL-C
	Code will exit with:
	Do you really want to remove volume group "vg2" containing 2 logical volumes? [y/n]:
	Volume group "vg2" not removed
	Command failed with status code 5.
	Internal error: Volume Group vg2 was not unlocked
	Device '/dev/loop1' has been left open.
	
	After change:
	Do you really want to remove volume group "vg2" containing 2 logical volumes? [y/n]:
	Volume group "vg2" not removed
	Command failed with status code 5.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.894&r2=1.895
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/toollib.c.diff?cvsroot=lvm2&r1=1.133&r2=1.134

--- LVM2/WHATS_NEW	2008/06/10 14:55:14	1.894
+++ LVM2/WHATS_NEW	2008/06/10 15:25:37	1.895
@@ -1,5 +1,6 @@
 Version 2.02.38 - 
 =================================
+  Add omitted unlock_vg() call when sigint_caught() during vg processing.
   Fix wrong free_count on imported vg from pool device
   Fix segfault when calling pvcreate on the pool device
   Fix segfault after _free_vginfo by remembering to remove vginfo from list.
--- LVM2/tools/toollib.c	2008/04/10 19:59:43	1.133
+++ LVM2/tools/toollib.c	2008/06/10 15:25:38	1.134
@@ -514,9 +514,6 @@
 		ret_max = ret;
 	}
 
-	if (sigint_caught())
-		return ret_max;
-
 	unlock_vg(cmd, vg_name);
 
 	return ret_max;


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

* LVM2 ./WHATS_NEW tools/toollib.c
@ 2008-02-06 16:09 agk
  0 siblings, 0 replies; 23+ messages in thread
From: agk @ 2008-02-06 16:09 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2008-02-06 16:09:51

Modified files:
	.              : WHATS_NEW 
	tools          : toollib.c 

Log message:
	Fix 'pvs -a' to detect VGs of PVs without metadata areas.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.790&r2=1.791
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/toollib.c.diff?cvsroot=lvm2&r1=1.130&r2=1.131

--- LVM2/WHATS_NEW	2008/02/06 15:47:27	1.790
+++ LVM2/WHATS_NEW	2008/02/06 16:09:51	1.791
@@ -1,5 +1,6 @@
 Version 2.02.34 -
 ===================================
+  Fix 'pvs -a' to detect VGs of PVs without metadata areas.
   Divide up internal orphan volume group by format type.
   Update usage message for clvmd.
   Fix clvmd man page printing <br>, clarified debug options.
--- LVM2/tools/toollib.c	2008/01/30 14:00:02	1.130
+++ LVM2/tools/toollib.c	2008/02/06 16:09:51	1.131
@@ -648,6 +648,11 @@
 	int ret_max = 0;
 	int ret = 0;
 
+	if (!scan_vgs_for_pvs(cmd)) {
+		stack;
+		return ECMD_FAILED;
+	}
+
 	if (!(iter = dev_iter_create(cmd->filter, 1))) {
 		log_error("dev_iter creation failed");
 		return ECMD_FAILED;


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

* LVM2 ./WHATS_NEW tools/toollib.c
@ 2008-01-03 19:03 agk
  0 siblings, 0 replies; 23+ messages in thread
From: agk @ 2008-01-03 19:03 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2008-01-03 19:03:32

Modified files:
	.              : WHATS_NEW 
	tools          : toollib.c 

Log message:
	Fix vgreduce PV list processing not to process every PV in the VG.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.749&r2=1.750
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/toollib.c.diff?cvsroot=lvm2&r1=1.122&r2=1.123

--- LVM2/WHATS_NEW	2007/12/22 12:13:29	1.749
+++ LVM2/WHATS_NEW	2008/01/03 19:03:31	1.750
@@ -1,5 +1,6 @@
 Version 2.02.30 -
 ===================================
+  Fix vgreduce PV list processing not to process every PV in the VG. (2.02.29)
   Extend lvconvert to use polldaemon.
   Add support for stacked mirrors.
   Major restructuring of pvmove and lvconvert layer manipulation code.
--- LVM2/tools/toollib.c	2007/12/22 02:13:00	1.122
+++ LVM2/tools/toollib.c	2008/01/03 19:03:32	1.123
@@ -746,14 +746,7 @@
 			if (sigint_caught())
 				return ret_max;
 		}
-		if (vg) {
-			ret = process_each_pv_in_vg(cmd, vg, &tags,
-						    handle, process_single);
-			if (ret > ret_max)
-				ret_max = ret;
-			if (sigint_caught())
-				return ret_max;
-		} else if (!list_empty(&tags) && (vgnames = get_vgs(cmd, 0)) &&
+		if (!list_empty(&tags) && (vgnames = get_vgs(cmd, 0)) &&
 			   !list_empty(vgnames)) {
 			list_iterate_items(sll, vgnames) {
 				if (!lock_vol(cmd, sll->str, lock_type)) {


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

* LVM2 ./WHATS_NEW tools/toollib.c
@ 2007-09-11 20:12 meyering
  0 siblings, 0 replies; 23+ messages in thread
From: meyering @ 2007-09-11 20:12 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	meyering@sourceware.org	2007-09-11 20:12:54

Modified files:
	.              : WHATS_NEW 
	tools          : toollib.c 

Log message:
	Diagnose invalid PE values given on the pvmove command line (64-bit systems).
	
	* tools/toollib.c (xstrtouint32): New function.
	(_parse_pes): Use xstrtouint32; don't cast strtoul's unsigned
	long to uint32_t.  Detect overflow.
	
	Author: Jim Meyering <jim@meyering.net>

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.704&r2=1.705
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/toollib.c.diff?cvsroot=lvm2&r1=1.105&r2=1.106

--- LVM2/WHATS_NEW	2007/09/11 13:49:51	1.704
+++ LVM2/WHATS_NEW	2007/09/11 20:12:54	1.705
@@ -1,5 +1,6 @@
 Version 2.02.29 -
 ==================================
+  Diagnose invalid PE values given on the pvmove command line (64-bit systems).
   Include strerror string in dev_open_flags' stat failure message.
   Move guts of pvresize into library.
   Avoid error when --corelog is provided without --mirrorlog. (2.02.28)
--- LVM2/tools/toollib.c	2007/08/22 14:38:18	1.105
+++ LVM2/tools/toollib.c	2007/09/11 20:12:54	1.106
@@ -911,6 +911,18 @@
 	return 1;
 }
 
+static int xstrtouint32(const char *s, char **p, int base, uint32_t *result)
+{
+	unsigned long ul;
+
+	errno = 0;
+	ul = strtoul(s, p, base);
+	if (errno || *p == s || (uint32_t) ul != ul)
+		return -1;
+	*result = ul;
+	return 0;
+}
+
 static int _parse_pes(struct dm_pool *mem, char *c, struct list *pe_ranges,
 		      const char *pvname, uint32_t size)
 {
@@ -942,8 +954,7 @@
 
 		/* Start extent given? */
 		if (isdigit(*c)) {
-			start = (uint32_t) strtoul(c, &endptr, 10);
-			if (endptr == c)
+			if (xstrtouint32(c, &endptr, 10, &start))
 				goto error;
 			c = endptr;
 			/* Just one number given? */
@@ -954,8 +965,7 @@
 		if (*c == '-') {
 			c++;
 			if (isdigit(*c)) {
-				end = (uint32_t) strtoul(c, &endptr, 10);
-				if (endptr == c)
+				if (xstrtouint32(c, &endptr, 10, &end))
 					goto error;
 				c = endptr;
 			}


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

* LVM2 ./WHATS_NEW tools/toollib.c
@ 2007-07-10 17:51 agk
  0 siblings, 0 replies; 23+ messages in thread
From: agk @ 2007-07-10 17:51 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2007-07-10 17:51:26

Modified files:
	.              : WHATS_NEW 
	tools          : toollib.c 

Log message:
	Call dev_iter_destroy() if _process_all_devs() is interrupted by sigint.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.649&r2=1.650
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/toollib.c.diff?cvsroot=lvm2&r1=1.101&r2=1.102

--- LVM2/WHATS_NEW	2007/07/09 15:40:42	1.649
+++ LVM2/WHATS_NEW	2007/07/10 17:51:26	1.650
@@ -1,5 +1,6 @@
 Version 2.02.27 - 
 ================================
+  Call dev_iter_destroy() if _process_all_devs() is interrupted by sigint.
   Add vg_mda_count and pv_mda_count columns to reports.
   Fix dumpconfig to use log_print instead of stdout directly.
   Remove unused parameter 'fid' from _add_pv_to_vg.
--- LVM2/tools/toollib.c	2007/06/19 04:36:12	1.101
+++ LVM2/tools/toollib.c	2007/07/10 17:51:26	1.102
@@ -659,7 +659,7 @@
 		if (ret > ret_max)
 			ret_max = ret;
 		if (sigint_caught())
-			return ret_max;
+			break;
 	}
 
 	dev_iter_destroy(iter);


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

* LVM2 ./WHATS_NEW tools/toollib.c
@ 2006-10-24 18:25 agk
  0 siblings, 0 replies; 23+ messages in thread
From: agk @ 2006-10-24 18:25 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2006-10-24 18:25:30

Modified files:
	.              : WHATS_NEW 
	tools          : toollib.c 

Log message:
	Add dev_flush() to set_lv()

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.480&r2=1.481
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/toollib.c.diff?cvsroot=lvm2&r1=1.91&r2=1.92

--- LVM2/WHATS_NEW	2006/10/24 17:18:24	1.480
+++ LVM2/WHATS_NEW	2006/10/24 18:25:30	1.481
@@ -1,5 +1,6 @@
 Version 2.02.13 -
 ===================================
+  Add dev_flush() to set_lv().
   Add lvchange --resync.
   Perform high-level free space check before each allocation attempt.
   Don't allow a node to remove an LV that's exclusively active on anther node.
--- LVM2/tools/toollib.c	2006/10/21 23:18:43	1.91
+++ LVM2/tools/toollib.c	2006/10/24 18:25:30	1.92
@@ -1222,6 +1222,7 @@
 		return 0;
 
 	dev_set(dev, UINT64_C(0), (size_t) 4096, value);
+	dev_flush(dev);
 	dev_close_immediate(dev);
 
 	return 1;


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

* LVM2 ./WHATS_NEW tools/toollib.c
@ 2006-06-14 20:27 agk
  0 siblings, 0 replies; 23+ messages in thread
From: agk @ 2006-06-14 20:27 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2006-06-14 20:27:15

Modified files:
	.              : WHATS_NEW 
	tools          : toollib.c 

Log message:
	Fix return code if VG specified on command line is not found.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.403&r2=1.404
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/toollib.c.diff?cvsroot=lvm2&r1=1.83&r2=1.84

--- LVM2/WHATS_NEW	2006/06/14 20:11:22	1.403
+++ LVM2/WHATS_NEW	2006/06/14 20:27:15	1.404
@@ -1,5 +1,6 @@
 Version 2.02.07 - 
 =================================
+  Fix return code if VG specified on command line is not found.
   Fix PV tools to include orphaned PVs in default output again.
   Fixed unaligned access when using clvm.
   Fix an extra dev_close in a label_read error path.
--- LVM2/tools/toollib.c	2006/05/11 18:39:24	1.83
+++ LVM2/tools/toollib.c	2006/06/14 20:27:15	1.84
@@ -413,7 +413,7 @@
 	if (!(vg = vg_read(cmd, vg_name, vgid, &consistent))) {
 		log_error("Volume group \"%s\" not found", vg_name);
 		unlock_vg(cmd, vg_name);
-		return ret_max;
+		return ECMD_FAILED;
 	}
 
 	if (!list_empty(tags)) {


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

* LVM2 ./WHATS_NEW tools/toollib.c
@ 2004-05-20 16:18 agk
  0 siblings, 0 replies; 23+ messages in thread
From: agk @ 2004-05-20 16:18 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2004-05-20 16:18:58

Modified files:
	.              : WHATS_NEW 
	tools          : toollib.c 

Log message:
	Don't return non-zero status if there aren't any volume groups

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.33&r2=1.34
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/tools/toollib.c.diff?cvsroot=lvm2&r1=1.56&r2=1.57


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

* LVM2 ./WHATS_NEW tools/toollib.c
@ 2004-05-05 18:31 agk
  0 siblings, 0 replies; 23+ messages in thread
From: agk @ 2004-05-05 18:31 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2004-05-05 18:31:38

Modified files:
	.              : WHATS_NEW 
	tools          : toollib.c 

Log message:
	Detect invalid LV names in arg lists.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.24&r2=1.25
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/tools/toollib.c.diff?cvsroot=lvm2&r1=1.53&r2=1.54


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

end of thread, other threads:[~2012-01-25 21:52 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-18 19:19 LVM2 ./WHATS_NEW tools/toollib.c zkabelac
  -- strict thread matches above, loose matches on Subject: below --
2012-01-25 21:52 zkabelac
2011-02-18 15:02 zkabelac
2010-11-23 20:39 zkabelac
2010-05-21 14:15 zkabelac
2010-05-21 14:11 zkabelac
2010-05-21 12:19 zkabelac
2010-04-14  2:19 agk
2009-11-24 16:13 mbroz
2009-09-29 20:33 agk
2009-08-24 11:37 mbroz
2009-07-21 11:10 agk
2009-05-27 13:23 agk
2009-04-10  9:54 mbroz
2008-06-10 15:25 wysochanski
2008-02-06 16:09 agk
2008-01-03 19:03 agk
2007-09-11 20:12 meyering
2007-07-10 17:51 agk
2006-10-24 18:25 agk
2006-06-14 20:27 agk
2004-05-20 16:18 agk
2004-05-05 18:31 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).