QCOW2_FMT already adds the "dm-qcow2: <dev>: " prefix and the trailing
newline, so several messages were printed like:

    dm-qcow2: <dev>: dm-qcow2: Can't parse metadata

and some of them were followed by an empty line. Drop the redundant
prefix and newlines.

https://virtuozzo.atlassian.net/browse/VSTOR-148171
Feature: dm-qcow2: block device over QCOW2 files driver

Signed-off-by: Alexander Ivanov <[email protected]>
Reviewed-by: Denis V. Lunev <[email protected]>
Reviewed-by: Andrey Zhadchenko <[email protected]>
---
 drivers/md/dm-qcow2-target.c | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/drivers/md/dm-qcow2-target.c b/drivers/md/dm-qcow2-target.c
index 0cbbd8e4f493..bb322254cea9 100644
--- a/drivers/md/dm-qcow2-target.c
+++ b/drivers/md/dm-qcow2-target.c
@@ -192,7 +192,7 @@ void qcow2_flush_deferred_activity(struct qcow2_target 
*tgt, struct qcow2 *qcow2
                md = rb_entry(node, struct md_page, node);
                /* FIXME: call md_make_dirty() and try once again? */
                if (md->status & MD_WRITEBACK_ERROR) {
-                       QC_ERR(tgt->ti, "qcow2: Failed to write dirty pages");
+                       QC_ERR(tgt->ti, "Failed to write dirty pages");
                        tgt->md_writeback_error = true;
                        break;
                }
@@ -840,19 +840,19 @@ static int qcow2_parse_extensions(struct dm_target *ti, 
struct qcow2 *qcow2,
                        struct Qcow2BitmapHeaderExt bitmaps_ext;
 
                        if (ext.len != sizeof(bitmaps_ext)) {
-                               QC_ERR(ti, "unexpected bitmap extension 
size\n");
+                               QC_ERR(ti, "unexpected bitmap extension size");
                                return -EINVAL;
                        }
 
                        if (offset + sizeof(bitmaps_ext) > end) {
-                               QC_ERR(ti, "unexpected end of extension 
area\n");
+                               QC_ERR(ti, "unexpected end of extension area");
                                return -EINVAL;
                        }
 
                        memcpy(&bitmaps_ext, addr + offset, 
sizeof(bitmaps_ext));
                        ret = qcow2_parse_bitmap_ext(ti, qcow2, &bitmaps_ext);
                        if (ret) {
-                               QC_ERR(ti, "unable to pase bitmap extension\n");
+                               QC_ERR(ti, "unable to parse bitmap extension");
                                return ret;
                        }
                        break;
@@ -886,7 +886,7 @@ static int qcow2_parse_header(struct dm_target *ti, struct 
qcow2 *qcow2,
                new_size = PAGE_ALIGN(qcow2->file_size);
                ret = qcow2_truncate_safe(file, new_size);
                if (ret) {
-                       QC_ERR(ti, "qcow2: Can't truncate file");
+                       QC_ERR(ti, "Can't truncate file");
                        return ret;
                } /* See md_page_read_complete() */
                qcow2->file_size = new_size;
@@ -918,14 +918,14 @@ static int qcow2_parse_header(struct dm_target *ti, 
struct qcow2 *qcow2,
        ret = -EXDEV;
        if (upper) {
                if (upper->clu_size != qcow2->clu_size) {
-                       QC_ERR(ti, "dm-qcow2: clu_size mismatch\n");
+                       QC_ERR(ti, "clu_size mismatch");
                        goto out;
                }
                if (upper->ext_l2 != qcow2->ext_l2) {
                        if (is_bottom && upper->ext_l2 && !qcow2->ext_l2) {
-                               QC_INFO(ti, "dm-qcow2: using bottom delta 
without ext_l2\n");
+                               QC_INFO(ti, "using bottom delta without 
ext_l2");
                        } else {
-                               QC_ERR(ti, "dm-qcow2: upper delta without 
ext_l2 is unsupported\n");
+                               QC_ERR(ti, "upper delta without ext_l2 is 
unsupported");
                                goto out; /* This is not supported yet */
                        }
                }
@@ -947,11 +947,11 @@ static int qcow2_parse_header(struct dm_target *ti, 
struct qcow2 *qcow2,
                ext_end = PAGE_SIZE;
 
        if (ext_end > PAGE_SIZE) {
-               QC_INFO(ti, "extensions are too long, skipping them\n");
+               QC_INFO(ti, "extensions are too long, skipping them");
        } else {
                ret = qcow2_parse_extensions(ti, qcow2, ext_start, ext_end, 
raw_hdr);
                if (ret) {
-                       QC_ERR(ti, "failed to parse extensions\n");
+                       QC_ERR(ti, "failed to parse extensions");
                        goto out;
                }
        }
@@ -986,7 +986,7 @@ static int qcow2_parse_metadata(struct dm_target *ti, 
struct qcow2_target *tgt)
        ret = 0;
 out:
        if (ret)
-               QC_ERR(ti, "dm-qcow2: Can't parse metadata");
+               QC_ERR(ti, "Can't parse metadata");
        return ret;
 }
 
@@ -1067,7 +1067,7 @@ static void qcow2_truncate_preallocations(struct 
dm_target *ti)
 
        ret = qcow2_truncate_safe(qcow2->file, end);
        if (ret) {
-               QC_ERR(ti, "dm-qcow2: Can't truncate preallocations");
+               QC_ERR(ti, "Can't truncate preallocations");
                tgt->truncate_error = true;
                return;
        }
@@ -1153,7 +1153,7 @@ static void qcow2_postsuspend(struct dm_target *ti)
        if (dm_table_get_mode(ti->table) & FMODE_WRITE) {
                ret = qcow2_set_image_file_features(qcow2, false);
                if (ret)
-                       QC_ERR(ti, "qcow2: Can't set features");
+                       QC_ERR(ti, "Can't set features");
        }
 }
 static int qcow2_preresume(struct dm_target *ti)
@@ -1162,7 +1162,7 @@ static int qcow2_preresume(struct dm_target *ti)
        int ret = 0;
 
        if (qcow2_wants_check(tgt)) {
-               QC_ERR(ti, "qcow2: image check and target reload are required");
+               QC_ERR(ti, "image check and target reload are required");
                return -EIO;
        }
 
@@ -1183,7 +1183,7 @@ static int qcow2_preresume(struct dm_target *ti)
        if (dm_table_get_mode(ti->table) & FMODE_WRITE) {
                ret = qcow2_set_image_file_features(tgt->top, true);
                if (ret)
-                       QC_ERR(ti, "qcow2: Can't set features");
+                       QC_ERR(ti, "Can't set features");
        }
        if (!ret)
                qcow2_set_wants_suspend(ti, false);
-- 
2.53.0

_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to