summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2016-12-18 16:36:33 +0100
committerZdenek Kabelac <zkabelac@redhat.com>2016-12-18 19:38:30 +0100
commit75f23880934a8c1cb192e9a898261320db15043a (patch)
treed64d0755f44fbf0ffd59b0b32bae14cf5f853e25
parent5bb6266046b11e6e4b47596689e3f4a75ba692a3 (diff)
downloadlvm2-75f23880934a8c1cb192e9a898261320db15043a.tar.gz
backup: show warning once per command
When command calls backup() more then once (which is actually not wanted) this warning message is shown repeatedly: "WARNING: This metadata update is NOT backed up." Instead now print message just once and less confuse user.
-rw-r--r--WHATS_NEW1
-rw-r--r--lib/format_text/archiver.c4
2 files changed, 4 insertions, 1 deletions
diff --git a/WHATS_NEW b/WHATS_NEW
index e7abf591f..fbaa36944 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.169 -
=====================================
+ Warn about command not making metadata backup just once per command.
Enable usage of cached volume as thin volume's external origin.
Support cache volume activation with -real layer.
Improve search of lock-holder for external origin and thin-pool.
diff --git a/lib/format_text/archiver.c b/lib/format_text/archiver.c
index 92799e42a..d3811556d 100644
--- a/lib/format_text/archiver.c
+++ b/lib/format_text/archiver.c
@@ -35,6 +35,7 @@ struct archive_params {
struct backup_params {
int enabled;
char *dir;
+ int suppress;
};
int archive_init(struct cmd_context *cmd, const char *dir,
@@ -235,7 +236,8 @@ static int _backup(struct volume_group *vg)
int backup_locally(struct volume_group *vg)
{
if (!vg->cmd->backup_params->enabled || !vg->cmd->backup_params->dir) {
- log_warn("WARNING: This metadata update is NOT backed up");
+ log_warn_suppress(vg->cmd->backup_params->suppress++,
+ "WARNING: This metadata update is NOT backed up.");
return 1;
}