Skip to contentSkip to conversation

tool: Allow suppressing backup warnings

PATCH New Nir Soffer 2 participants 3 messages May 29, 2019 – Aug 15, 2019

lore
Share & tools
lore

Nir Soffer

author
#0 lore raw

PATCH 1/1 tool: Allow suppressing backup warnings

We have a mechanism to show only single warning about disabled backup:

WARNING: This metadata update is NOT backed up

In oVirt we disable local backup since it does not play well with oVirt clustered LVM solution, and this warning is not helpful. We can filter the message in oVirt logs, but I think the right place to fix this is in LVM.

Add LVM_SUPPRESS_BACKUP_WARNINGS environment variable. If set, suppress also the first warning about disable backup.

---
 lib/format_text/archiver.c | 3 +++
 man/lvm.8_main             | 4 ++++
 2 files changed, 7 insertions(+)
lib/format_text/archiver.c +3 -0
index 052c2bd2b..0ea8d5e48 100644
@@ -196,10 +196,13 @@ int backup_init(struct cmd_context *cmd, const char *dir,
 		log_error("Couldn't copy backup directory name.");
 		return 0;
 	}
 	backup_enable(cmd, enabled);
 
+    if (getenv("LVM_SUPPRESS_BACKUP_WARNINGS"))
+        cmd->backup_params->suppress = 1;
+
 	return 1;
 }
 
 void backup_exit(struct cmd_context *cmd)
 {
man/lvm.8_main +4 -0
index 3e67b1bdf..43ce5150c 100644
@@ -470,10 +470,14 @@ together allow automated test scripts to discard uninteresting log data.
 .TP
 .B LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES
 Used to suppress warning messages when the configured locking is known
 to be unavailable.
 .TP
+.B LVM_SUPPRESS_BACKUP_WARNINGS
+Used to suppress warning messages when automatic metadata backup is
+disabled.
+.TP
 .B DM_ABORT_ON_INTERNAL_ERRORS
 Abort processing if the code detects a non-fatal internal error.
 .TP
 .B DM_DISABLE_UDEV
 Avoid interaction with udev.  LVM will manage the relevant nodes in /dev
Signature · 1 line
2.17.2
#1 lore raw

PATCH 1/1 tool: Allow suppressing backup warnings

ping

Quoted 56 lines · Nir Soffer

We have a mechanism to show only single warning about disabled backup:

WARNING: This metadata update is NOT backed up

In oVirt we disable local backup since it does not play well with oVirt clustered LVM solution, and this warning is not helpful. We can filter the message in oVirt logs, but I think the right place to fix this is in LVM.

Add LVM_SUPPRESS_BACKUP_WARNINGS environment variable. If set, suppress also the first warning about disable backup.

---
 lib/format_text/archiver.c | 3 +++
 man/lvm.8_main             | 4 ++++
 2 files changed, 7 insertions(+)
lib/format_text/archiver.c +3 -0
index 052c2bd2b..0ea8d5e48 100644
@@ -196,10 +196,13 @@ int backup_init(struct cmd_context *cmd, const char
 *dir,
                log_error("Couldn't copy backup directory name.");
                return 0;
        }
        backup_enable(cmd, enabled);
 
+    if (getenv("LVM_SUPPRESS_BACKUP_WARNINGS"))
+        cmd->backup_params->suppress = 1;
+
        return 1;
 }
 
 void backup_exit(struct cmd_context *cmd)

{

man/lvm.8_main +0 -0
index 3e67b1bdf..43ce5150c 100644
@@ -470,10 +470,14 @@ together allow automated test scripts to discard

uninteresting log data.
.TP
.B LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES
Used to suppress warning messages when the configured locking is known to be unavailable.
.TP
+.B LVM_SUPPRESS_BACKUP_WARNINGS

man/lvm.8_main +3 -1
+Used to suppress warning messages when automatic metadata backup is
+disabled.
+.TP
 .B DM_ABORT_ON_INTERNAL_ERRORS
 Abort processing if the code detects a non-fatal internal error.
 .TP
 .B DM_DISABLE_UDEV
 Avoid interaction with udev.  LVM will manage the relevant nodes in /dev
--
Quoted 3 lines

2.17.2

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20190610/9e01260e/attachment.htm>

#2 lore raw

PATCH 1/1 tool: Allow suppressing backup warnings

ping 2

Quoted 55 lines · Nir Soffer

ping

Quoted 51 lines · Nir Soffer

We have a mechanism to show only single warning about disabled backup:

WARNING: This metadata update is NOT backed up

In oVirt we disable local backup since it does not play well with oVirt clustered LVM solution, and this warning is not helpful. We can filter the message in oVirt logs, but I think the right place to fix this is in LVM.

Add LVM_SUPPRESS_BACKUP_WARNINGS environment variable. If set, suppress also the first warning about disable backup.

---
 lib/format_text/archiver.c | 3 +++
 man/lvm.8_main             | 4 ++++
 2 files changed, 7 insertions(+)
lib/format_text/archiver.c +3 -0
index 052c2bd2b..0ea8d5e48 100644
@@ -196,10 +196,13 @@ int backup_init(struct cmd_context *cmd, const char
 *dir,
                log_error("Couldn't copy backup directory name.");
                return 0;
        }
        backup_enable(cmd, enabled);
 
+    if (getenv("LVM_SUPPRESS_BACKUP_WARNINGS"))
+        cmd->backup_params->suppress = 1;
+
        return 1;
 }
 
 void backup_exit(struct cmd_context *cmd)

{

man/lvm.8_main +0 -0
index 3e67b1bdf..43ce5150c 100644
@@ -470,10 +470,14 @@ together allow automated test scripts to discard

uninteresting log data.
.TP
.B LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES
Used to suppress warning messages when the configured locking is known to be unavailable.
.TP
+.B LVM_SUPPRESS_BACKUP_WARNINGS

man/lvm.8_main +3 -0
+Used to suppress warning messages when automatic metadata backup is
+disabled.
+.TP
 .B DM_ABORT_ON_INTERNAL_ERRORS
Quoted 8 lines
Quoted 8 lines

Abort processing if the code detects a non-fatal internal error. .TP
.B DM_DISABLE_UDEV
Avoid interaction with udev. LVM will manage the relevant nodes in /dev
--
2.17.2

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20190816/07bd81ec/attachment.htm>