From 81ef1fd0cc000510e5c1d24025364a772c3a60d3 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Sat, 15 Jul 2023 10:57:37 +0200 Subject: [PATCH] debug: print WARNING: Add WARNING: in front of log_warn() messages. --- lib/log/log.c | 2 +- tools/lvchange.c | 2 +- tools/lvmcmdline.c | 4 ++-- tools/lvscan.c | 2 +- tools/toollib.c | 36 ++++++++++++++++++------------------ tools/vgchange.c | 10 +++++----- tools/vgscan.c | 2 +- 7 files changed, 29 insertions(+), 29 deletions(-) diff --git a/lib/log/log.c b/lib/log/log.c index a7cbaa16b..6dc269675 100644 --- a/lib/log/log.c +++ b/lib/log/log.c @@ -920,6 +920,6 @@ uint32_t log_journal_str_to_val(const char *str) return LOG_JOURNAL_OUTPUT; if (!strcasecmp(str, "debug")) return LOG_JOURNAL_DEBUG; - log_warn("Ignoring unrecognized journal value."); + log_warn("WARNING: Ignoring unrecognized journal value."); return 0; } diff --git a/tools/lvchange.c b/tools/lvchange.c index bd120bf0a..c136be0c5 100644 --- a/tools/lvchange.c +++ b/tools/lvchange.c @@ -360,7 +360,7 @@ static int _lvchange_resync(struct cmd_context *cmd, struct logical_volume *lv) init_dmeventd_monitor(monitored); init_mirror_in_sync(0); if (!sync_local_dev_names(cmd)) - log_warn("Failed to sync local dev names."); + log_warn("WARNING: Failed to sync local dev names."); log_very_verbose("Starting resync of %s%s%s%s %s.", (active) ? "active " : "", diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c index edf802335..57f9f2651 100644 --- a/tools/lvmcmdline.c +++ b/tools/lvmcmdline.c @@ -2620,7 +2620,7 @@ static int _get_current_settings(struct cmd_context *cmd) if (!strcmp(search_mode, "none") || !strcmp(search_mode, "auto") || !strcmp(search_mode, "all")) cmd->search_for_devnames = search_mode; else { - log_warn("Ignoring unknown search_for_devnames setting, using %s.", DEFAULT_SEARCH_FOR_DEVNAMES); + log_warn("WARNING: Ignoring unknown search_for_devnames setting, using %s.", DEFAULT_SEARCH_FOR_DEVNAMES); cmd->search_for_devnames = DEFAULT_SEARCH_FOR_DEVNAMES; } } @@ -3063,7 +3063,7 @@ static void _init_md_checks(struct cmd_context *cmd) !strcmp(md_check, "full")) cmd->md_component_checks = md_check; else { - log_warn("Ignoring unknown md_component_checks setting, using auto."); + log_warn("WARNING: Ignoring unknown md_component_checks setting, using auto."); cmd->md_component_checks = "auto"; } diff --git a/tools/lvscan.c b/tools/lvscan.c index cba4d616e..aba28a86f 100644 --- a/tools/lvscan.c +++ b/tools/lvscan.c @@ -59,7 +59,7 @@ static int _lvscan_single(struct cmd_context *cmd, struct logical_volume *lv, int lvscan(struct cmd_context *cmd, int argc, char **argv) { if (arg_is_set(cmd, cache_long_ARG)) { - log_warn("Ignoring lvscan --cache because lvmetad is no longer used."); + log_warn("WARNING: Ignoring lvscan --cache because lvmetad is no longer used."); return ECMD_PROCESSED; } diff --git a/tools/toollib.c b/tools/toollib.c index 6106bc756..afb056fbb 100644 --- a/tools/toollib.c +++ b/tools/toollib.c @@ -211,7 +211,7 @@ static int _ignore_vg(struct cmd_context *cmd, } return 1; } else { - log_warn("Skipping clustered VG %s.", vg_name); + log_warn("WARNING: Skipping clustered VG %s.", vg_name); if (!_printed_clustered_vg_advice) { _printed_clustered_vg_advice = 1; log_error("See lvmlockd(8) for changing a clvm/clustered VG to a shared VG."); @@ -565,7 +565,7 @@ int vgcreate_params_set_from_args(struct cmd_context *cmd, if (vp_new->system_id && cmd->system_id && strcmp(vp_new->system_id, cmd->system_id)) { if (*vp_new->system_id) - log_warn("VG with system ID %s might become inaccessible as local system ID is %s", + log_warn("WARNING: VG with system ID %s might become inaccessible as local system ID is %s", vp_new->system_id, cmd->system_id); else log_warn("WARNING: A VG without a system ID allows unsafe access from other hosts."); @@ -584,7 +584,7 @@ int vgcreate_params_set_from_args(struct cmd_context *cmd, if (vp_new->system_id && cmd->system_id && strcmp(vp_new->system_id, cmd->system_id)) { - log_warn("VG with system ID %s might become inaccessible as local system ID is %s", + log_warn("WARNING: VG with system ID %s might become inaccessible as local system ID is %s", vp_new->system_id, cmd->system_id); } } @@ -904,7 +904,7 @@ void lv_spawn_background_polling(struct cmd_context *cmd, /* Ensure there is nothing waiting on cookie */ if (!sync_local_dev_names(cmd)) - log_warn("Failed to sync local dev names."); + log_warn("WARNING: Failed to sync local dev names."); if (lv_is_pvmove(lv)) lv_mirr = lv; @@ -1498,13 +1498,13 @@ static int _get_one_writecache_setting(struct cmd_context *cmd, struct writecach return 0; } - log_warn("Unrecognized writecache setting \"%s\" may cause activation failure.", key); + log_warn("WARNING: Unrecognized writecache setting \"%s\" may cause activation failure.", key); if (yes_no_prompt("Use unrecognized writecache setting? [y/n]: ") == 'n') { log_error("Aborting writecache conversion."); return 0; } - log_warn("Using unrecognized writecache setting: %s = %s.", key, val); + log_warn("WARNING: Using unrecognized writecache setting: %s = %s.", key, val); settings->new_key = dm_pool_strdup(cmd->mem, key); settings->new_val = dm_pool_strdup(cmd->mem, val); @@ -3001,10 +3001,10 @@ static int _check_lv_types(struct cmd_context *cmd, struct logical_volume *lv, i int lvt_enum = get_lvt_enum(lv); struct lv_type *type = get_lv_type(lvt_enum); if (!type) { - log_warn("Command on LV %s does not accept LV type unknown (%d).", + log_warn("WARNING: Command on LV %s does not accept LV type unknown (%d).", display_lvname(lv), lvt_enum); } else { - log_warn("Command on LV %s does not accept LV type %s.", + log_warn("WARNING: Command on LV %s does not accept LV type %s.", display_lvname(lv), type->name); } } @@ -3115,7 +3115,7 @@ static int _check_lv_rules(struct cmd_context *cmd, struct logical_volume *lv) if (rule->check_opts && (rule->rule == RULE_INVALID) && opts_match_count) { memset(buf, 0, sizeof(buf)); opt_array_to_str(cmd, rule->check_opts, rule->check_opts_count, buf, sizeof(buf)); - log_warn("Command on LV %s has invalid use of option %s.", + log_warn("WARNING: Command on LV %s has invalid use of option %s.", display_lvname(lv), buf); ret = 0; } @@ -3125,7 +3125,7 @@ static int _check_lv_rules(struct cmd_context *cmd, struct logical_volume *lv) if (rule->check_opts && (rule->rule == RULE_REQUIRE) && opts_unmatch_count) { memset(buf, 0, sizeof(buf)); opt_array_to_str(cmd, rule->check_opts, rule->check_opts_count, buf, sizeof(buf)); - log_warn("Command on LV %s requires option %s.", + log_warn("WARNING: Command on LV %s requires option %s.", display_lvname(lv), buf); ret = 0; } @@ -3134,10 +3134,10 @@ static int _check_lv_rules(struct cmd_context *cmd, struct logical_volume *lv) if (rule->check_lvt_bits && (rule->rule == RULE_INVALID) && lv_types_match_bits) { if (rule->opts_count) - log_warn("Command on LV %s uses options invalid with LV type %s.", + log_warn("WARNING: Command on LV %s uses options invalid with LV type %s.", display_lvname(lv), lvtype ? lvtype->name : "unknown"); else - log_warn("Command on LV %s with invalid LV type %s.", + log_warn("WARNING: Command on LV %s with invalid LV type %s.", display_lvname(lv), lvtype ? lvtype->name : "unknown"); ret = 0; } @@ -3148,10 +3148,10 @@ static int _check_lv_rules(struct cmd_context *cmd, struct logical_volume *lv) memset(buf, 0, sizeof(buf)); _lvt_bits_to_str(rule->check_lvt_bits, buf, sizeof(buf)); if (rule->opts_count) - log_warn("Command on LV %s uses options that require LV types %s.", + log_warn("WARNING: Command on LV %s uses options that require LV types %s.", display_lvname(lv), buf); else - log_warn("Command on LV %s does not accept LV type %s. Required LV types are %s.", + log_warn("WARNING: Command on LV %s does not accept LV type %s. Required LV types are %s.", display_lvname(lv), lvtype ? lvtype->name : "unknown", buf); ret = 0; } @@ -3162,10 +3162,10 @@ static int _check_lv_rules(struct cmd_context *cmd, struct logical_volume *lv) memset(buf, 0, sizeof(buf)); _lvp_bits_to_str(lv_props_match_bits, buf, sizeof(buf)); if (rule->opts_count) - log_warn("Command on LV %s uses options that are invalid with LV properties: %s.", + log_warn("WARNING: Command on LV %s uses options that are invalid with LV properties: %s.", display_lvname(lv), buf); else - log_warn("Command on LV %s is invalid on LV with properties: %s.", + log_warn("WARNING: Command on LV %s is invalid on LV with properties: %s.", display_lvname(lv), buf); ret = 0; } @@ -3176,10 +3176,10 @@ static int _check_lv_rules(struct cmd_context *cmd, struct logical_volume *lv) memset(buf, 0, sizeof(buf)); _lvp_bits_to_str(lv_props_unmatch_bits, buf, sizeof(buf)); if (rule->opts_count) - log_warn("Command on LV %s uses options that require LV properties: %s.", + log_warn("WARNING: Command on LV %s uses options that require LV properties: %s.", display_lvname(lv), buf); else - log_warn("Command on LV %s requires LV with properties: %s.", + log_warn("WARNING: Command on LV %s requires LV with properties: %s.", display_lvname(lv), buf); ret = 0; } diff --git a/tools/vgchange.c b/tools/vgchange.c index 740e0d23f..e2d3dad02 100644 --- a/tools/vgchange.c +++ b/tools/vgchange.c @@ -386,7 +386,7 @@ static int _vgchange_pesize(struct cmd_context *cmd, struct volume_group *vg) uint32_t extent_size; if (arg_uint64_value(cmd, physicalextentsize_ARG, 0) > MAX_EXTENT_SIZE) { - log_warn("Physical extent size cannot be larger than %s.", + log_warn("WARNING: Physical extent size cannot be larger than %s.", display_size(cmd, (uint64_t) MAX_EXTENT_SIZE)); return 1; } @@ -394,7 +394,7 @@ static int _vgchange_pesize(struct cmd_context *cmd, struct volume_group *vg) extent_size = arg_uint_value(cmd, physicalextentsize_ARG, 0); /* FIXME: remove check - redundant with vg_change_pesize */ if (extent_size == vg->extent_size) { - log_warn("Physical extent size of VG %s is already %s.", + log_warn("WARNING: Physical extent size of VG %s is already %s.", vg->name, display_size(cmd, (uint64_t) extent_size)); return 1; } @@ -463,10 +463,10 @@ static int _vgchange_metadata_copies(struct cmd_context *cmd, if (mda_copies == vg_mda_copies(vg)) { if (vg_mda_copies(vg) == VGMETADATACOPIES_UNMANAGED) - log_warn("Number of metadata copies for VG %s is already unmanaged.", + log_warn("WARNING: Number of metadata copies for VG %s is already unmanaged.", vg->name); else - log_warn("Number of metadata copies for VG %s is already %u.", + log_warn("WARNING: Number of metadata copies for VG %s is already %u.", vg->name, mda_copies); return 1; } @@ -1052,7 +1052,7 @@ static int _vgchange_locktype(struct cmd_context *cmd, struct volume_group *vg) } if (lock_type && !strcmp(vg->lock_type, lock_type)) { - log_warn("New lock type %s matches the current lock type %s.", + log_warn("WARNING: New lock type %s matches the current lock type %s.", lock_type, vg->lock_type); return 1; } diff --git a/tools/vgscan.c b/tools/vgscan.c index 3388c8aaf..5add8e46c 100644 --- a/tools/vgscan.c +++ b/tools/vgscan.c @@ -48,7 +48,7 @@ int vgscan(struct cmd_context *cmd, int argc, char **argv) } if (arg_is_set(cmd, cache_long_ARG)) { - log_warn("Ignoring vgscan --cache command because lvmetad is no longer used."); + log_warn("WARNING: Ignoring vgscan --cache command because lvmetad is no longer used."); return ECMD_PROCESSED; }