Skip to contentSkip to conversation

master - cleanup: add some dots and use display_lvname

PATCH Zdenek Kabelac 1 participant 1 message Nov 25, 2016

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=1a4f13eb6e4de75884f7950a5feeff90614b93cf
Commit:        1a4f13eb6e4de75884f7950a5feeff90614b93cf
Parent:        1d58074d9fc4a01c5ca99af0ba26a5521a541092
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Fri Nov 25 14:08:39 2016 +0100
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Fri Nov 25 15:01:27 2016 +0100

cleanup: add some dots and use display_lvname

Just some more VG/LV printing.

---
 lib/activate/dev_manager.c |    6 ++--
 lib/metadata/lv_manip.c    |   62 +++++++++++++++++++++++--------------------
 lib/metadata/metadata.c    |    6 ++--
 lib/metadata/raid_manip.c  |   12 ++++----
 tools/lvcreate.c           |    2 +-
 tools/toollib.c            |   11 +++----
 tools/vgreduce.c           |   22 ++++++++--------
 7 files changed, 62 insertions(+), 59 deletions(-)
lib/activate/dev_manager.c +3 -3
index 642e6a1..b8b1235 100644
@@ -424,7 +424,7 @@ static int _ignore_suspended_snapshot_component(struct device *dev)
 		return_0;
 
 	if (!dm_task_run(dmt)) {
-		log_error("Failed to get state of snapshot or snapshot origin device");
+		log_error("Failed to get state of snapshot or snapshot origin device.");
 		goto out;
 	}
 
