Skip to contentSkip to conversation

Add --config to lvm man page.

PATCH New Dave Wysochanski 2 participants 2 messages Mar 18, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add --config to lvm man page.

NOTE: This option is useful in some cases, but in others it is misleading because it does not really work. For example, you can try disabling writing the devices cache via --config 'devices { write_cache_sate = 0 }'. However, this does not work since at the bottom of lvm_run_command(), we destroy the 'cft_override' config tree, and call refresh_toolcontext() again, resetting the cmd->dump_filter variable which is what we wanted to override. The writing of the devices cache takes place inside destroy_toolcontext(), which is called after lvm_run_command() completes. At this point, the overridden value has been reset to whatever was in the lvm.conf file (see _init_filters() code).

Despite some limitations, I felt it was useful to document the option since we have been verbally telling people they could use this as a workaround for other issues.

---
 WHATS_NEW    |    1 +
 man/lvm.8.in |    9 +++++++++
 2 files changed, 10 insertions(+), 0 deletions(-)
WHATS_NEW +1 -0
index 20a87a2..f44ecb5 100644
@@ -1,5 +1,6 @@
 Version 2.02.46 - 
 ================================
+  Add --config to lvm man page.
   Detect and conditionally wipe swapspace signatures in pvcreate.
   Fix maximal volume count check for snapshots if max_lv set for volume group.
   Fix lvcreate to remove cow volume if the snapshot creation fails.
man/lvm.8.in +9 -0
index 6bad5fc..eee9bcf 100644
@@ -153,6 +153,15 @@ than repeated on individual manual pages.
 Repeat from 1 to 3 times to increase the detail of messages 
 sent to stdout and stderr.  Overrides config file setting.
 .TP
+\fB--config\fP \(em Override configuration setting.
+Allows override of \fBlvm.conf\fP (5) config file settings
+for a single command.
+WARNING: Only use this if you know what you are doing!
+Useful in various situations such as using the devices filter
+to limit an lvm command to specific devices.  Example:
+.br
+lvm pvs --config \(aqdevices { filter = ["a/loop[01]/", "r/.*/"] }\(aq
+.TP
 \fB-d | --debug\fP \(em Set debug level.
 Repeat from 1 to 6 times to increase the detail of messages sent 
 to the log file and/or syslog (if configured).
Signature · 1 line
1.6.0.6
#1 lore raw

PATCH 1/1 Add --config to lvm man page.

Documenting --config, yes, but only in full - not a partial explanation that could mislead people. Give people generic information so they can determine for themselves whether it is sensible to override any particular value and any precautions they should take as well as alternative approaches (like changing system_dir) that avoid the need. Then give examples of safe and dangerous overrides.

Alasdair

Signature · 1 line
agk at redhat.com