]> sourceware.org Git - lvm2.git/commitdiff
cleanup: display_lvname update message
authorZdenek Kabelac <zkabelac@redhat.com>
Tue, 27 Mar 2018 19:08:20 +0000 (21:08 +0200)
committerZdenek Kabelac <zkabelac@redhat.com>
Fri, 20 Apr 2018 10:17:01 +0000 (12:17 +0200)
Add more display_lvname usage.
Update some error messages.
Indent.

lib/metadata/mirror.c
tools/pvmove.c

index 8fcf94e08f498e9a7867299893df10913a1578c6..13e1474f7e19e5d2ef00f15955952537bc8ed799 100644 (file)
@@ -606,12 +606,12 @@ static int _mirrored_lv_in_sync(struct logical_volume *lv)
                               NULL)) {
                if (lv_is_active_but_not_locally(lv))
                        log_error("Unable to determine mirror sync status of"
-                                 " remotely active LV, %s/%s",
-                                 lv->vg->name, lv->name);
+                                 " remotely active LV, %s",
+                                 display_lvname(lv));
                else
                        log_error("Unable to determine mirror "
-                                 "sync status of %s/%s.",
-                                 lv->vg->name, lv->name);
+                                 "sync status of %s.",
+                                 display_lvname(lv));
                return 0;
        }
 
@@ -700,7 +700,7 @@ static int _split_mirror_images(struct logical_volume *lv,
 
        new_lv->name = dm_pool_strdup(lv->vg->vgmem, split_name);
        if (!new_lv->name) {
-               log_error("Unable to rename newly split LV");
+               log_error("Unable to rename newly split LV.");
                return 0;
        }
 
@@ -1141,14 +1141,14 @@ int collapse_mirrored_lv(struct logical_volume *lv)
        while ((tmp_lv = find_temporary_mirror(lv))) {
                mirror_seg = find_mirror_seg(first_seg(tmp_lv));
                if (!mirror_seg) {
-                       log_error("Failed to find mirrored LV for %s",
-                                 tmp_lv->name);
+                       log_error("Failed to find mirrored LV for %s.",
+                                 display_lvname(tmp_lv));
                        return 0;
                }
 
                if (!_mirrored_lv_in_sync(mirror_seg->lv)) {
-                       log_verbose("Not collapsing %s: out-of-sync",
-                                   mirror_seg->lv->name);
+                       log_verbose("Not collapsing %s: out-of-sync.",
+                                   display_lvname(mirror_seg->lv));
                        return 1;
                }
 
@@ -1339,8 +1339,8 @@ static int _create_mimage_lvs(struct alloc_handle *ah,
 
        for (m = 0; m < num_mirrors; m++) {
                if (!(img_lvs[m] = lv_create_empty(img_name,
-                                            NULL, LVM_READ | LVM_WRITE,
-                                            ALLOC_INHERIT, lv->vg))) {
+                                                  NULL, LVM_READ | LVM_WRITE,
+                                                  ALLOC_INHERIT, lv->vg))) {
                        log_error("Aborting. Failed to create mirror image LV. "
                                  "Remove new LV and retry.");
                        return 0;
@@ -1352,7 +1352,7 @@ static int _create_mimage_lvs(struct alloc_handle *ah,
                        if (!lv_add_log_segment(ah, first_area, img_lvs[m], 0)) {
                                log_error("Failed to add mirror image segment"
                                          " to %s. Remove new LV and retry.",
-                                         img_lvs[m]->name);
+                                         display_lvname(img_lvs[m]));
                                return 0;
                        }
                } else {
@@ -1361,7 +1361,7 @@ static int _create_mimage_lvs(struct alloc_handle *ah,
                                            stripe_size, 0, 0)) {
                                log_error("Aborting. Failed to add mirror image segment "
                                          "to %s. Remove new LV and retry.",
-                                         img_lvs[m]->name);
+                                         display_lvname(img_lvs[m]));
                                return 0;
                        }
                }
@@ -1385,13 +1385,14 @@ int remove_mirrors_from_segments(struct logical_volume *lv,
        /* Check the segment params are compatible */
        dm_list_iterate_items(seg, &lv->segments) {
                if (!seg_is_mirrored(seg)) {
-                       log_error("Segment is not mirrored: %s:%" PRIu32,
-                                 lv->name, seg->le);
+                       log_error("Segment is not mirrored: %s:" FMTu32,
+                                 display_lvname(lv), seg->le);
                        return 0;
                }
                if ((seg->status & status_mask) != status_mask) {
-                       log_error("Segment status does not match: %s:%" PRIu32
-                                 " status:0x%" PRIx64 "/0x%" PRIx64, lv->name, seg->le,
+                       log_error("Segment status does not match: %s:" FMTu32
+                                 " status:0x" FMTx64 "/0x" FMTx64,
+                                 display_lvname(lv), seg->le,
                                  seg->status, status_mask);
                        return 0;
                }
@@ -1523,7 +1524,7 @@ struct dm_list *lvs_using_lv(struct cmd_context *cmd, struct volume_group *vg,
        uint32_t s;
 
        if (!(lvs = dm_pool_alloc(cmd->mem, sizeof(*lvs)))) {
-               log_error("lvs list alloc failed");
+               log_error("lvs list alloc failed.");
                return NULL;
        }
 
@@ -1542,7 +1543,7 @@ struct dm_list *lvs_using_lv(struct cmd_context *cmd, struct volume_group *vg,
                                    seg_lv(seg, s) != lv)
                                        continue;
                                if (!(lvl = dm_pool_alloc(cmd->mem, sizeof(*lvl)))) {
-                                       log_error("lv_list alloc failed");
+                                       log_error("lv_list alloc failed.");
                                        return NULL;
                                }
                                lvl->lv = lv1;
index 9ad17f637d3dea8f817ecd07522f598856d6fbd8..754bd5857150c4c106cad4c19d6b75b96b0228ca 100644 (file)
@@ -465,7 +465,7 @@ static struct logical_volume *_set_up_pvmove_lv(struct cmd_context *cmd,
                        /* With exclusive pvmove skip LV when:
                         *  - is active remotely
                         *  - is not active locally and cannot be activated exclusively locally
-                         *
+                        *
                         * Note: lvm2 can proceed with exclusive pvmove for 'just' locally active LVs
                         * in the case it's NOT active anywhere else, since LOCKED LVs cannot be
                         * later activated by user.
This page took 0.041527 seconds and 5 git commands to generate.