summaryrefslogtreecommitdiffstats
path: root/lib/metadata/lv_manip.c
diff options
context:
space:
mode:
authorAlasdair G Kergon <agk@redhat.com>2012-08-25 20:35:48 +0100
committerAlasdair G Kergon <agk@redhat.com>2012-08-25 20:35:48 +0100
commit438e0050dfed1f8f2d74670a5f7c5e8c8819c777 (patch)
tree72488758b931b28d8a7f4294c9059a6fdd9db379 /lib/metadata/lv_manip.c
parent4047e4dfb16175daec348bf44032c02181bd4c70 (diff)
downloadlvm2-438e0050dfed1f8f2d74670a5f7c5e8c8819c777.tar.gz
lvm2-438e0050dfed1f8f2d74670a5f7c5e8c8819c777.tar.xz
lvm2-438e0050dfed1f8f2d74670a5f7c5e8c8819c777.zip
config: add silent mode
Accept -q as the short form of --quiet. Suppress non-essential standard output if -q is given twice. Treat log/silent in lvm.conf as equivalent to -qq. Review all log_print messages and change some to log_print_unless_silent. When silent, the following commands still produce output: dumpconfig, lvdisplay, lvmdiskscan, lvs, pvck, pvdisplay, pvs, version, vgcfgrestore -l, vgdisplay, vgs. [Needs checking.] Non-essential messages are shifted from log level 4 to log level 5 for syslog and lvm2_log_fn purposes.
Diffstat (limited to 'lib/metadata/lv_manip.c')
-rw-r--r--lib/metadata/lv_manip.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 59e14291..d591b7b5 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -2152,8 +2152,8 @@ int lv_add_virtual_segment(struct logical_volume *lv, uint64_t status,
size = ((uint64_t)lv->vg->extent_size * extents + size - 1) /
size * size / lv->vg->extent_size;
if (size != extents) {
- log_print("Rounding size (%d extents) up to chunk boundary "
- "size (%d extents).", extents, size);
+ log_print_unless_silent("Rounding size (%d extents) up to chunk boundary "
+ "size (%d extents).", extents, size);
extents = size;
}
}
@@ -2738,7 +2738,7 @@ int lv_extend(struct logical_volume *lv,
percent_t sync_percent = PERCENT_INVALID;
if (!lv_is_active(lv)) {
- log_print("%s/%s is not active."
+ log_error("%s/%s is not active."
" Unable to get sync percent.",
lv->vg->name, lv->name);
if (yes_no_prompt("Do full resync of extended "
@@ -3378,7 +3378,7 @@ int lv_remove_single(struct cmd_context *cmd, struct logical_volume *lv,
backup(vg);
if (visible)
- log_print("Logical volume \"%s\" successfully removed", lv->name);
+ log_print_unless_silent("Logical volume \"%s\" successfully removed", lv->name);
return 1;
}
@@ -4207,8 +4207,8 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg, struct l
}
if ((size_rest = lp->extents % lp->stripes)) {
- log_print("Rounding size (%d extents) up to stripe boundary "
- "size (%d extents)", lp->extents,
+ log_print_unless_silent("Rounding size (%d extents) up to stripe boundary "
+ "size (%d extents)", lp->extents,
lp->extents - size_rest + lp->stripes);
lp->extents = lp->extents - size_rest + lp->stripes;
}
@@ -4650,7 +4650,7 @@ int lv_create_single(struct volume_group *vg,
return_0;
out:
- log_print("Logical volume \"%s\" created", lv->name);
+ log_print_unless_silent("Logical volume \"%s\" created", lv->name);
return 1;
}