Just some more VG/LV printing.
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;
}
next = dm_get_next_target(dmt, next, &start, &length, &target_type, ¶ms);
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);
}
}
- log_very_verbose("Adding %s:%" PRIu32 " as an user of %s",
- seg->lv->name, seg->le, lv->name);
+ log_very_verbose("Adding %s:" FMTu32 " as an user of %s.",
+ display_lvname(seg->lv), seg->le, display_lvname(lv));
if (!(sl = dm_pool_zalloc(lv->vg->vgmem, sizeof(*sl)))) {
- log_error("Failed to allocate segment list");
+ log_error("Failed to allocate segment list.");
return 0;
}
if (sl->count > 1)
sl->count--;
else {
- log_very_verbose("%s:%" PRIu32 " is no longer a user "
- "of %s", seg->lv->name, seg->le,
- lv->name);
+ log_very_verbose("%s:" FMTu32 " is no longer a user of %s.",
+ display_lvname(seg->lv), seg->le,
+ display_lvname(lv));
dm_list_del(&sl->list);
}
return 1;
}
- log_error(INTERNAL_ERROR "Segment %s:%u is not a user of %s.",
- seg->lv->name, seg->le, lv->name);
+ log_error(INTERNAL_ERROR "Segment %s:" FMTu32 " is not a user of %s.",
+ display_lvname(seg->lv), seg->le, display_lvname(lv));
return 0;
}
if (sl->count != 1) {
log_error("%s is expected to have only one segment using it, "
- "while %s:%" PRIu32 " uses it %d times.",
- display_lvname(lv), sl->seg->lv->name, sl->seg->le, sl->count);
+ "while %s:" FMTu32 " uses it %d times.",
+ display_lvname(lv), display_lvname(sl->seg->lv),
+ sl->seg->le, sl->count);
return NULL;
}
/* Round up extents to stripe divisible amount */
if ((size_rest = extents % stripes)) {
new_extents += extend ? stripes - size_rest : -size_rest;
- log_print_unless_silent("Rounding size %s (%d extents) up to stripe boundary size %s (%d extents).",
+ log_print_unless_silent("Rounding size %s (%u extents) up to stripe boundary size %s (%u extents).",
display_size(vg->cmd, (uint64_t) extents * vg->extent_size), extents,
display_size(vg->cmd, (uint64_t) new_extents * vg->extent_size), new_extents);
}
return 0;
} else {
if (!lv_remove(lv)) {
- log_error("Failed to remove RAID image %s",
- lv->name);
+ log_error("Failed to remove RAID image %s.",
+ display_lvname(lv));
return 0;
}
}
if (seg->meta_areas && seg_metalv(seg, s) && (area_reduction == seg->area_len)) {
if (!lv_reduce(seg_metalv(seg, s),
seg_metalv(seg, s)->le_count)) {
- log_error("Failed to remove RAID meta-device %s",
- seg_metalv(seg, s)->name);
+ log_error("Failed to remove RAID meta-device %s.",
+ display_lvname(seg_metalv(seg, s)));
return 0;
}
}
}
if (area_reduction == seg->area_len) {
- log_very_verbose("Remove %s:%" PRIu32 "[%" PRIu32 "] from "
- "the top of LV %s:%" PRIu32,
- seg->lv->name, seg->le, s,
- lv->name, seg_le(seg, s));
+ log_very_verbose("Remove %s:" FMTu32 "[" FMTu32 "] from "
+ "the top of LV %s:" FMTu32 ".",
+ display_lvname(seg->lv), seg->le, s,
+ display_lvname(lv), seg_le(seg, s));
if (!remove_seg_from_segs_using_this_lv(lv, seg))
return_0;
+
seg_lv(seg, s) = NULL;
seg_le(seg, s) = 0;
seg_type(seg, s) = AREA_UNASSIGNED;
seg->area_count, seg->area_len,
seg->chunk_size, region_size,
seg->extents_copied, NULL))) {
- log_error("Couldn't allocate converted LV segment");
+ log_error("Couldn't allocate converted LV segment.");
return NULL;
}
if (!lv_is_pvmove(lv)) {
log_error(INTERNAL_ERROR
- "Non-pvmove LV, %s, passed as argument", lv->name);
+ "Non-pvmove LV, %s, passed as argument.",
+ display_lvname(lv));
return 0;
}
if (seg_type(first_seg(lv), 0) != AREA_PV) {
log_error(INTERNAL_ERROR
- "Bad segment type for first segment area");
+ "Bad segment type for first segment area.");
return 0;
}
*/
dm_list_iterate_items(aa, &ah->alloced_areas[0]) {
if (!(seg = find_seg_by_le(lv, current_le))) {
- log_error("Failed to find segment for %s extent %"
- PRIu32, lv->name, current_le);
+ log_error("Failed to find segment for %s extent " FMTu32 ".",
+ display_lvname(lv), current_le);
return 0;
}
if (aa[0].len < seg->area_len) {
if (!lv_split_segment(lv, seg->le + aa[0].len)) {
log_error("Failed to split segment at %s "
- "extent %" PRIu32, lv->name, le);
+ "extent " FMTu32 ".",
+ display_lvname(lv), le);
return 0;
}
}
current_le = le;
if (!insert_layer_for_lv(lv->vg->cmd, lv, PVMOVE, "_mimage_0")) {
- log_error("Failed to build pvmove LV-type mirror, %s",
- lv->name);
+ log_error("Failed to build pvmove LV-type mirror %s.",
+ display_lvname(lv));
return 0;
}
orig_lv = seg_lv(first_seg(lv), 0);
dm_list_iterate_items(aa, &ah->alloced_areas[0]) {
if (!(seg = find_seg_by_le(orig_lv, current_le))) {
- log_error("Failed to find segment for %s extent %"
- PRIu32, lv->name, current_le);
+ log_error("Failed to find segment for %s extent " FMTu32 ".",
+ display_lvname(lv), current_le);
return 0;
}
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;
}
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;
}
}
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 " : "",
{
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;
/* 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);
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;
}
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;
}
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;