@@ -432,13 +432,13 @@ static int _ignore_suspended_snapshot_component(struct device *dev)
 		next = dm_get_next_target(dmt, next, &start, &length, &target_type, &params);
 		if (!target_type || !strcmp(target_type, TARGET_NAME_SNAPSHOT)) {
 			if (!params || sscanf(params, "%d:%d %d:%d", &major1, &minor1, &major2, &minor2) != 4) {
-				log_error("Incorrect snapshot table found");
+				log_error("Incorrect snapshot table found.");
 				goto out;
 			}
 			r = r || _device_is_suspended(major1, minor1) || _device_is_suspended(major2, minor2);
 		} else if (!strcmp(target_type, TARGET_NAME_SNAPSHOT_ORIGIN)) {
 			if (!params || sscanf(params, "%d:%d", &major1, &minor1) != 2) {
-				log_error("Incorrect snapshot-origin table found");
+				log_error("Incorrect snapshot-origin table found.");
 				goto out;
 			}
 			r = r || _device_is_suspended(major1, minor1);
lib/metadata/lv_manip.c +33 -29

155 lines not on this page · raw message

lib/metadata/metadata.c +3 -3
index 78028cf..ad6cb2a 100644
@@ -828,18 +828,18 @@ int vg_extend_each_pv(struct volume_group *vg, struct pvcreate_params *pp)
 	struct pv_list *pvl;
 	unsigned int max_phys_block_size = 0;
 
-	log_debug_metadata("Adding PVs to VG %s", vg->name);
+	log_debug_metadata("Adding PVs to VG %s.", vg->name);
 
 	if (_vg_bad_status_bits(vg, RESIZEABLE_VG))
 		return_0;
 
 	dm_list_iterate_items(pvl, &pp->pvs) {
-		log_debug_metadata("Adding PV %s to VG %s", pv_dev_name(pvl->pv), vg->name);
+		log_debug_metadata("Adding PV %s to VG %s.", pv_dev_name(pvl->pv), vg->name);
 
 		if (!(check_dev_block_size_for_vg(pvl->pv->dev,
 						  (const struct volume_group *) vg,
 						  &max_phys_block_size))) {
-			log_error("PV %s has wrong block size", pv_dev_name(pvl->pv));
+			log_error("PV %s has wrong block size.", pv_dev_name(pvl->pv));
 			return 0;
 		}
 
lib/metadata/raid_manip.c +6 -6
index dfe1adf..0793017 100644
@@ -1860,24 +1860,24 @@ static int _alloc_and_add_rmeta_devs_for_lv(struct logical_volume *lv, struct dm
 
 	dm_list_init(&meta_lvs);
 
-	log_debug_metadata("Allocating metadata LVs for %s", display_lvname(lv));
+	log_debug_metadata("Allocating metadata LVs for %s.", display_lvname(lv));
 	if (!_alloc_rmeta_devs_for_lv(lv, &meta_lvs, allocate_pvs, &seg_meta_areas)) {
-		log_error("Failed to allocate metadata LVs for %s", display_lvname(lv));
+		log_error("Failed to allocate metadata LVs for %s.", display_lvname(lv));
 		return 0;
 	}
 
 	/* Metadata LVs must be cleared before being added to the array */
-	log_debug_metadata("Clearing newly allocated metadata LVs for %s", display_lvname(lv));
+	log_debug_metadata("Clearing newly allocated metadata LVs for %s.", display_lvname(lv));
 	if (!_clear_lvs(&meta_lvs)) {
-		log_error("Failed to initialize metadata LVs for %s", display_lvname(lv));
+		log_error("Failed to initialize metadata LVs for %s.", display_lvname(lv));
 		return 0;
 	}
 
 	/* Set segment areas for metadata sub_lvs */
 	seg->meta_areas = seg_meta_areas;
-	log_debug_metadata("Adding newly allocated metadata LVs to %s", display_lvname(lv));
+	log_debug_metadata("Adding newly allocated metadata LVs to %s.", display_lvname(lv));
 	if (!_add_image_component_list(seg, 1, 0, &meta_lvs, 0)) {
-		log_error("Failed to add newly allocated metadata LVs to %s", display_lvname(lv));
+		log_error("Failed to add newly allocated metadata LVs to %s.", display_lvname(lv));
 		return 0;
 	}
 
tools/lvcreate.c +1 -1
index f70984a..0512585 100644
@@ -1596,7 +1596,7 @@ static int _lvcreate_single(struct cmd_context *cmd, const char *vg_name,
 	}
 
 	if (seg_is_thin_volume(lp))
-		log_verbose("Making thin LV %s in pool %s in VG %s%s%s using segtype %s",
+		log_verbose("Making thin LV %s in pool %s in VG %s%s%s using segtype %s.",
 			    lp->lv_name ? : "with generated name",
 			    lp->pool_name ? : "with generated name", lp->vg_name,
 			    lp->snapshot ? " as snapshot of " : "",
tools/toollib.c +5 -6
index 3562937..8c76291 100644
@@ -451,17 +451,16 @@ static int _add_pe_range(struct dm_pool *mem, const char *pvname,
 {
 	struct pe_range *per;
 
-	log_debug("Adding PE range: start PE %" PRIu32 " length %" PRIu32
-		  " on %s.", start, count, pvname);
+	log_debug("Adding PE range: start PE " FMTu32 " length " FMTu32 " on %s.",
+		  start, count, pvname);
 
 	/* Ensure no overlap with existing areas */
 	dm_list_iterate_items(per, pe_ranges) {
 		if (((start < per->start) && (start + count - 1 >= per->start)) ||
 		    ((start >= per->start) &&
 			(per->start + per->count - 1) >= start)) {
-			log_error("Overlapping PE ranges specified (%" PRIu32
-				  "-%" PRIu32 ", %" PRIu32 "-%" PRIu32 ")"
-				  " on %s.",
+			log_error("Overlapping PE ranges specified (" FMTu32
+				  "-" FMTu32 ", " FMTu32 "-" FMTu32 ") on %s.",
 				  start, start + count - 1, per->start,
 				  per->start + per->count - 1, pvname);
 			return 0;
@@ -637,7 +636,7 @@ struct dm_list *create_pv_list(struct dm_pool *mem, struct volume_group *vg, int
 
 	/* Build up list of PVs */
 	if (!(r = dm_pool_alloc(mem, sizeof(*r)))) {
-		log_error("Allocation of list failed");
+		log_error("Allocation of list failed.");
 		return NULL;
 	}
 	dm_list_init(r);
tools/vgreduce.c +11 -11
index 7b9f506..42893df 100644
@@ -26,19 +26,19 @@ static int _remove_pv(struct volume_group *vg, struct pv_list *pvl, int silent)
 	char uuid[64] __attribute__((aligned(8)));
 
 	if (vg->pv_count == 1) {
-		log_error("Volume Groups must always contain at least one PV");
+		log_error("Volume Groups must always contain at least one PV.");
 		return 0;
 	}
 
 	if (!id_write_format(&pvl->pv->id, uuid, sizeof(uuid)))
 		return_0;
 
-	log_verbose("Removing PV with UUID %s from VG %s", uuid, vg->name);
+	log_verbose("Removing PV with UUID %s from VG %s.", uuid, vg->name);
 
 	if (pvl->pv->pe_alloc_count) {
 		if (!silent)
 			log_error("LVs still present on PV with UUID %s: "
-				  "Can't remove from VG %s", uuid, vg->name);
+				  "Can't remove from VG %s.", uuid, vg->name);
 		return 0;
 	}
 
@@ -183,33 +183,33 @@ int vgreduce(struct cmd_context *cmd, int argc, char **argv)
 
 	if (!argc && !repairing) {
 		log_error("Please give volume group name and "
-			  "physical volume paths");
+			  "physical volume paths.");
 		return EINVALID_CMD_LINE;
 	}
 	
 	if (!argc) { /* repairing */
-		log_error("Please give volume group name");
+		log_error("Please give volume group name.");
 		return EINVALID_CMD_LINE;
 	}
 
 	if (arg_is_set(cmd, mirrorsonly_ARG) && !repairing) {
-		log_error("--mirrorsonly requires --removemissing");
+		log_error("--mirrorsonly requires --removemissing.");
 		return EINVALID_CMD_LINE;
 	}
 
 	if (argc == 1 && !arg_is_set(cmd, all_ARG) && !repairing) {
-		log_error("Please enter physical volume paths or option -a");
+		log_error("Please enter physical volume paths or option -a.");
 		return EINVALID_CMD_LINE;
 	}
 
 	if (argc > 1 && arg_is_set(cmd, all_ARG)) {
 		log_error("Option -a and physical volume paths mutually "
-			  "exclusive");
+			  "exclusive.");
 		return EINVALID_CMD_LINE;
 	}
 
 	if (argc > 1 && repairing) {
-		log_error("Please only specify the volume group");
+		log_error("Please only specify the volume group.");
 		return EINVALID_CMD_LINE;
 	}
 
@@ -250,10 +250,10 @@ int vgreduce(struct cmd_context *cmd, int argc, char **argv)
 			0, handle, &_vgreduce_repair_single);
 
 	if (vp.already_consistent) {
-		log_print_unless_silent("Volume group \"%s\" is already consistent", vg_name);
+		log_print_unless_silent("Volume group \"%s\" is already consistent.", vg_name);
 		ret = ECMD_PROCESSED;
 	} else if (vp.fixed) {
-		log_print_unless_silent("Wrote out consistent volume group %s", vg_name);
+		log_print_unless_silent("Wrote out consistent volume group %s.", vg_name);
 		ret = ECMD_PROCESSED;
 	} else
 		ret = ECMD_FAILED;