From e7ddf4168d2c0283efe4764e89901bdca8838f93 Mon Sep 17 00:00:00 2001 From: Petr Rockai Date: Thu, 28 Jun 2007 17:33:44 +0000 Subject: Make warnings go to stderr. Change log_warn to that effect, log_print continues to send messages to stdout. --- tools/lvconvert.c | 2 +- tools/lvcreate.c | 2 +- tools/lvmcmdline.c | 2 +- tools/lvmdiskscan.c | 2 +- tools/lvresize.c | 14 +++++++------- tools/pvcreate.c | 2 +- tools/pvremove.c | 2 +- tools/pvresize.c | 2 +- tools/pvscan.c | 2 +- tools/vgcfgbackup.c | 2 +- tools/vgcreate.c | 8 ++++---- 11 files changed, 20 insertions(+), 20 deletions(-) (limited to 'tools') diff --git a/tools/lvconvert.c b/tools/lvconvert.c index ccc8b176..aeb01c6e 100644 --- a/tools/lvconvert.c +++ b/tools/lvconvert.c @@ -447,7 +447,7 @@ static int lvconvert_snapshot(struct cmd_context *cmd, } if (!lp->zero || !(lv->status & LVM_WRITE)) - log_print("WARNING: \"%s\" not zeroed", lv->name); + log_warn("WARNING: \"%s\" not zeroed", lv->name); else if (!set_lv(cmd, lv, 0, 0)) { log_error("Aborting. Failed to wipe snapshot " "exception store."); diff --git a/tools/lvcreate.c b/tools/lvcreate.c index ec3af687..4da683fa 100644 --- a/tools/lvcreate.c +++ b/tools/lvcreate.c @@ -693,7 +693,7 @@ static int _lvcreate(struct cmd_context *cmd, struct lvcreate_params *lp) init_mirror_in_sync(lp->nosync); if (lp->nosync) { - log_print("WARNING: New mirror won't be synchronised. " + log_warn("WARNING: New mirror won't be synchronised. " "Don't read what you didn't write!"); status |= MIRROR_NOTSYNCED; } diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c index 6c0ccfd9..039eb519 100644 --- a/tools/lvmcmdline.c +++ b/tools/lvmcmdline.c @@ -733,7 +733,7 @@ static int _get_settings(struct cmd_context *cmd) return EINVALID_CMD_LINE; } init_trust_cache(1); - log_print("WARNING: Cache file of PVs will be trusted. " + log_warn("WARNING: Cache file of PVs will be trusted. " "New devices holding PVs may get ignored."); } else init_trust_cache(0); diff --git a/tools/lvmdiskscan.c b/tools/lvmdiskscan.c index 0d8ab046..a64925e7 100644 --- a/tools/lvmdiskscan.c +++ b/tools/lvmdiskscan.c @@ -106,7 +106,7 @@ int lvmdiskscan(struct cmd_context *cmd, int argc __attribute((unused)), pv_parts_found = 0; if (arg_count(cmd, lvmpartition_ARG)) - log_print("WARNING: only considering LVM devices"); + log_warn("WARNING: only considering LVM devices"); max_len = _get_max_dev_name_len(cmd->filter); diff --git a/tools/lvresize.c b/tools/lvresize.c index c9fee438..46d7a3b9 100644 --- a/tools/lvresize.c +++ b/tools/lvresize.c @@ -155,14 +155,14 @@ static int _lvresize(struct cmd_context *cmd, struct lvresize_params *lp) if (vg->fid->fmt->features & FMT_SEGMENTS) lp->stripes = arg_uint_value(cmd, stripes_ARG, 1); else - log_print("Varied striping not supported. Ignoring."); + log_warn("Varied striping not supported. Ignoring."); } if (arg_count(cmd, mirrors_ARG)) { if (vg->fid->fmt->features & FMT_SEGMENTS) lp->mirrors = arg_uint_value(cmd, mirrors_ARG, 1) + 1; else - log_print("Mirrors not supported. Ignoring."); + log_warn("Mirrors not supported. Ignoring."); if (arg_sign_value(cmd, mirrors_ARG, 0) == SIGN_MINUS) { log_error("Mirrors argument may not be negative"); return 0; @@ -182,7 +182,7 @@ static int _lvresize(struct cmd_context *cmd, struct lvresize_params *lp) } if (!(vg->fid->fmt->features & FMT_SEGMENTS)) - log_print("Varied stripesize not supported. Ignoring."); + log_warn("Varied stripesize not supported. Ignoring."); else if (arg_uint_value(cmd, stripesize_ARG, 0) > vg->extent_size) { log_error("Reducing stripe size %s to maximum, " "physical extent size %s", @@ -447,7 +447,7 @@ static int _lvresize(struct cmd_context *cmd, struct lvresize_params *lp) if (lp->resize == LV_REDUCE) { if (lp->argc) - log_print("Ignoring PVs on command line when reducing"); + log_warn("Ignoring PVs on command line when reducing"); } else if (!(pvh = lp->argc ? create_pv_list(cmd->mem, vg, lp->argc, lp->argv, 1) : &vg->pvs)) { stack; @@ -469,13 +469,13 @@ static int _lvresize(struct cmd_context *cmd, struct lvresize_params *lp) } if (info.exists && !lp->resizefs && (lp->resize == LV_REDUCE)) { - log_print("WARNING: Reducing active%s logical volume " + log_warn("WARNING: Reducing active%s logical volume " "to %s", info.open_count ? " and open" : "", display_size(cmd, (uint64_t) lp->extents * vg->extent_size)); - log_print("THIS MAY DESTROY YOUR DATA " - "(filesystem etc.)"); + log_warn("THIS MAY DESTROY YOUR DATA " + "(filesystem etc.)"); if (!arg_count(cmd, force_ARG)) { if (yes_no_prompt("Do you really want to " diff --git a/tools/pvcreate.c b/tools/pvcreate.c index 34c26308..457bc0a9 100644 --- a/tools/pvcreate.c +++ b/tools/pvcreate.c @@ -110,7 +110,7 @@ static int pvcreate_check(struct cmd_context *cmd, const char *name) return 0; if (pv && !is_orphan(pv) && arg_count(cmd, force_ARG)) { - log_print("WARNING: Forcing physical volume creation on " + log_warn("WARNING: Forcing physical volume creation on " "%s%s%s%s", name, !is_orphan(pv) ? " of volume group \"" : "", !is_orphan(pv) ? pv_vg_name(pv) : "", diff --git a/tools/pvremove.c b/tools/pvremove.c index 8567e006..0e600941 100644 --- a/tools/pvremove.c +++ b/tools/pvremove.c @@ -62,7 +62,7 @@ static int pvremove_check(struct cmd_context *cmd, const char *name) } if (arg_count(cmd, force_ARG)) { - log_print("WARNING: Wiping physical volume label from " + log_warn("WARNING: Wiping physical volume label from " "%s%s%s%s", name, !is_orphan(pv) ? " of volume group \"" : "", !is_orphan(pv) ? pv_vg_name(pv) : "", diff --git a/tools/pvresize.c b/tools/pvresize.c index 3c49082b..ed151698 100644 --- a/tools/pvresize.c +++ b/tools/pvresize.c @@ -111,7 +111,7 @@ static int _pvresize_single(struct cmd_context *cmd, if (params->new_size) { if (params->new_size > size) - log_print("WARNING: %s: Overriding real size. " + log_warn("WARNING: %s: Overriding real size. " "You could lose data.", pv_name); log_verbose("%s: Pretending size is %" PRIu64 " not %" PRIu64 " sectors.", pv_name, params->new_size, pv_size(pv)); diff --git a/tools/pvscan.c b/tools/pvscan.c index 6f3a9092..6d86db26 100644 --- a/tools/pvscan.c +++ b/tools/pvscan.c @@ -120,7 +120,7 @@ int pvscan(struct cmd_context *cmd, int argc __attribute((unused)), } if (arg_count(cmd, exported_ARG) || arg_count(cmd, novolumegroup_ARG)) - log_print("WARNING: only considering physical volumes %s", + log_warn("WARNING: only considering physical volumes %s", arg_count(cmd, exported_ARG) ? "of exported volume group(s)" : "in no volume group"); diff --git a/tools/vgcfgbackup.c b/tools/vgcfgbackup.c index b1af733c..acc6f9e9 100644 --- a/tools/vgcfgbackup.c +++ b/tools/vgcfgbackup.c @@ -61,7 +61,7 @@ static int vg_backup_single(struct cmd_context *cmd, const char *vg_name, } if (!consistent) - log_error("Warning: Volume group \"%s\" inconsistent", vg_name); + log_error("WARNING: Volume group \"%s\" inconsistent", vg_name); if (arg_count(cmd, file_ARG)) { if (!(filename = _expand_filename(arg_value(cmd, file_ARG), diff --git a/tools/vgcreate.c b/tools/vgcreate.c index 5ae6f9c2..7ad22882 100644 --- a/tools/vgcreate.c +++ b/tools/vgcreate.c @@ -95,12 +95,12 @@ int vgcreate(struct cmd_context *cmd, int argc, char **argv) return ECMD_FAILED; if (max_lv != vg->max_lv) - log_error("Warning: Setting maxlogicalvolumes to %d " - "(0 means unlimited)", vg->max_lv); + log_warn("WARNING: Setting maxlogicalvolumes to %d " + "(0 means unlimited)", vg->max_lv); if (max_pv != vg->max_pv) - log_error("Warning: Setting maxphysicalvolumes to %d " - "(0 means unlimited)", vg->max_pv); + log_warn("WARNING: Setting maxphysicalvolumes to %d " + "(0 means unlimited)", vg->max_pv); if (arg_count(cmd, addtag_ARG)) { if (!(tag = arg_str_value(cmd, addtag_ARG, NULL))) { -- cgit