master - tests: add profiles-thin and prepare_profiles helper fn
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=504c328e3d2c0a...
Commit: 504c328e3d2c0a8b6b946fe7d323e1f28887e285
Parent: af73a0a5189c7d6abf6798952224dfe1b93d00d1
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Tue Apr 1 15:51:46 2014 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Tue Apr 1 15:52:54 2014 +0200
tests: add profiles-thin and prepare_profiles helper fn
---
test/Makefile.in | 2 +
test/lib/aux.sh | 8 ++++++
test/shell/profiles-thin.sh | 56 +++++++++++++++++++++++++++++++++++++++++++
3 files changed, 66 insertions(+), 0 deletions(-)
diff --git a/test/Makefile.in b/test/Makefile.in
index fe33949..7253bb4 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -177,6 +177,8 @@ CMDS = lvm $(shell cat $(top_builddir)/tools/.commands)
ln -fs $(abs_top_builddir)/daemons/lvmetad/lvmetad lib/lvmetad
ln -fs $(abs_top_srcdir)/scripts/vgimportclone.sh lib/vgimportclone
ln -fs $(abs_top_srcdir)/scripts/fsadm.sh lib/fsadm
+ ln -fs $(abs_top_srcdir)/conf/default.profile lib/default.profile
+ ln -fs $(abs_top_srcdir)/conf/thin-performance.profile lib/thin-performance.profile
touch $@
clean:
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index aa4c7a6..76cfd82 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -632,6 +632,14 @@ profileconf() {
mv -f PROFILE_$profile_name etc/profile/$profile_name.profile
}
+prepare_profiles() {
+ test -d etc/profile || mkdir etc/profile
+ for profile_name in $@; do
+ test -L "$abs_top_builddir/test/lib/$profile_name.profile" || skip
+ cp "$abs_top_builddir/test/lib/$profile_name.profile" "etc/profile/$profile_name.profile"
+ done
+}
+
apitest() {
local t=$1
shift
diff --git a/test/shell/profiles-thin.sh b/test/shell/profiles-thin.sh
new file mode 100644
index 0000000..1056528
--- /dev/null
+++ b/test/shell/profiles-thin.sh
@@ -0,0 +1,56 @@
+#!/bin/sh
+
+# Copyright (C) 2014 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# test thin profile functionality
+#
+
+. lib/test
+
+DEV_SIZE=32
+
+aux prepare_profiles "thin-performance"
+
+# Create scsi debug dev with sector size of 4096B and 1MiB optimal_io_size
+aux prepare_scsi_debug_dev $DEV_SIZE sector_size=4096 opt_blks=256
+aux prepare_pvs 1 $DEV_SIZE
+vgcreate $vg "$dev1"
+
+# By default, "generic" policy is used to
+# calculate chunk size which is 64KiB by default
+# or minimum_io_size if it's higher. Also, zeroing is used
+# under default operation.
+lvcreate -L8m -T $vg/pool_generic
+check lv_field $vg/pool_generic profile ""
+check lv_field $vg/pool_generic chunk_size 64.00k
+check lv_field $vg/pool_generic zero 1
+
+# If "thin-performance" profile is used, the "performance"
+# policy is used to calculate chunk size which is 512KiB
+# or optimal_io_suize if it's higher. Our test device has
+# 1MiB, so that should be used. Also, zeroing is not used
+# under "thin-perforance" profile.
+lvcreate --profile thin-performance -L8m -T $vg/pool_performance
+check lv_field $vg/pool_performance profile "thin-performance"
+check lv_field $vg/pool_performance chunk_size 1.00m
+check lv_field $vg/pool_performance zero 0
+
+vgremove -ff $vg
+
+# The profile must be also applied if using the profile
+# for the whole VG - any LVs inherit this profile then.
+vgcreate --profile thin-performance $vg "$dev1"
+lvcreate -L8m -T $vg/pool_performance_inherited
+# ...the LV does not have the profile attached, but VG does!
+check vg_field $vg profile "thin-performance"
+check lv_field $vg/pool_performance_inherited profile ""
+check lv_field $vg/pool_performance_inherited chunk_size 1.00m
+check lv_field $vg/pool_performance_inherited zero 0
10 years
master - libdm: Add missing UDEV_CFLAGS.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=af73a0a5189c7d...
Commit: af73a0a5189c7d6abf6798952224dfe1b93d00d1
Parent: d5682ccbaca1e6c405494b2b84417131c7b034f5
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Tue Apr 1 15:22:37 2014 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Tue Apr 1 15:26:26 2014 +0200
libdm: Add missing UDEV_CFLAGS.
---
libdm/Makefile.in | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/libdm/Makefile.in b/libdm/Makefile.in
index 2aa70d4..e50b174 100644
--- a/libdm/Makefile.in
+++ b/libdm/Makefile.in
@@ -37,6 +37,7 @@ INCLUDES = -I$(srcdir)/$(interface) -I$(srcdir)
ifeq ("@VALGRIND_POOL@", "yes")
INCLUDES += @VALGRIND_CFLAGS@
endif
+CFLAGS += $(UDEV_CFLAGS)
ifeq ("@STATIC_LINK@", "yes")
LIB_STATIC = $(interface)/libdevmapper.a
10 years
master - lvm-wrappers: Remove spurious #include <libudev.h>.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d5682ccbaca1e6...
Commit: d5682ccbaca1e6c405494b2b84417131c7b034f5
Parent: 490226fc475232e0b158cf9fdc8670a663da4efe
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Tue Apr 1 15:17:50 2014 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Tue Apr 1 15:26:26 2014 +0200
lvm-wrappers: Remove spurious #include <libudev.h>.
---
lib/device/dev-cache.c | 3 +++
lib/misc/lvm-wrappers.c | 2 ++
lib/misc/lvm-wrappers.h | 2 +-
3 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/lib/device/dev-cache.c b/lib/device/dev-cache.c
index 94052dc..b16ace4 100644
--- a/lib/device/dev-cache.c
+++ b/lib/device/dev-cache.c
@@ -19,6 +19,9 @@
#include "config.h"
#include "toolcontext.h"
+#ifdef UDEV_SYNC_SUPPORT
+#include <libudev.h>
+#endif
#include <unistd.h>
#include <sys/param.h>
#include <dirent.h>
diff --git a/lib/misc/lvm-wrappers.c b/lib/misc/lvm-wrappers.c
index 46590b9..7ea3ac5 100644
--- a/lib/misc/lvm-wrappers.c
+++ b/lib/misc/lvm-wrappers.c
@@ -18,6 +18,8 @@
#include <fcntl.h>
#ifdef UDEV_SYNC_SUPPORT
+#include <libudev.h>
+
struct udev *_udev;
int udev_init_library_context(void)
diff --git a/lib/misc/lvm-wrappers.h b/lib/misc/lvm-wrappers.h
index e43f831..b8d1217 100644
--- a/lib/misc/lvm-wrappers.h
+++ b/lib/misc/lvm-wrappers.h
@@ -17,7 +17,7 @@
#define _LVM_WRAPPERS_H
#ifdef UDEV_SYNC_SUPPORT
-#include <libudev.h>
+struct udev;
struct udev *udev_get_library_context(void);
#endif
10 years
master - pvs: Wipe persistent filters when given a device argument.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=490226fc475232...
Commit: 490226fc475232e0b158cf9fdc8670a663da4efe
Parent: a30219a8c0ba2d9f5ce6402ff2edbd0ece263166
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Tue Apr 1 14:46:22 2014 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Tue Apr 1 14:46:22 2014 +0200
pvs: Wipe persistent filters when given a device argument.
---
test/shell/lvmcache-exercise.sh | 2 --
tools/reporter.c | 3 +++
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/test/shell/lvmcache-exercise.sh b/test/shell/lvmcache-exercise.sh
index 785ab17..b7c584b 100644
--- a/test/shell/lvmcache-exercise.sh
+++ b/test/shell/lvmcache-exercise.sh
@@ -24,8 +24,6 @@ fail pvs $(cat DEVICES)
vgcreate $vg1 "$dev2"
aux enable_dev "$dev1"
-pvscan
-# FIXME: above pvscan should not be needed
pvs "$dev1"
# reappearing device (rhbz 995440)
diff --git a/tools/reporter.c b/tools/reporter.c
index 602f173..e070bc2 100644
--- a/tools/reporter.c
+++ b/tools/reporter.c
@@ -271,6 +271,9 @@ static int _report(struct cmd_context *cmd, int argc, char **argv,
report_type == LABEL ||
report_type == PVSEGS) ? 1 : 0;
+ if (args_are_pvs && argc)
+ cmd->filter->wipe(cmd->filter);
+
switch (report_type) {
case DEVTYPES:
keys = find_config_tree_str(cmd, report_devtypes_sort_CFG, NULL);
10 years
master - tests: update profiles.sh for recent changes
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a30219a8c0ba2d...
Commit: a30219a8c0ba2d9f5ce6402ff2edbd0ece263166
Parent: 13009adbf266b5e72eeb882286b43948b15cd49b
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Tue Apr 1 11:48:49 2014 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Tue Apr 1 11:48:49 2014 +0200
tests: update profiles.sh for recent changes
---
test/shell/profiles.sh | 37 ++++++++++++++++++++++++++++++++++++-
1 files changed, 36 insertions(+), 1 deletions(-)
diff --git a/test/shell/profiles.sh b/test/shell/profiles.sh
index 654e04f..bae13d6 100644
--- a/test/shell/profiles.sh
+++ b/test/shell/profiles.sh
@@ -44,7 +44,36 @@ aux profileconf valid 'allocation/thin_pool_zero = 0' \
'allocation/thin_pool_discards = "passdown"' \
'allocation/thin_pool_chunk_size = 64'\
'activation/thin_pool_autoextend_threshold = 100' \
- 'activation/thin_pool_autoextend_percent = 20'
+ 'activation/thin_pool_autoextend_percent = 20' \
+ 'global/units = "h"' \
+ 'global/si_unit_consistency = 1' \
+ 'global/suffix = 1' \
+ 'global/lvdisplay_shows_full_device_path = 0' \
+ 'report/aligned = 1' \
+ 'report/buffered = 1' \
+ 'report/headings = 1' \
+ 'report/separator = " "' \
+ 'report/prefixes = 0' \
+ 'report/quoted = 1' \
+ 'report/colums_as_rows = 0' \
+ 'report/devtypes_sort = "devtype_name"' \
+ 'report/devtypes_cols = "devtype_name,devtype_max_partitions,devtype_description"' \
+ 'report/devtypes_cols_verbose = "devtype_name,devtype_max_partitions,devtype_description"' \
+ 'report/lvs_sort = "vg_name,lv_name"' \
+ 'report/lvs_cols = "lv_name,vg_name,lv_attr,lv_size,pool_lv,origin,data_percent,move_pv,mirror_log,copy_percent,convert_lv"' \
+ 'report/lvs_cols_verbose = "lv_name,vg_name,seg_count,lv_attr,lv_size,lv_major,lv_minor,lv_kernel_major,lv_kernel_minor,pool_lv,origin,data_percent,metadata_percent,move_pv,copy_percent,mirror_log,convert_lv,lv_uuid,lv_profile"' \
+ 'report/vgs_sort = "vg_name"' \
+ 'report/vgs_cols = "vg_name,pv_count,lv_count,snap_count,vg_attr,vg_size,vg_free"' \
+ 'report/vgs_cols_verbose = "vg_name,vg_attr,vg_extent_size,pv_count,lv_count,snap_count,vg_size,vg_free,vg_uuid,vg_profile"' \
+ 'report/pvs_sort = "pv_name"' \
+ 'report/pvs_cols = "pv_name,vg_name,pv_fmt,pv_attr,pv_size,pv_free"' \
+ 'report/pvs_cols_verbose = "pv_name,vg_name,pv_fmt,pv_attr,pv_size,pv_free,dev_size,pv_uuid"' \
+ 'report/segs_sort = "vg_name,lv_name,seg_start"' \
+ 'report/segs_cols = "lv_name,vg_name,lv_attr,stripes,segtype,seg_size"' \
+ 'report/segs_cols_verbose = "lv_name,vg_name,lv_attr,seg_start,seg_size,stripes,segtype,stripesize,chunksize"' \
+ 'report/pvsegs_sort = "pv_name,pvseg_start"' \
+ 'report/pvsegs_cols = "pv_name,vg_name,pv_fmt,pv_attr,pv_size,pv_free,pvseg_start,pvseg_size"' \
+ 'report/pvsegs_cols_verbose = "pv_name,vg_name,pv_fmt,pv_attr,pv_size,pv_free,pvseg_start,pvseg_size,lv_name,seg_start_pe,segtype,seg_pe_ranges"'
aux profileconf extra 'allocation/thin_pool_chunk_size = 128'
@@ -77,3 +106,9 @@ lvm dumpconfig &>out
grep 'thin_pool_zero=1' out
lvm dumpconfig --profile valid --mergedconfig >out
grep 'thin_pool_zero=0' out
+
+# dumpconfig --profilable output must be usable as a profile
+lvm dumpconfig --type profilable --file etc/profile/generated.profile
+pvs --profile generated &> msg
+not grep "$MSG_NOT_PROFILABLE" msg
+not grep "$MSG_IGNORING_INVALID_PROFILE" msg
10 years
master - man: add a note about --profile when using dumpconfig --mergedconfig
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=13009adbf266b5...
Commit: 13009adbf266b5e72eeb882286b43948b15cd49b
Parent: 68bb639a08330c7f06558e51ecab48d6a4ca2854
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Tue Apr 1 11:19:38 2014 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Tue Apr 1 11:19:38 2014 +0200
man: add a note about --profile when using dumpconfig --mergedconfig
---
man/lvm-dumpconfig.8.in | 10 ++++++----
man/lvm.conf.5.in | 2 +-
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/man/lvm-dumpconfig.8.in b/man/lvm-dumpconfig.8.in
index 7448992..e9fe84e 100644
--- a/man/lvm-dumpconfig.8.in
+++ b/man/lvm-dumpconfig.8.in
@@ -80,10 +80,12 @@ complete and they are not meant to be used in production.
.TP
.B \-\-mergedconfig
When the dumpconfig command is run with the \fB\-\-config\fP option
-(a common option that is recognized by all LVM tools, see also
-\fBlvm\fP(8)), merge this configuration with current configuration
-used (see \fB\-\-type current\fP above). Otherwise, only the
-configuration specified within \fB\-\-config\fP option is dumped.
+and/or \fB\-\-profile\fP option (common options that are recognized
+by all LVM tools, see also \fBlvm\fP(8)), merge the \fB\-\-config\fP
+and/or \fB\-\-profile\fP config with current configuration used
+(see \fB\-\-type current\fP above). Otherwise, only the configuration
+specified within \fB\-\-config\fP or \fB\-\-profile\fP option is dumped
+(see also \fBlvm.conf\fP(5) for more info about \fBconfig cascade\fP).
.TP
.B \-\-validate
diff --git a/man/lvm.conf.5.in b/man/lvm.conf.5.in
index 099c5a7..1bed3d9 100644
--- a/man/lvm.conf.5.in
+++ b/man/lvm.conf.5.in
@@ -67,7 +67,7 @@ exactly the same format as used in any LVM configuration file.
.LP
When several configuration methods are used at the same time
and when LVM looks for the value of a particular setting, it traverses
-this cascade from left to right:
+this \fBconfig cascade\fP from left to right:
\fBdirect config override on command line\fP -> \fBprofile config\fP -> \fBtag config\fP -> \fBlvm.conf\fP.
No part of this cascade is compulsory. If there's no setting value found at
the end of the cascade, a default value is used for that setting.
10 years