Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=8012c223e0beb858…
Commit: 8012c223e0beb858bc2a6b1ea809c4a98a90a5c1
Parent: 687bc5cecfe6293ee5556aa4e448459bb5c167e6
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Thu Jun 2 14:07:07 2016 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Thu Jun 2 14:07:07 2016 +0200
man: lvmconfig: add note about --type diff and --mergedconfig
---
man/lvmconfig.8.in | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/man/lvmconfig.8.in b/man/lvmconfig.8.in
index 257029e..f4b6abd 100644
--- a/man/lvmconfig.8.in
+++ b/man/lvmconfig.8.in
@@ -71,6 +71,7 @@ Display all possible configuration settings with default values assigned.
.IP \fBdiff\fP 3
Display all configuration settings for which the values used differ from defaults.
The value assigned for each configuration setting is the value currently used.
+Using this type also implies the use of \fB\-\-mergedconfig\fP option.
This is actually minimal LVM configuration which can be used without
a change to current configured behaviour.
.IP \fBfull\fP 3
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=687bc5cecfe6293e…
Commit: 687bc5cecfe6293ee5556aa4e448459bb5c167e6
Parent: fc37ee63c0562d3f42b597d485495ee79a857dc5
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Thu Jun 2 13:41:55 2016 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Thu Jun 2 13:49:38 2016 +0200
lvmconfig: fix lvmconfig --type diff to display complete diff if config cascade used
If configuration consists of several sources in config cascade
("config cascade" defined in man lvmconfig(8)), lvmconfig displayed
only difference from defaults of the topmost config in the cascade.
Fix lvmconfig to display complete difference, considering all
the configuration in the cascade.
For example, before this patch:
(use_lvmetad=0 set in lvm.conf which differs from defaults)
$ lvmconfig --type diff
global {
use_lvmetad=0
}
(compact_output=1 set on cmd line)
$ lvmconfig --type diff --config report/compact_output=1
report {
compact_output=1
}
(headings=0 set in profile)
$ lvmconfig --type diff --commandprofile test
report {
headings=0
}
(difference in topmost configuration source is displayed)
$ lvmconfig --type diff --commandprofile test --config report/compact_output=1
report {
compact_output=1
}
With this patch applied (the config cascade is merged before looking for
difference from defaults in configuration):
$ lvmconfig --type diff
global {
use_lvmetad=0
}
$ lvmconfig --type diff --config report/compact_output=1
report {
compact_output=1
}
global {
use_lvmetad=0
}
$ lvmconfig --type diff --profile test
report {
headings=0
}
global {
use_lvmetad=0
}
$ lvmconfig --type diff --profile test --config report/compact_output=1
report {
headings=0
compact_output=1
}
global {
use_lvmetad=0
}
---
WHATS_NEW | 1 +
tools/dumpconfig.c | 2 +-
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 74b5bdb..ea36c17 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.155 -
================================
+ Fix lvmconfig --type diff to display complete diff if config cascade used.
Automatically filter out partitioned loop devices with partscan (losetup -P).
Fix lvm devtypes internal error if -S used with field name from pvs/vgs/lvs.
When reporting Data%,Snap%,Meta%,Cpy%Sync use single ioctl per LV.
diff --git a/tools/dumpconfig.c b/tools/dumpconfig.c
index 81b488e..0880740 100644
--- a/tools/dumpconfig.c
+++ b/tools/dumpconfig.c
@@ -210,7 +210,7 @@ int dumpconfig(struct cmd_context *cmd, int argc, char **argv)
* Set the 'cft' to work with based on whether we need the plain
* config tree or merged config tree cascade if --mergedconfig is used.
*/
- if ((arg_count(cmd, mergedconfig_ARG) || !strcmp(type, "full")) && cmd->cft->cascade) {
+ if ((arg_count(cmd, mergedconfig_ARG) || !strcmp(type, "full") || !strcmp(type, "diff")) && cmd->cft->cascade) {
if (!_merge_config_cascade(cmd, cmd->cft, &cft)) {
log_error("Failed to merge configuration.");
r = ECMD_FAILED;
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a5d65b4a513b322d…
Commit: a5d65b4a513b322def4b6da1d498e4491c9da6d0
Parent: d73a83e8cf508b6d97ee937a01ebd24a678dfabc
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Jun 1 17:25:55 2016 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Jun 1 17:37:52 2016 +0200
tests: check losetup -P is correctly handled
Validate pvcreate will not overwrite partitioned loop device.
---
test/shell/losetup_partscan.sh | 63 ++++++++++++++++++++++++++++++++++++++++
1 files changed, 63 insertions(+), 0 deletions(-)
diff --git a/test/shell/losetup_partscan.sh b/test/shell/losetup_partscan.sh
new file mode 100644
index 0000000..90fafc0
--- /dev/null
+++ b/test/shell/losetup_partscan.sh
@@ -0,0 +1,63 @@
+#!/bin/bash
+# Copyright (C) 2016 Red Hat, Inc. All rights reserved.
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions
+# of the GNU General Public License v.2.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+# Check how lvm2 handles partitions over losetup -P devices
+
+SKIP_WITH_LVMLOCKD=1
+SKIP_WITH_LVMPOLLD=1
+
+. lib/inittest
+
+which sfdisk || skip
+
+aux prepare_loop 1000 -P || skip
+
+test -f LOOP
+LOOP=$(< LOOP)
+
+echo "1 2" | sfdisk $LOOP
+
+# wait for links
+aux udev_wait
+
+# losetup -P should provide partition
+ls -la "${LOOP}"*
+test -e "${LOOP}p1"
+
+aux extend_filter "a|$LOOP|"
+
+# creation should fail for 'partitioned' loop device
+not pvcreate -y $LOOP
+not vgcreate vg $LOOP
+
+aux teardown_devs
+
+aux prepare_loop 1000 || skip
+
+test -f LOOP
+LOOP=$(< LOOP)
+
+
+echo "1 2" | sfdisk $LOOP
+
+# wait for links
+aux udev_wait
+
+# no partitione should be actually there
+ls -la "${LOOP}"*
+test ! -e "${LOOP}p1"
+
+aux extend_filter "a|$LOOP|"
+
+# creation should pass for 'non-partitioned' loop device
+pvcreate -y $LOOP
+
+vgcreate vg $LOOP