master - spec: Pull in lvmconfig and associated manpages.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=13fea879606c4d...
Commit: 13fea879606c4dfdeb8d7686ca2ab606a70a5cd4
Parent: d6b624686478c0f162ac4f7f4af7d35d5539d151
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Wed Apr 29 17:58:19 2015 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Thu Apr 30 06:35:05 2015 +0200
spec: Pull in lvmconfig and associated manpages.
---
spec/packages.inc | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/spec/packages.inc b/spec/packages.inc
index 6d6f92e..109abd2 100644
--- a/spec/packages.inc
+++ b/spec/packages.inc
@@ -77,6 +77,7 @@ fi
%{_sbindir}/vgs
%{_sbindir}/vgscan
%{_sbindir}/vgsplit
+%{_sbindir}/lvmconfig
%{_sbindir}/lvmconf
%{_sbindir}/blkdeactivate
%if %{have_service lvmetad}
@@ -139,6 +140,8 @@ fi
%{_mandir}/man8/vgsplit.8.gz
%{_mandir}/man8/blkdeactivate.8.gz
%{_mandir}/man8/lvm-dumpconfig.8.gz
+%{_mandir}/man8/lvm-config.8.gz
+%{_mandir}/man8/lvmconfig.8.gz
%if %{enable_udev}
%{_udevdir}/11-dm-lvm.rules
%if %{have_service lvmetad}
8 years, 12 months
master - man: Fix references to lvmcache(7) that mentioned section 8 by mistake.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d6b624686478c0...
Commit: d6b624686478c0f162ac4f7f4af7d35d5539d151
Parent: 299a3be0d3d02e96794bb2c36217955c2b03f049
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Wed Apr 22 19:38:40 2015 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Thu Apr 30 06:35:05 2015 +0200
man: Fix references to lvmcache(7) that mentioned section 8 by mistake.
---
man/lvconvert.8.in | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/man/lvconvert.8.in b/man/lvconvert.8.in
index 7dd1051..576859b 100644
--- a/man/lvconvert.8.in
+++ b/man/lvconvert.8.in
@@ -220,11 +220,11 @@ Run the daemon in the background.
.BR \-H ", " \-\-cache ", " \-\-type\ \fIcache
Converts logical volume to a cached LV with the use of cache pool
specified with \fB\-\-cachepool\fP.
-For more information on cache pool LVs and cache LVs, see \fBlvmcache\fP(8).
+For more information on cache pool LVs and cache LVs, see \fBlvmcache\fP(7).
.TP
.BR \-\-cachepool " " \fICachePoolLV
This argument is necessary when converting a logical volume to a cache LV.
-For more information on cache pool LVs and cache LVs, see \fBlvmcache\fP(8).
+For more information on cache pool LVs and cache LVs, see \fBlvmcache\fP(7).
.TP
.BR \-m ", " \-\-mirrors " " \fIMirrors
Specifies the degree of the mirror you wish to create.
8 years, 12 months
master - man: lvmthin section about use-policies
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=299a3be0d3d02e...
Commit: 299a3be0d3d02e96794bb2c36217955c2b03f049
Parent: bf73ccb8483219c72cb7e80daf2e40f0a14db4e1
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Apr 29 10:00:38 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Apr 29 16:27:40 2015 -0500
man: lvmthin section about use-policies
---
man/lvmthin.7.in | 118 +++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 116 insertions(+), 2 deletions(-)
diff --git a/man/lvmthin.7.in b/man/lvmthin.7.in
index dab2d7e..79ca40a 100644
--- a/man/lvmthin.7.in
+++ b/man/lvmthin.7.in
@@ -254,6 +254,8 @@ or vgchange to activate thin snapshots with the "k" attribute.
.br
.B Metadata space exhaustion
.br
+.B Automatic extend settings
+.br
.B Zeroing
.br
.B Discard
@@ -834,7 +836,8 @@ extended. (Disabling dmeventd is not recommended.)
.IP \[bu]
Automatic extension of the thin pool is too slow given the rate of writes
to thin LVs in the pool. (This can be addressed by tuning the
-thin_pool_autoextend_threshold and thin_pool_autoextend_percent.)
+thin_pool_autoextend_threshold and thin_pool_autoextend_percent.
+See "Automatic extend settings".)
.IP \[bu]
The VG does not have enough free blocks to extend the thin pool.
@@ -877,6 +880,117 @@ repair.
4. Check and repair file system with fsck.
+.SS Automatic extend settings
+
+\&
+
+Thin pool LVs can be extended according to preset values. The presets
+determine if the LV should be extended based on how full it is, and if so
+by how much. When dmeventd monitors thin pool LVs, it uses lvextend with
+these presets. (See "Automatically extend thin pool LV".)
+
+Command to extend a thin pool data LV using presets:
+.br
+.B lvextend \-\-use\-policies VG/ThinPoolLV
+
+The command uses these settings:
+
+.BR lvm.conf (5)
+.B thin_pool_autoextend_threshold
+.br
+autoextend the LV when its usage exceeds this percent.
+
+.BR lvm.conf (5)
+.B thin_pool_autoextend_percent
+.br
+autoextend the LV by this much additional space.
+
+To see the default values of these settings, run:
+
+.B lvmconfig --type default --withcomment
+.RS
+.B activation/thin_pool_autoextend_threshold
+.RE
+
+.B lvmconfig --type default --withcomment
+.RS
+.B activation/thin_pool_autoextend_percent
+.RE
+
+To change these values globally, edit
+.BR lvm.conf (5).
+
+To change these values on a per-VG or per-LV basis, attach a "profile" to
+the VG or LV. A profile is a collection of config settings, saved in a
+local text file (using the lvm.conf format). lvm looks for profiles in
+the profile_dir directory, e.g. /etc/lvm/profile/. Once attached to a VG
+or LV, lvm will process the VG or LV using the settings from the attached
+profile. A profile is named and referenced by its file name.
+
+To use a profile to customize the lvextend settings for an LV:
+
+.IP \[bu] 2
+Create a file containing settings, saved in profile_dir.
+For the profile_dir location, run:
+.br
+.B lvmconfig config/profile_dir
+
+.IP \[bu] 2
+Attach the profile to an LV, using the command:
+.br
+.B lvchange \-\-metadataprofile ProfileName VG/ThinPoolLV
+
+.IP \[bu] 2
+Extend the LV using the profile settings:
+.br
+.B lvextend \-\-use\-policies VG/ThinPoolLV
+
+.P
+
+.I Example
+.br
+.nf
+# lvmconfig config/profile_dir
+profile_dir="/etc/lvm/profile"
+
+# cat /etc/lvm/profile/pool0extend.profile
+activation {
+ thin_pool_autoextend_threshold=50
+ thin_pool_autoextend_percent=10
+}
+
+# lvchange --metadataprofile pool0extend vg/pool0
+
+# lvextend --use-policies vg/pool0
+.fi
+
+.I Notes
+.IP \[bu] 2
+A profile is attached to a VG or LV by name, where the name references a
+local file in profile_dir. If the VG is moved to another machine, the
+file with the profile also needs to be moved.
+
+.IP \[bu] 2
+Only certain settings can be used in a VG or LV profile, see:
+.br
+.B lvmconfig --type profilable-metadata.
+
+.IP \[bu] 2
+An LV without a profile of its own will inherit the VG profile.
+
+.IP \[bu] 2
+Remove a profile from an LV using the command:
+.br
+.B lvchange --detachprofile VG/ThinPoolLV.
+
+.IP \[bu] 2
+Commands can also have profiles applied to them. The settings that can be
+applied to a command are different than the settings that can be applied
+to a VG or LV. See lvmconfig --type profilable-command. To apply a
+profile to a command, write a profile, save it in the profile directory,
+and run the command using the option: --commandprofile ProfileName.
+
+
.SS Zeroing
\&
@@ -1242,10 +1356,10 @@ skipped while mounting readonly:
mount /dev/VG/SnapLV /mnt \-o ro,nouuid,norecovery
-
.SH SEE ALSO
.BR lvm (8),
.BR lvm.conf (5),
+.BR lvmconfig (8),
.BR lvcreate (8),
.BR lvconvert (8),
.BR lvchange (8),
8 years, 12 months
master - man: 'lvmconfig' is preferred over 'lvm config'
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=bf73ccb8483219...
Commit: bf73ccb8483219c72cb7e80daf2e40f0a14db4e1
Parent: 08a82aa940ad3c2841c52544543a08919c0ed110
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Apr 29 10:13:13 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Apr 29 10:14:23 2015 -0500
man: 'lvmconfig' is preferred over 'lvm config'
---
man/lvm.8.in | 2 +-
man/lvm.conf.5.in | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/man/lvm.8.in b/man/lvm.8.in
index 7ed35c8..298d05b 100644
--- a/man/lvm.8.in
+++ b/man/lvm.8.in
@@ -321,7 +321,7 @@ way it fits with other LVM configuration methods.
A short form of \fB\-\-metadataprofile\fP for \fBvgcreate\fP, \fBlvcreate\fP,
\fBvgchange\fP and \fBlvchange\fP command and a short form of \fB\-\-commandprofile\fP
for any other command (with the exception of \fBlvmconfig\fP command where the
-\-\-profile has special meaning, see \fBlvm config\fP(8) for more information).
+\-\-profile has special meaning, see \fBlvmconfig\fP(8) for more information).
.TP
.IR \fB\-\-config " " \fIConfigurationString
Uses the ConfigurationString as direct string representation of the configuration
diff --git a/man/lvm.conf.5.in b/man/lvm.conf.5.in
index 88694a1..6ff8674 100644
--- a/man/lvm.conf.5.in
+++ b/man/lvm.conf.5.in
@@ -65,8 +65,8 @@ For this purpose, there's the \fBcommand_profile_template.profile\fP
(for metadata profiles) which contain all settings that are customizable
by profiles of certain type. Users are encouraged to copy these template
profiles and edit them as needed. Alternatively, the
-\fBlvm config \-\-file <ProfileName.profile> \-\-type profilable-command <section>\fP
-or \fBlvm config \-\-file <ProfileName.profile> \-\-type profilable-metadata <section>\fP
+\fBlvmconfig \-\-file <ProfileName.profile> \-\-type profilable-command <section>\fP
+or \fBlvmconfig \-\-file <ProfileName.profile> \-\-type profilable-metadata <section>\fP
can be used to generate a configuration with profilable settings in either
of the type for given section and save it to new ProfileName.profile
(if the section is not specified, all profilable settings are reported).
8 years, 12 months
master - WHATS_NEW: commit e0a62b8fdc8d041c14ca523643e319
by okozina
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=08a82aa940ad3c...
Commit: 08a82aa940ad3c2841c52544543a08919c0ed110
Parent: e0a62b8fdc8d041c14ca523643e319431b80126f
Author: Ondrej Kozina <okozina(a)redhat.com>
AuthorDate: Wed Apr 29 17:04:39 2015 +0200
Committer: Ondrej Kozina <okozina(a)redhat.com>
CommitterDate: Wed Apr 29 17:12:04 2015 +0200
WHATS_NEW: commit e0a62b8fdc8d041c14ca523643e319
---
WHATS_NEW | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 6949497..49b2bad 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.119 -
==================================
+ Introduce support for exit on idle feature in libdaemon
Add --showunsupported to lvmconfig to also display unsupported settings.
Display unsupported settings for lvmconfig --type current,diff only by default.
Honour lvmconfig --ignoreunsupported and --ignoreadvanced for all --type.
8 years, 12 months
master - libdaemon: introduce support for exit on idle
by okozina
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=e0a62b8fdc8d04...
Commit: e0a62b8fdc8d041c14ca523643e319431b80126f
Parent: b120454b505f88719735fd1b653dec48816d6036
Author: Ondrej Kozina <okozina(a)redhat.com>
AuthorDate: Wed Apr 29 16:59:30 2015 +0200
Committer: Ondrej Kozina <okozina(a)redhat.com>
CommitterDate: Wed Apr 29 17:10:44 2015 +0200
libdaemon: introduce support for exit on idle
works with systemd activated daemons only as of now
each daemon implementation may decide to signalize its
internal idle state (i.e. all background tasks unrelated to
client threads are finished)
---
libdaemon/server/daemon-server.c | 41 ++++++++++++++++++++++++++++++++++++-
libdaemon/server/daemon-server.h | 19 +++++++++++++++++
2 files changed, 58 insertions(+), 2 deletions(-)
diff --git a/libdaemon/server/daemon-server.c b/libdaemon/server/daemon-server.c
index 5ccf4e9..1869956 100644
--- a/libdaemon/server/daemon-server.c
+++ b/libdaemon/server/daemon-server.c
@@ -80,6 +80,29 @@ static void _exit_handler(int sig __attribute__((unused)))
# include <stdio.h>
+static int _is_idle(daemon_state s)
+{
+ return _systemd_activation && s.idle && s.idle->is_idle && !s.threads->next;
+}
+
+static struct timeval *_get_timeout(daemon_state s)
+{
+ return (_systemd_activation && s.idle) ? s.idle->ptimeout : NULL;
+}
+
+static void _reset_timeout(daemon_state s)
+{
+ if (s.idle) {
+ s.idle->ptimeout->tv_sec = 1;
+ s.idle->ptimeout->tv_usec = 0;
+ }
+}
+
+static unsigned _get_max_timeouts(daemon_state s)
+{
+ return s.idle ? s.idle->max_timeouts : 0;
+}
+
static int _set_oom_adj(const char *oom_adj_path, int val)
{
FILE *fp;
@@ -513,6 +536,7 @@ void daemon_start(daemon_state s)
int failed = 0;
log_state _log = { { 0 } };
thread_state _threads = { .next = NULL };
+ unsigned timeout_count = 0;
/*
* Switch to C locale to avoid reading large locale-archive file used by
@@ -583,15 +607,28 @@ void daemon_start(daemon_state s)
failed = 1;
while (!_shutdown_requested && !failed) {
+ _reset_timeout(s);
fd_set in;
FD_ZERO(&in);
FD_SET(s.socket_fd, &in);
- if (select(FD_SETSIZE, &in, NULL, NULL, NULL) < 0 && errno != EINTR)
+ if (select(FD_SETSIZE, &in, NULL, NULL, _get_timeout(s)) < 0 && errno != EINTR)
perror("select error");
- if (FD_ISSET(s.socket_fd, &in))
+ if (FD_ISSET(s.socket_fd, &in)) {
+ timeout_count = 0;
if (!_shutdown_requested && !handle_connect(s))
ERROR(&s, "Failed to handle a client connection.");
+ }
+
reap(s, 0);
+
+ /* s.idle == NULL equals no shutdown on timeout */
+ if (_is_idle(s)) {
+ DEBUGLOG(&s, "timeout occured");
+ if (++timeout_count >= _get_max_timeouts(s)) {
+ INFO(&s, "Inactive for %d seconds. Exiting.", timeout_count);
+ break;
+ }
+ }
}
INFO(&s, "%s waiting for client threads to finish", s.name);
diff --git a/libdaemon/server/daemon-server.h b/libdaemon/server/daemon-server.h
index a7673d4..820e5e0 100644
--- a/libdaemon/server/daemon-server.h
+++ b/libdaemon/server/daemon-server.h
@@ -35,6 +35,21 @@ typedef struct {
struct buffer buffer;
} response;
+struct timeval;
+
+/*
+ * is_idle: daemon implementation sets it to true when no background task
+ * is running
+ * max_timeouts: how many seconds do daemon allow to be idle before it shutdowns
+ * ptimeout: internal variable passed to select(). has to be reset to 1 second
+ * before each select
+ */
+typedef struct {
+ volatile unsigned is_idle;
+ unsigned max_timeouts;
+ struct timeval *ptimeout;
+} daemon_idle;
+
struct daemon_state;
/*
@@ -98,6 +113,10 @@ typedef struct daemon_state {
log_state *log;
struct thread_state *threads;
+
+ /* suport for shutdown on idle */
+ daemon_idle *idle;
+
void *private; /* the global daemon state */
} daemon_state;
8 years, 12 months
master - toollib: code cleanup in lv_spawn_background_polling
by okozina
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=b120454b505f88...
Commit: b120454b505f88719735fd1b653dec48816d6036
Parent: f0ff3e9982f1812435bf294d18f743762c944eb1
Author: Ondrej Kozina <okozina(a)redhat.com>
AuthorDate: Wed Apr 29 16:25:50 2015 +0200
Committer: Ondrej Kozina <okozina(a)redhat.com>
CommitterDate: Wed Apr 29 17:10:37 2015 +0200
toollib: code cleanup in lv_spawn_background_polling
we're going to extract parameters from lv_mirr later
with code refactoring of polldaemon
---
tools/toollib.c | 19 ++++++++++---------
1 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/tools/toollib.c b/tools/toollib.c
index 2268b7e..d29bebf 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
- * Copyright (C) 2004-2014 Red Hat, Inc. All rights reserved.
+ * Copyright (C) 2004-2015 Red Hat, Inc. All rights reserved.
*
* This file is part of LVM2.
*
@@ -910,14 +910,15 @@ void lv_spawn_background_polling(struct cmd_context *cmd,
struct logical_volume *lv)
{
const char *pvname;
+ const struct logical_volume *lv_mirr = NULL;
- if (lv_is_pvmove(lv) &&
- (pvname = get_pvmove_pvname_from_lv_mirr(lv))) {
- log_verbose("Spawning background pvmove process for %s.",
- pvname);
- pvmove_poll(cmd, pvname, 1);
- } else if (lv_is_locked(lv) &&
- (pvname = get_pvmove_pvname_from_lv(lv))) {
+ if (lv_is_pvmove(lv))
+ lv_mirr = lv;
+ else if (lv_is_locked(lv))
+ lv_mirr = find_pvmove_lv_in_lv(lv);
+
+ if (lv_mirr &&
+ (pvname = get_pvmove_pvname_from_lv_mirr(lv_mirr))) {
log_verbose("Spawning background pvmove process for %s.",
pvname);
pvmove_poll(cmd, pvname, 1);
@@ -925,7 +926,7 @@ void lv_spawn_background_polling(struct cmd_context *cmd,
if (lv_is_converting(lv) || lv_is_merging(lv)) {
log_verbose("Spawning background lvconvert process for %s.",
- lv->name);
+ lv->name);
lvconvert_poll(cmd, lv, 1);
}
}
8 years, 12 months
master - man: 'lvm config' is preferred over 'lvm lvmconfig'
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f0ff3e9982f181...
Commit: f0ff3e9982f1812435bf294d18f743762c944eb1
Parent: 79ec8eb93ca9620d69cdf8ca294f76a53e652cfe
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Apr 29 10:04:28 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Apr 29 10:04:28 2015 -0500
man: 'lvm config' is preferred over 'lvm lvmconfig'
---
man/lvm.8.in | 2 +-
man/lvm.conf.5.in | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/man/lvm.8.in b/man/lvm.8.in
index 3d408fb..7ed35c8 100644
--- a/man/lvm.8.in
+++ b/man/lvm.8.in
@@ -321,7 +321,7 @@ way it fits with other LVM configuration methods.
A short form of \fB\-\-metadataprofile\fP for \fBvgcreate\fP, \fBlvcreate\fP,
\fBvgchange\fP and \fBlvchange\fP command and a short form of \fB\-\-commandprofile\fP
for any other command (with the exception of \fBlvmconfig\fP command where the
-\-\-profile has special meaning, see \fBlvm lvmconfig\fP(8) for more information).
+\-\-profile has special meaning, see \fBlvm config\fP(8) for more information).
.TP
.IR \fB\-\-config " " \fIConfigurationString
Uses the ConfigurationString as direct string representation of the configuration
diff --git a/man/lvm.conf.5.in b/man/lvm.conf.5.in
index 517c0f9..88694a1 100644
--- a/man/lvm.conf.5.in
+++ b/man/lvm.conf.5.in
@@ -65,8 +65,8 @@ For this purpose, there's the \fBcommand_profile_template.profile\fP
(for metadata profiles) which contain all settings that are customizable
by profiles of certain type. Users are encouraged to copy these template
profiles and edit them as needed. Alternatively, the
-\fBlvm lvmconfig \-\-file <ProfileName.profile> \-\-type profilable-command <section>\fP
-or \fBlvm lvmconfig \-\-file <ProfileName.profile> \-\-type profilable-metadata <section>\fP
+\fBlvm config \-\-file <ProfileName.profile> \-\-type profilable-command <section>\fP
+or \fBlvm config \-\-file <ProfileName.profile> \-\-type profilable-metadata <section>\fP
can be used to generate a configuration with profilable settings in either
of the type for given section and save it to new ProfileName.profile
(if the section is not specified, all profilable settings are reported).
8 years, 12 months
master - cleanup: lvmconfig man page typo
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=79ec8eb93ca962...
Commit: 79ec8eb93ca9620d69cdf8ca294f76a53e652cfe
Parent: 8b6b90b0730658c12169a0a8fffcf043be6c7eb6
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Wed Apr 29 16:35:49 2015 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Wed Apr 29 16:35:49 2015 +0200
cleanup: lvmconfig man page typo
---
man/lvmconfig.8.in | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/man/lvmconfig.8.in b/man/lvmconfig.8.in
index b855a6e..ff7c63b 100644
--- a/man/lvmconfig.8.in
+++ b/man/lvmconfig.8.in
@@ -151,7 +151,7 @@ info about \fBconfig cascade\fP.
.TP
.B \-\-showunsupported
-Include unsupported configuration settings to the output. These settings
+Include unsupported configuration settings in the output. These settings
are either used for debugging or development purposes only or their support
is not yet complete and they are not meant to be used in production. The
\fBcurrent\fP and \fBdiff\fP types include unsupported settings in their
8 years, 12 months
master - config: consolidate CFG_UNSUPPORTED and CFG_ADVANCED settings
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=8b6b90b0730658...
Commit: 8b6b90b0730658c12169a0a8fffcf043be6c7eb6
Parent: 244ca7ee775b554eb12d1897a8f90bf2d9640138
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Wed Apr 29 16:07:52 2015 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Wed Apr 29 16:31:47 2015 +0200
config: consolidate CFG_UNSUPPORTED and CFG_ADVANCED settings
These settings are in the "unsupported" group:
devices/loopfiles
log/activate_file
metadata/disk_areas (section)
metadata/disk_areas/<disk_area> (section)
metadata/disk_areas/<disk_area>/size
metadata/disk_areas/<disk_area>/id
These settings are in the "advanced" group:
devices/dir
devices/scan
devices/types
global/proc
activation/missing_stripe_filler
activation/mlock_filter
metadata/pvmetadatacopies
metadata/pvmetadataignore
metadata/stripesize
metadata/dirs
Also, this patch causes the --ignoreunsupported and --ignoreadvanced
switches to be honoured for all config types (lvmconfig --type).
By default, the --type current and --type diff display unsupported
settings, the other types ignore them - this patch also introduces
--showunsupported switch for all these other types to display even
unsupported settings in their output if needed.
---
WHATS_NEW | 3 +++
lib/config/config.c | 10 +++++++++-
lib/config/config.h | 2 ++
lib/config/config_settings.h | 36 ++++++++++++++++++------------------
man/lvmconfig.8.in | 15 +++++++++++++--
tools/args.h | 1 +
tools/commands.h | 12 +++++++++---
tools/dumpconfig.c | 23 +++++++++++++++++++++--
8 files changed, 76 insertions(+), 26 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 1437825..6949497 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,8 @@
Version 2.02.119 -
==================================
+ Add --showunsupported to lvmconfig to also display unsupported settings.
+ Display unsupported settings for lvmconfig --type current,diff only by default.
+ Honour lvmconfig --ignoreunsupported and --ignoreadvanced for all --type.
Make python bindings usable with python3 (and compatible with 2.6 & 2.7).
Add lvmconfig -l|--list as shortcut for lvmconfig --type list --withsummary.
Add lvmconfig --type list to display plain list of configuration settings.
diff --git a/lib/config/config.c b/lib/config/config.c
index 45a1d36..167cfff 100644
--- a/lib/config/config.c
+++ b/lib/config/config.c
@@ -826,6 +826,12 @@ static int _check_value_differs_from_default(struct cft_check_handle *handle,
float f;
const char *str;
+ if ((handle->ignoreunsupported && (def->flags & CFG_UNSUPPORTED)) ||
+ (handle->ignoreadvanced && (def->flags & CFG_ADVANCED))) {
+ diff = 0;
+ goto out;
+ }
+
/* if default value is undefined, the value used differs from default */
if (def->flags & CFG_DEFAULT_UNDEFINED) {
diff = 1;
@@ -1598,7 +1604,7 @@ static int _out_prefix_fn(const struct dm_config_node *cn, const char *line, voi
static int _out_line_fn(const struct dm_config_node *cn, const char *line, void *baton)
{
struct out_baton *out = baton;
- struct cfg_def_item *cfg_def = cfg_def_get_item_p(cn->id);
+ struct cfg_def_item *cfg_def;
char config_path[CFG_PATH_MAX_LEN];
char summary[MAX_COMMENT_LINE+1];
char version[9];
@@ -1608,6 +1614,8 @@ static int _out_line_fn(const struct dm_config_node *cn, const char *line, void
(!(out->tree_spec->check_status[cn->id] & CFG_DIFF)))
return 1;
+ cfg_def = cfg_def_get_item_p(cn->id);
+
if (out->tree_spec->type == CFG_DEF_TREE_LIST) {
/* List view with node paths and summary. */
if (cfg_def->type & CFG_TYPE_SECTION)
diff --git a/lib/config/config.h b/lib/config/config.h
index 1e9f0f8..892529d 100644
--- a/lib/config/config.h
+++ b/lib/config/config.h
@@ -198,6 +198,8 @@ struct cft_check_handle {
unsigned skip_if_checked:1; /* skip the check if already done before - return last state */
unsigned suppress_messages:1; /* suppress messages during the check if config item is found invalid */
unsigned check_diff:1; /* check if the value used differs from default one */
+ unsigned ignoreadvanced:1; /* do not include advnced configs */
+ unsigned ignoreunsupported:1; /* do not include unsupported configs */
uint8_t status[CFG_COUNT]; /* flags for each configuration item - the result of the check */
};
diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h
index e97ada5..aaaa3a3 100644
--- a/lib/config/config_settings.h
+++ b/lib/config/config_settings.h
@@ -39,7 +39,7 @@
* CFG_NAME_VARIABLE - configuration node name is variable
* CFG_ALLOW_EMPTY - node value can be emtpy
* CFG_ADVANCED - this node belongs to advanced config set
- * CFG_UNSUPPORTED - this node belongs to unsupported config set
+ * CFG_UNSUPPORTED - this node is not officially supported and it's used primarily by developers
* CFG_PROFILABLE - this node is customizable by a profile
* CFG_PROFILABLE_METADATA - profilable and attachable to VG/LV metadata
* CFG_DEFAULT_UNDEFINED - node's default value is undefined
@@ -99,9 +99,9 @@ cfg_section(global_CFG_SECTION, "global", root_CFG_SECTION, CFG_PROFILABLE, vsn(
"Miscellaneous global LVM settings.\n")
cfg_section(activation_CFG_SECTION, "activation", root_CFG_SECTION, CFG_PROFILABLE, vsn(1, 0, 0), NULL)
-cfg_section(metadata_CFG_SECTION, "metadata", root_CFG_SECTION, CFG_ADVANCED, vsn(1, 0, 0), NULL)
+cfg_section(metadata_CFG_SECTION, "metadata", root_CFG_SECTION, 0, vsn(1, 0, 0), NULL)
-cfg_section(report_CFG_SECTION, "report", root_CFG_SECTION, CFG_ADVANCED | CFG_PROFILABLE, vsn(1, 0, 0),
+cfg_section(report_CFG_SECTION, "report", root_CFG_SECTION, CFG_PROFILABLE, vsn(1, 0, 0),
"LVM report command output formatting.\n")
cfg_section(dmeventd_CFG_SECTION, "dmeventd", root_CFG_SECTION, 0, vsn(1, 2, 3),
@@ -127,14 +127,14 @@ cfg(config_abort_on_errors_CFG, "abort_on_errors", config_CFG_SECTION, 0, CFG_TY
cfg_runtime(config_profile_dir_CFG, "profile_dir", config_CFG_SECTION, 0, CFG_TYPE_STRING, vsn(2, 2, 99),
"Directory where LVM looks for configuration profiles.\n")
-cfg(devices_dir_CFG, "dir", devices_CFG_SECTION, 0, CFG_TYPE_STRING, DEFAULT_DEV_DIR, vsn(1, 0, 0), NULL,
+cfg(devices_dir_CFG, "dir", devices_CFG_SECTION, CFG_ADVANCED, CFG_TYPE_STRING, DEFAULT_DEV_DIR, vsn(1, 0, 0), NULL,
"Directory in which to create volume group device nodes.\n"
"Commands also accept this as a prefix on volume group names.\n")
-cfg_array(devices_scan_CFG, "scan", devices_CFG_SECTION, 0, CFG_TYPE_STRING, "#S/dev", vsn(1, 0, 0), NULL,
+cfg_array(devices_scan_CFG, "scan", devices_CFG_SECTION, CFG_ADVANCED, CFG_TYPE_STRING, "#S/dev", vsn(1, 0, 0), NULL,
"Directories containing device nodes to use with LVM.\n")
-cfg_array(devices_loopfiles_CFG, "loopfiles", devices_CFG_SECTION, CFG_DEFAULT_UNDEFINED, CFG_TYPE_STRING, NULL, vsn(1, 2, 0), NULL, NULL)
+cfg_array(devices_loopfiles_CFG, "loopfiles", devices_CFG_SECTION, CFG_DEFAULT_UNDEFINED | CFG_UNSUPPORTED, CFG_TYPE_STRING, NULL, vsn(1, 2, 0), NULL, NULL)
cfg(devices_obtain_device_list_from_udev_CFG, "obtain_device_list_from_udev", devices_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_OBTAIN_DEVICE_LIST_FROM_UDEV, vsn(2, 2, 85), NULL,
"Obtain the list of available devices from udev.\n"
@@ -239,7 +239,7 @@ cfg(devices_cache_file_prefix_CFG, "cache_file_prefix", devices_CFG_SECTION, CFG
cfg(devices_write_cache_state_CFG, "write_cache_state", devices_CFG_SECTION, 0, CFG_TYPE_BOOL, 1, vsn(1, 0, 0), NULL,
"Enable/disable writing the cache file. See devices/cache_dir.\n")
-cfg_array(devices_types_CFG, "types", devices_CFG_SECTION, CFG_DEFAULT_UNDEFINED, CFG_TYPE_INT | CFG_TYPE_STRING, NULL, vsn(1, 0, 0), NULL,
+cfg_array(devices_types_CFG, "types", devices_CFG_SECTION, CFG_DEFAULT_UNDEFINED | CFG_ADVANCED, CFG_TYPE_INT | CFG_TYPE_STRING, NULL, vsn(1, 0, 0), NULL,
"List of additional acceptable block device types.\n"
"These are of device type names from /proc/devices,\n"
"followed by the maximum number of partitions.\n"
@@ -518,7 +518,7 @@ cfg(log_activation_CFG, "activation", log_CFG_SECTION, 0, CFG_TYPE_BOOL, 0, vsn(
"Log messages during activation.\n"
"Don't use this in low memory situations (can deadlock).\n")
-cfg(log_activate_file_CFG, "activate_file", log_CFG_SECTION, CFG_DEFAULT_UNDEFINED, CFG_TYPE_STRING, NULL, vsn(1, 0, 0), NULL, NULL)
+cfg(log_activate_file_CFG, "activate_file", log_CFG_SECTION, CFG_DEFAULT_UNDEFINED | CFG_UNSUPPORTED, CFG_TYPE_STRING, NULL, vsn(1, 0, 0), NULL, NULL)
cfg_array(log_debug_classes_CFG, "debug_classes", log_CFG_SECTION, CFG_ALLOW_EMPTY, CFG_TYPE_STRING, "#Smemory#Sdevices#Sactivation#Sallocation#Slvmetad#Smetadata#Scache#Slocking", vsn(2, 2, 99), NULL,
"Select log messages by class.\n"
@@ -605,7 +605,7 @@ cfg_array(global_format_libraries_CFG, "format_libraries", global_CFG_SECTION, C
cfg_array(global_segment_libraries_CFG, "segment_libraries", global_CFG_SECTION, CFG_DEFAULT_UNDEFINED, CFG_TYPE_STRING, NULL, vsn(1, 0, 18), NULL, NULL)
-cfg(global_proc_CFG, "proc", global_CFG_SECTION, 0, CFG_TYPE_STRING, DEFAULT_PROC_DIR, vsn(1, 0, 0), NULL,
+cfg(global_proc_CFG, "proc", global_CFG_SECTION, CFG_ADVANCED, CFG_TYPE_STRING, DEFAULT_PROC_DIR, vsn(1, 0, 0), NULL,
"Location of proc filesystem.\n")
cfg(global_etc_CFG, "etc", global_CFG_SECTION, 0, CFG_TYPE_STRING, DEFAULT_ETC_DIR, vsn(2, 2, 117), "@CONFDIR@",
@@ -926,7 +926,7 @@ cfg(activation_retry_deactivation_CFG, "retry_deactivation", activation_CFG_SECT
"process run from a quick udev rule temporarily opened\n"
"the device.\n")
-cfg(activation_missing_stripe_filler_CFG, "missing_stripe_filler", activation_CFG_SECTION, 0, CFG_TYPE_STRING, DEFAULT_STRIPE_FILLER, vsn(1, 0, 0), NULL,
+cfg(activation_missing_stripe_filler_CFG, "missing_stripe_filler", activation_CFG_SECTION, CFG_ADVANCED, CFG_TYPE_STRING, DEFAULT_STRIPE_FILLER, vsn(1, 0, 0), NULL,
"Method to fill missing stripes when activating an incomplete LV.\n"
"Using 'error' will make inaccessible parts of the device return\n"
"I/O errors on access. You can instead use a device path, in which\n"
@@ -1135,7 +1135,7 @@ cfg(activation_thin_pool_autoextend_percent_CFG, "thin_pool_autoextend_percent",
"The amount of additional space added to a thin pool is this\n"
"percent of its current size.\n")
-cfg_array(activation_mlock_filter_CFG, "mlock_filter", activation_CFG_SECTION, CFG_DEFAULT_UNDEFINED, CFG_TYPE_STRING, NULL, vsn(2, 2, 62), NULL,
+cfg_array(activation_mlock_filter_CFG, "mlock_filter", activation_CFG_SECTION, CFG_DEFAULT_UNDEFINED | CFG_ADVANCED, CFG_TYPE_STRING, NULL, vsn(2, 2, 62), NULL,
"Do not mlock these memory areas.\n"
"While activating devices, I/O to devices being\n"
"(re)configured is suspended. As a precaution against\n"
@@ -1209,7 +1209,7 @@ cfg(metadata_pvmetadatacopies_CFG, "pvmetadatacopies", metadata_CFG_SECTION, CFG
"be useful with VGs containing large numbers of PVs.\n"
"The '--pvmetadatacopies' option overrides this setting.\n")
-cfg(metadata_vgmetadatacopies_CFG, "vgmetadatacopies", metadata_CFG_SECTION, CFG_ADVANCED, CFG_TYPE_INT, DEFAULT_VGMETADATACOPIES, vsn(2, 2, 69), NULL,
+cfg(metadata_vgmetadatacopies_CFG, "vgmetadatacopies", metadata_CFG_SECTION, 0, CFG_TYPE_INT, DEFAULT_VGMETADATACOPIES, vsn(2, 2, 69), NULL,
"Number of copies of metadata to maintain for each VG.\n"
"If set to a non-zero value, LVM automatically chooses which of\n"
"the available metadata areas to use to achieve the requested\n"
@@ -1221,7 +1221,7 @@ cfg(metadata_vgmetadatacopies_CFG, "vgmetadatacopies", metadata_CFG_SECTION, CFG
"the individual PV level using 'pvchange --metadataignore y|n'.\n"
"The '--vgmetadatacopies' option overrides this setting.\n")
-cfg(metadata_pvmetadatasize_CFG, "pvmetadatasize", metadata_CFG_SECTION, CFG_ADVANCED, CFG_TYPE_INT, DEFAULT_PVMETADATASIZE, vsn(1, 0, 0), NULL,
+cfg(metadata_pvmetadatasize_CFG, "pvmetadatasize", metadata_CFG_SECTION, 0, CFG_TYPE_INT, DEFAULT_PVMETADATASIZE, vsn(1, 0, 0), NULL,
"Approximate number of sectors to use for each metadata copy.\n"
"VGs with large numbers of PVs or LVs, or VGs containing\n"
"complex LV structures, may need additional space for VG\n"
@@ -1252,11 +1252,11 @@ cfg_array(metadata_dirs_CFG, "dirs", metadata_CFG_SECTION, CFG_ADVANCED | CFG_DE
"Example:\n"
"dirs = [ \"/etc/lvm/metadata\", \"/mnt/disk2/lvm/metadata2\" ]\n")
-cfg_section(metadata_disk_areas_CFG_SUBSECTION, "disk_areas", metadata_CFG_SECTION, CFG_ADVANCED | CFG_UNSUPPORTED | CFG_DEFAULT_UNDEFINED, vsn(1, 0, 0), NULL)
-cfg_section(disk_area_CFG_SUBSECTION, "disk_area", metadata_disk_areas_CFG_SUBSECTION, CFG_NAME_VARIABLE | CFG_ADVANCED | CFG_UNSUPPORTED | CFG_DEFAULT_UNDEFINED, vsn(1, 0, 0), NULL)
-cfg(disk_area_start_sector_CFG, "start_sector", disk_area_CFG_SUBSECTION, CFG_ADVANCED | CFG_UNSUPPORTED | CFG_DEFAULT_UNDEFINED, CFG_TYPE_INT, 0, vsn(1, 0, 0), NULL, NULL)
-cfg(disk_area_size_CFG, "size", disk_area_CFG_SUBSECTION, CFG_ADVANCED | CFG_UNSUPPORTED | CFG_DEFAULT_UNDEFINED, CFG_TYPE_INT, 0, vsn(1, 0, 0), NULL, NULL)
-cfg(disk_area_id_CFG, "id", disk_area_CFG_SUBSECTION, CFG_ADVANCED | CFG_UNSUPPORTED | CFG_DEFAULT_UNDEFINED, CFG_TYPE_STRING, NULL, vsn(1, 0, 0), NULL, NULL)
+cfg_section(metadata_disk_areas_CFG_SUBSECTION, "disk_areas", metadata_CFG_SECTION, CFG_UNSUPPORTED | CFG_DEFAULT_UNDEFINED, vsn(1, 0, 0), NULL)
+cfg_section(disk_area_CFG_SUBSECTION, "disk_area", metadata_disk_areas_CFG_SUBSECTION, CFG_NAME_VARIABLE | CFG_UNSUPPORTED | CFG_DEFAULT_UNDEFINED, vsn(1, 0, 0), NULL)
+cfg(disk_area_start_sector_CFG, "start_sector", disk_area_CFG_SUBSECTION, CFG_UNSUPPORTED | CFG_DEFAULT_UNDEFINED, CFG_TYPE_INT, 0, vsn(1, 0, 0), NULL, NULL)
+cfg(disk_area_size_CFG, "size", disk_area_CFG_SUBSECTION, CFG_UNSUPPORTED | CFG_DEFAULT_UNDEFINED, CFG_TYPE_INT, 0, vsn(1, 0, 0), NULL, NULL)
+cfg(disk_area_id_CFG, "id", disk_area_CFG_SUBSECTION, CFG_UNSUPPORTED | CFG_DEFAULT_UNDEFINED, CFG_TYPE_STRING, NULL, vsn(1, 0, 0), NULL, NULL)
cfg(report_compact_output_CFG, "compact_output", report_CFG_SECTION, CFG_PROFILABLE, CFG_TYPE_BOOL, DEFAULT_REP_COMPACT_OUTPUT, vsn(2, 2, 115), NULL,
"Do not print empty report fields.\n"
diff --git a/man/lvmconfig.8.in b/man/lvmconfig.8.in
index 798e2bb..b855a6e 100644
--- a/man/lvmconfig.8.in
+++ b/man/lvmconfig.8.in
@@ -22,6 +22,7 @@ lvmconfig, lvm dumpconfig, lvm config \(em Display LVM configuration
.RB [ \-\-metadataprofile
.IR ProfileName ]
.RB [ \-\-mergedconfig ]
+.RB [ \-\-showunsupported ]
.RB [ \-\-validate ]
.RB [ \-\-withsummary ]
.RB [ \-\-withcomments ]
@@ -103,8 +104,10 @@ Exclude advanced configuration settings from the output.
.TP
.B \-\-ignoreunsupported
Exclude unsupported configuration settings from the output. These settings are
-either used for debugging purposes only or their support is not yet
-complete and they are not meant to be used in production.
+either used for debugging and development purposes only or their support is not
+yet complete and they are not meant to be used in production. The \fBcurrent\fP
+and \fBdiff\fP types include unsupported settings in their output by default,
+all the other types ignore unsupported settings.
.TP
.B \-\-ignorelocal
@@ -147,6 +150,14 @@ the front of the cascade is displayed. See also \fBlvm.conf\fP(5) for more
info about \fBconfig cascade\fP.
.TP
+.B \-\-showunsupported
+Include unsupported configuration settings to the output. These settings
+are either used for debugging or development purposes only or their support
+is not yet complete and they are not meant to be used in production. The
+\fBcurrent\fP and \fBdiff\fP types include unsupported settings in their
+output by default, all the other types ignore unsupported settings.
+
+.TP
.B \-\-validate
Validate current configuration used and exit with appropriate
return code. The validation is done only for the configuration
diff --git a/tools/args.h b/tools/args.h
index 465100d..2745699 100644
--- a/tools/args.h
+++ b/tools/args.h
@@ -98,6 +98,7 @@ arg(split_ARG, '\0', "split", NULL, 0)
arg(splitcache_ARG, '\0', "splitcache", NULL, 0)
arg(splitmirrors_ARG, '\0', "splitmirrors", int_arg, 0)
arg(splitsnapshot_ARG, '\0', "splitsnapshot", NULL, 0)
+arg(showunsupported_ARG, '\0', "showunsupported", NULL, 0)
arg(stripes_long_ARG, '\0', "stripes", int_arg, 0)
arg(syncaction_ARG, '\0', "syncaction", string_arg, 0) /* FIXME Use custom validation fn */
arg(sysinit_ARG, '\0', "sysinit", NULL, 0)
diff --git a/tools/commands.h b/tools/commands.h
index f7b6e98..b7f9844 100644
--- a/tools/commands.h
+++ b/tools/commands.h
@@ -44,6 +44,7 @@ xx(config,
"\t[--profile ProfileName]\n"
"\t[--metadataprofile ProfileName]\n"
"\t[--mergedconfig]\n"
+ "\t[--showunsupported]\n"
"\t[--validate]\n"
"\t[--withsummary]\n"
"\t[--withcomments]\n"
@@ -52,7 +53,8 @@ xx(config,
"\t[ConfigurationNode...]\n",
atversion_ARG, configtype_ARG, file_ARG, ignoreadvanced_ARG,
ignoreunsupported_ARG, ignorelocal_ARG, list_ARG, mergedconfig_ARG, metadataprofile_ARG,
- validate_ARG, withsummary_ARG, withcomments_ARG, unconfigured_ARG, withversions_ARG)
+ showunsupported_ARG, validate_ARG, withsummary_ARG, withcomments_ARG, unconfigured_ARG,
+ withversions_ARG)
xx(devtypes,
"Display recognised built-in block device types",
@@ -96,6 +98,7 @@ xx(dumpconfig,
"\t[--profile ProfileName]\n"
"\t[--metadataprofile ProfileName]\n"
"\t[--mergedconfig]\n"
+ "\t[--showunsupported]\n"
"\t[--validate]\n"
"\t[--withsummary]\n"
"\t[--withcomments]\n"
@@ -104,7 +107,8 @@ xx(dumpconfig,
"\t[ConfigurationNode...]\n",
atversion_ARG, configtype_ARG, file_ARG, ignoreadvanced_ARG,
ignoreunsupported_ARG, ignorelocal_ARG, list_ARG, mergedconfig_ARG, metadataprofile_ARG,
- validate_ARG, withsummary_ARG, withcomments_ARG, unconfigured_ARG, withversions_ARG)
+ showunsupported_ARG, validate_ARG, withsummary_ARG, withcomments_ARG, unconfigured_ARG,
+ withversions_ARG)
xx(formats,
"List available metadata formats",
@@ -497,6 +501,7 @@ xx(lvmconfig,
"\t[--profile ProfileName]\n"
"\t[--metadataprofile ProfileName]\n"
"\t[--mergedconfig]\n"
+ "\t[--showunsupported]\n"
"\t[--validate]\n"
"\t[--withsummary]\n"
"\t[--withcomments]\n"
@@ -505,7 +510,8 @@ xx(lvmconfig,
"\t[ConfigurationNode...]\n",
atversion_ARG, configtype_ARG, file_ARG, ignoreadvanced_ARG,
ignoreunsupported_ARG, ignorelocal_ARG, list_ARG, mergedconfig_ARG, metadataprofile_ARG,
- validate_ARG, withsummary_ARG, withcomments_ARG, unconfigured_ARG, withversions_ARG)
+ showunsupported_ARG, validate_ARG, withsummary_ARG, withcomments_ARG, unconfigured_ARG,
+ withversions_ARG)
xx(lvmdiskscan,
"List devices that may be used as physical volumes",
diff --git a/tools/dumpconfig.c b/tools/dumpconfig.c
index 50057a1..6b8f7b0 100644
--- a/tools/dumpconfig.c
+++ b/tools/dumpconfig.c
@@ -50,6 +50,9 @@ static int _do_def_check(struct config_def_tree_spec *spec,
handle->check_diff = 0;
}
+ handle->ignoreunsupported = spec->ignoreunsupported;
+ handle->ignoreadvanced = spec->ignoreadvanced;
+
config_def_check(handle);
*cft_check_handle = handle;
@@ -116,8 +119,22 @@ int dumpconfig(struct cmd_context *cmd, int argc, char **argv)
if (arg_count(cmd, ignoreadvanced_ARG))
tree_spec.ignoreadvanced = 1;
- if (arg_count(cmd, ignoreunsupported_ARG))
+ if (arg_count(cmd, ignoreunsupported_ARG)) {
+ if (arg_count(cmd, showunsupported_ARG)) {
+ log_error("Only one of --ignoreunsupported and --showunsupported permitted.");
+ return EINVALID_CMD_LINE;
+ }
tree_spec.ignoreunsupported = 1;
+ } else if (arg_count(cmd, showunsupported_ARG)) {
+ tree_spec.ignoreunsupported = 0;
+ } else if (strcmp(type, "current") && strcmp(type, "diff")) {
+ /*
+ * By default hide unsupported settings
+ * for all display types except "current"
+ * and "diff".
+ */
+ tree_spec.ignoreunsupported = 1;
+ }
if (arg_count(cmd, ignorelocal_ARG))
tree_spec.ignorelocal = 1;
@@ -128,7 +145,9 @@ int dumpconfig(struct cmd_context *cmd, int argc, char **argv)
return EINVALID_CMD_LINE;
}
- if ((tree_spec.ignoreadvanced || tree_spec.ignoreunsupported)) {
+ if (arg_count(cmd, ignoreunsupported_ARG) ||
+ arg_count(cmd, ignoreadvanced_ARG)) {
+ /* FIXME: allow these even for --type current */
log_error("--ignoreadvanced and --ignoreunsupported has "
"no effect with --type current");
return EINVALID_CMD_LINE;
8 years, 12 months