master - config: make global/suffix profilable and add it to lvm.conf
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=927784cd063ebd...
Commit: 927784cd063ebd4aa3a82ad815db9e1811a900c4
Parent: 64086c3bd827c3f276886125711b112e87bcfd03
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Tue Mar 18 09:24:17 2014 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Tue Mar 18 09:24:17 2014 +0100
config: make global/suffix profilable and add it to lvm.conf
The global/suffix was missing from example lvm.conf but it can
be very useful when using lvm in scripts and now in profiles as well
Let's expose it more.
---
conf/default.profile.in | 1 +
conf/example.conf.in | 5 +++++
lib/commands/toolcontext.c | 3 +--
lib/config/config_settings.h | 2 +-
4 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/conf/default.profile.in b/conf/default.profile.in
index 2bf2143..72396e5 100644
--- a/conf/default.profile.in
+++ b/conf/default.profile.in
@@ -23,6 +23,7 @@ activation {
global {
units="h"
si_unit_consistency=1
+ suffix=1
}
report {
diff --git a/conf/example.conf.in b/conf/example.conf.in
index f54ab8d..2ed3fd6 100644
--- a/conf/example.conf.in
+++ b/conf/example.conf.in
@@ -483,6 +483,11 @@ global {
# temporarily until you update them.
si_unit_consistency = 1
+ # Whether or not to display unit suffix for sizes. This setting has
+ # no effect if the units are in human-readable form (global/units="h")
+ # in which case the suffix is always displayed.
+ suffix = 1
+
# Whether or not to communicate with the kernel device-mapper.
# Set to 0 if you want to use the tools to manipulate LVM metadata
# without activating any logical volumes.
diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c
index c616558..e620884 100644
--- a/lib/commands/toolcontext.c
+++ b/lib/commands/toolcontext.c
@@ -288,6 +288,7 @@ int process_profilable_config(struct cmd_context *cmd) {
}
cmd->si_unit_consistency = find_config_tree_bool(cmd, global_si_unit_consistency_CFG, NULL);
+ cmd->default_settings.suffix = find_config_tree_bool(cmd, global_suffix_CFG, NULL);
return 1;
}
@@ -350,8 +351,6 @@ static int _process_config(struct cmd_context *cmd)
cmd->auto_set_activation_skip = find_config_tree_bool(cmd, activation_auto_set_activation_skip_CFG, NULL);
- cmd->default_settings.suffix = find_config_tree_bool(cmd, global_suffix_CFG, NULL);
-
read_ahead = find_config_tree_str(cmd, activation_readahead_CFG, NULL);
if (!strcasecmp(read_ahead, "auto"))
cmd->default_settings.read_ahead = DM_READ_AHEAD_AUTO;
diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h
index 77acb45..72f99d5 100644
--- a/lib/config/config_settings.h
+++ b/lib/config/config_settings.h
@@ -153,7 +153,7 @@ cfg(global_test_CFG, "test", global_CFG_SECTION, 0, CFG_TYPE_BOOL, 0, vsn(1, 0,
cfg(global_units_CFG, "units", global_CFG_SECTION, CFG_PROFILABLE, CFG_TYPE_STRING, DEFAULT_UNITS, vsn(1, 0, 0), NULL)
cfg(global_si_unit_consistency_CFG, "si_unit_consistency", global_CFG_SECTION, CFG_PROFILABLE, CFG_TYPE_BOOL, DEFAULT_SI_UNIT_CONSISTENCY, vsn(2, 2, 54), NULL)
cfg(global_activation_CFG, "activation", global_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_ACTIVATION, vsn(1, 0, 0), NULL)
-cfg(global_suffix_CFG, "suffix", global_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_SUFFIX, vsn(1, 0, 0), NULL)
+cfg(global_suffix_CFG, "suffix", global_CFG_SECTION, CFG_PROFILABLE, CFG_TYPE_BOOL, DEFAULT_SUFFIX, vsn(1, 0, 0), NULL)
cfg(global_fallback_to_lvm1_CFG, "fallback_to_lvm1", global_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_FALLBACK_TO_LVM1, vsn(1, 0, 18), NULL)
cfg(global_format_CFG, "format", global_CFG_SECTION, 0, CFG_TYPE_STRING, DEFAULT_FORMAT, vsn(1, 0, 0), NULL)
cfg_array(global_format_libraries_CFG, "format_libraries", global_CFG_SECTION, CFG_DEFAULT_UNDEFINED, CFG_TYPE_STRING, NULL, vsn(1, 0, 0), NULL)
9 years, 8 months
master - doc: cleanup/extend some man pages/conf comments
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=64086c3bd827c3...
Commit: 64086c3bd827c3f276886125711b112e87bcfd03
Parent: 31b1d06dddbab131f85909315dcd1e2d3d6c4562
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Tue Mar 18 08:28:58 2014 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Tue Mar 18 08:28:58 2014 +0100
doc: cleanup/extend some man pages/conf comments
man/lvm2-activation-generator.8:
Generator Specification -> Generators Specification
(this is the exact word in the systemd man page)
conf/example.conf.in:
cleanup recent edits related to report section
man/lvm.conf.5:
add a line about a possibility to generate a new
profile with lvm dumpconfig command as an alternative
to copying the default profile
---
conf/example.conf.in | 6 +++---
man/lvm.conf.5.in | 18 ++++++++++++------
man/lvm2-activation-generator.8.in | 2 +-
3 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/conf/example.conf.in b/conf/example.conf.in
index 46ae461..f54ab8d 100644
--- a/conf/example.conf.in
+++ b/conf/example.conf.in
@@ -978,15 +978,15 @@ activation {
polling_interval = 15
}
-# Reporting settings.
+# Report settings.
#
# report {
# Align columns on report output.
# aligned=1
# When buffered reporting is used, the report's content is appended
- # incrementally for each object being reported until the report is
- # flushed to output which normally happens at the end of command
+ # incrementally to include each object being reported until the report
+ # is flushed to output which normally happens at the end of command
# execution. Otherwise, if buffering is not used, each object is
# reported as soon as its processing is finished.
# buffered=1
diff --git a/man/lvm.conf.5.in b/man/lvm.conf.5.in
index 73fcf47..099c5a7 100644
--- a/man/lvm.conf.5.in
+++ b/man/lvm.conf.5.in
@@ -23,12 +23,18 @@ See \fBtags\fP configuration setting description below.
A profile is a set of selected customizable configuration settings
that are aimed to achieve a certain characteristics in various
environments or uses. Normally, the name of the profile should
-reflect that environment or use. LVM itself provides a few predefined
-configuration profiles. Users are allowed to add more profiles
-with different values if needed. For this purpose, there's the \fBdefault.profile\fP
-which contains all settings that are customizable by profiles
-and users are encouraged to copy this profile, then to change the values
-as needed and to remove the settings that are not customized by the new profile.
+reflect that environment or use.
+
+LVM itself provides a few predefined configuration profiles.
+Users are allowed to add more profiles with different values if needed.
+For this purpose, there's the \fBdefault.profile\fP which contains all
+settings that are customizable by profiles. Users are encouraged
+to copy this default profile and edit it as needed. Alternatively,
+the \fBlvm dumpconfig --file <ProfileName.profile> --type profilable <section>\fP
+can be used to generate a configuration with profilable settings for
+given section and save it to new ProfileName.profile (if the section
+is not specified, all profilable settings are reported).
+
The profiles are stored in #DEFAULT_PROFILE_DIR# directory by default.
This location can be changed using the \fBconfig/profile_dir\fP setting.
Each profile configuration is stored in \fBProfileName.profile\fP file
diff --git a/man/lvm2-activation-generator.8.in b/man/lvm2-activation-generator.8.in
index bd47397..180b8da 100644
--- a/man/lvm2-activation-generator.8.in
+++ b/man/lvm2-activation-generator.8.in
@@ -40,7 +40,7 @@ since such LVM volumes are activated automatically as soon as the Volume Group
is ready (all the Physical Volumes making up the Volume Group are present
in the system).
-The lvm2-activation-generator implements the \fBGenerator Specification\fP
+The lvm2-activation-generator implements the \fBGenerators Specification\fP
as referenced in \fBsystemd\fP(1).
.sp
.SH SEE ALSO
9 years, 8 months
master - tests: replace skip_if_mirror_recovery_broken
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=31b1d06dddbab1...
Commit: 31b1d06dddbab131f85909315dcd1e2d3d6c4562
Parent: 19fd6040c246b73dcdf8f522231e32e5889d4238
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Mar 17 16:32:42 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Mar 17 16:33:29 2014 +0100
tests: replace skip_if_mirror_recovery_broken
Use mirror_recovery_works instead with easier to follow logic.
---
test/lib/aux.sh | 7 ++++---
test/shell/lvconvert-repair-dmeventd.sh | 2 +-
test/shell/lvconvert-repair-transient-dmeventd.sh | 2 +-
test/shell/lvconvert-repair-transient.sh | 2 +-
4 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index 65eb1e7..63896d1 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -641,9 +641,10 @@ api() {
"$abs_top_builddir/test/api/wrapper" "$@" && rm -f debug.log
}
-skip_if_mirror_recovery_broken() {
- if test `uname -r` = 3.3.4-5.fc17.i686; then skip; fi
- if test `uname -r` = 3.3.4-5.fc17.x86_64; then skip; fi
+mirror_recovery_works() {
+ case $(uname -r) in
+ 3.3.4-5.fc17.i686|3.3.4-5.fc17.x86_64) return 1 ;;
+ esac
}
raid456_replace_works() {
diff --git a/test/shell/lvconvert-repair-dmeventd.sh b/test/shell/lvconvert-repair-dmeventd.sh
index a2d3ef8..472c812 100644
--- a/test/shell/lvconvert-repair-dmeventd.sh
+++ b/test/shell/lvconvert-repair-dmeventd.sh
@@ -12,7 +12,7 @@
. lib/test
which mkfs.ext2 || skip
-aux skip_if_mirror_recovery_broken
+aux mirror_recovery_works || skip
aux prepare_dmeventd
aux prepare_vg 5
diff --git a/test/shell/lvconvert-repair-transient-dmeventd.sh b/test/shell/lvconvert-repair-transient-dmeventd.sh
index 6bd1442..1cda215 100644
--- a/test/shell/lvconvert-repair-transient-dmeventd.sh
+++ b/test/shell/lvconvert-repair-transient-dmeventd.sh
@@ -11,7 +11,7 @@
. lib/test
-aux skip_if_mirror_recovery_broken
+aux mirror_recovery_works || skip
aux prepare_vg 5
aux prepare_dmeventd
diff --git a/test/shell/lvconvert-repair-transient.sh b/test/shell/lvconvert-repair-transient.sh
index 3baa293..3614a69 100644
--- a/test/shell/lvconvert-repair-transient.sh
+++ b/test/shell/lvconvert-repair-transient.sh
@@ -11,7 +11,7 @@
. lib/test
-aux skip_if_mirror_recovery_broken
+aux mirror_recovery_works || skip
aux prepare_vg 5
lvcreate -aey --type mirror -m 3 --ignoremonitoring -L 1 -n 4way $vg
9 years, 8 months
master - tests: quotes for LVM_TEST vars
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=19fd6040c246b7...
Commit: 19fd6040c246b73dcdf8f522231e32e5889d4238
Parent: e3d208f7c2aa3964ae76a7fc108bf63957ef4bd6
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Mar 17 16:32:29 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Mar 17 16:32:29 2014 +0100
tests: quotes for LVM_TEST vars
---
test/lib/aux.sh | 6 +++---
test/lib/utils.sh | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index 12e8e04..65eb1e7 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -180,7 +180,7 @@ teardown_devs() {
# NOTE: SCSI_DEBUG_DEV test must come before the LOOP test because
# prepare_scsi_debug_dev() also sets LOOP to short-circuit prepare_loop()
if test -f SCSI_DEBUG_DEV; then
- test ${LVM_TEST_PARALLEL:-0} -eq 1 || modprobe -r scsi_debug
+ test "${LVM_TEST_PARALLEL:-0}" -eq 1 || modprobe -r scsi_debug
else
test ! -f LOOP || losetup -d $(cat LOOP) || true
test ! -f LOOPFILE || rm -f $(cat LOOPFILE)
@@ -189,7 +189,7 @@ teardown_devs() {
rm -f LOOP
# Attempt to remove any loop devices that failed to get torn down if earlier tests aborted
- test ${LVM_TEST_PARALLEL:-0} -eq 1 -o -z "$COMMON_PREFIX" || {
+ test "${LVM_TEST_PARALLEL:-0}" -eq 1 -o -z "$COMMON_PREFIX" || {
teardown_devs_prefixed "$COMMON_PREFIX" 1
local stray_loops=( $(losetup -a | grep "$COMMON_PREFIX" | cut -d: -f1) )
test ${#stray_loops[@]} -eq 0 || {
@@ -239,7 +239,7 @@ teardown() {
echo "ok"
- test ${LVM_TEST_PARALLEL:-0} -eq 1 -o -n "$RUNNING_DMEVENTD" || not pgrep dmeventd #&>/dev/null
+ test "${LVM_TEST_PARALLEL:-0}" -eq 1 -o -n "$RUNNING_DMEVENTD" || not pgrep dmeventd #&>/dev/null
}
prepare_loop() {
diff --git a/test/lib/utils.sh b/test/lib/utils.sh
index 819a0eb..b2e82aa 100644
--- a/test/lib/utils.sh
+++ b/test/lib/utils.sh
@@ -110,7 +110,7 @@ STACKTRACE() {
i=$(($i + 1))
done
- test ${LVM_TEST_PARALLEL:-0} -eq 1 -o -n "$RUNNING_DMEVENTD" -o -f LOCAL_DMEVENTD || {
+ test "${LVM_TEST_PARALLEL:-0}" -eq 1 -o -n "$RUNNING_DMEVENTD" -o -f LOCAL_DMEVENTD || {
pgrep dmeventd &>/dev/null && \
die "** During test dmeventd has been started!"
}
9 years, 8 months
master - tests: put vars in quotes
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=e3d208f7c2aa39...
Commit: e3d208f7c2aa3964ae76a7fc108bf63957ef4bd6
Parent: c1ce2cc86cb1a9bba16b62119829e1e1ddc0ff87
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Mar 17 16:30:52 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Mar 17 16:30:52 2014 +0100
tests: put vars in quotes
This shell var has space in middle
---
test/shell/snapshot-usage.sh | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/shell/snapshot-usage.sh b/test/shell/snapshot-usage.sh
index a50eeb2..095fddb 100644
--- a/test/shell/snapshot-usage.sh
+++ b/test/shell/snapshot-usage.sh
@@ -80,12 +80,12 @@ vgcreate -s 1K $vg1 "$DM_DEV_DIR/$vg/$lv"
lvcreate -V50 -L10 -n $lv1 -s $vg1
CHECK_ACTIVE="active"
test ! -e LOCAL_CLVMD || CHECK_ACTIVE="local exclusive"
-check lv_field $vg1/$lv1 lv_active ${CHECK_ACTIVE}
+check lv_field $vg1/$lv1 lv_active "$CHECK_ACTIVE"
lvchange -an $vg1
# On cluster snapshot gets exclusive activation
lvchange -ay $vg1
-check lv_field $vg1/$lv1 lv_active ${CHECK_ACTIVE}
+check lv_field $vg1/$lv1 lv_active "$CHECK_ACTIVE"
# Test removal of opened (bug unmounted) snapshot (device busy) for a while
sleep 120 < "$DM_DEV_DIR/$vg1/$lv1" &
9 years, 8 months
master - config: make global/units and global/si_unit_consistency profilable
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c1ce2cc86cb1a9...
Commit: c1ce2cc86cb1a9bba16b62119829e1e1ddc0ff87
Parent: a2c544dc91d8712b49c44aeea2241b37044eedac
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Mon Mar 17 16:03:53 2014 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Mon Mar 17 16:07:29 2014 +0100
config: make global/units and global/si_unit_consistency profilable
---
WHATS_NEW | 3 ++-
conf/default.profile.in | 5 +++++
lib/commands/toolcontext.c | 25 ++++++++++++++++---------
lib/commands/toolcontext.h | 1 +
lib/config/config_settings.h | 6 +++---
tools/lvmcmdline.c | 2 ++
6 files changed, 29 insertions(+), 13 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 06b8033..f104a0c 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,8 +1,9 @@
Version 2.02.106 -
====================================
+ Make global/units and global/si_unit_consistency lvm.conf setting profilable.
Validate minimal chunk size for snapshot COW volume in lvconvert.
Disallow lvconvert of origin to snapshot COW volume.
- Make report settings profilable.
+ Make report lvm.conf settings profilable.
Add existing report settings to lvm.conf.
Use VG read lock during 'pvscan --cache -aay' autoactivation.
Issue a VG refresh before autoactivation only if the PV has changed/is new.
diff --git a/conf/default.profile.in b/conf/default.profile.in
index 0499aef..2bf2143 100644
--- a/conf/default.profile.in
+++ b/conf/default.profile.in
@@ -20,6 +20,11 @@ activation {
thin_pool_autoextend_percent = 20
}
+global {
+ units="h"
+ si_unit_consistency=1
+}
+
report {
aligned=1
buffered=1
diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c
index 7282592..c616558 100644
--- a/lib/commands/toolcontext.c
+++ b/lib/commands/toolcontext.c
@@ -279,6 +279,19 @@ static int _check_config(struct cmd_context *cmd)
return 1;
}
+int process_profilable_config(struct cmd_context *cmd) {
+ if (!(cmd->default_settings.unit_factor =
+ units_to_bytes(find_config_tree_str(cmd, global_units_CFG, NULL),
+ &cmd->default_settings.unit_type))) {
+ log_error("Invalid units specification");
+ return 0;
+ }
+
+ cmd->si_unit_consistency = find_config_tree_bool(cmd, global_si_unit_consistency_CFG, NULL);
+
+ return 1;
+}
+
static int _process_config(struct cmd_context *cmd)
{
mode_t old_umask;
@@ -339,13 +352,6 @@ static int _process_config(struct cmd_context *cmd)
cmd->default_settings.suffix = find_config_tree_bool(cmd, global_suffix_CFG, NULL);
- if (!(cmd->default_settings.unit_factor =
- units_to_bytes(find_config_tree_str(cmd, global_units_CFG, NULL),
- &cmd->default_settings.unit_type))) {
- log_error("Invalid units specification");
- return 0;
- }
-
read_ahead = find_config_tree_str(cmd, activation_readahead_CFG, NULL);
if (!strcasecmp(read_ahead, "auto"))
cmd->default_settings.read_ahead = DM_READ_AHEAD_AUTO;
@@ -407,8 +413,6 @@ static int _process_config(struct cmd_context *cmd)
}
}
- cmd->si_unit_consistency = find_config_tree_bool(cmd, global_si_unit_consistency_CFG, NULL);
-
if ((cn = find_config_tree_node(cmd, activation_mlock_filter_CFG, NULL)))
for (cv = cn->v; cv; cv = cv->next)
if ((cv->type != DM_CFG_STRING) || !cv->v.str[0])
@@ -425,6 +429,9 @@ static int _process_config(struct cmd_context *cmd)
/* LVM stores sizes internally in units of 512-byte sectors. */
init_pv_min_size((uint64_t)pv_min_kb * (1024 >> SECTOR_SHIFT));
+ if (!process_profilable_config(cmd))
+ return_0;
+
init_detect_internal_vg_cache_corruption
(find_config_tree_bool(cmd, global_detect_internal_vg_cache_corruption_CFG, NULL));
diff --git a/lib/commands/toolcontext.h b/lib/commands/toolcontext.h
index 7a50e1e..0cd9a2f 100644
--- a/lib/commands/toolcontext.h
+++ b/lib/commands/toolcontext.h
@@ -138,6 +138,7 @@ struct cmd_context *create_toolcontext(unsigned is_long_lived,
void destroy_toolcontext(struct cmd_context *cmd);
int refresh_toolcontext(struct cmd_context *cmd);
int refresh_filters(struct cmd_context *cmd);
+int process_profilable_config(struct cmd_context *cmd);
int config_files_changed(struct cmd_context *cmd);
int init_lvmcache_orphans(struct cmd_context *cmd);
diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h
index de6ca1b..77acb45 100644
--- a/lib/config/config_settings.h
+++ b/lib/config/config_settings.h
@@ -74,7 +74,7 @@ cfg_section(allocation_CFG_SECTION, "allocation", root_CFG_SECTION, CFG_PROFILAB
cfg_section(log_CFG_SECTION, "log", root_CFG_SECTION, 0, vsn(1, 0, 0), NULL)
cfg_section(backup_CFG_SECTION, "backup", root_CFG_SECTION, 0, vsn(1, 0, 0), NULL)
cfg_section(shell_CFG_SECTION, "shell", root_CFG_SECTION, 0, vsn(1, 0, 0), NULL)
-cfg_section(global_CFG_SECTION, "global", root_CFG_SECTION, 0, vsn(1, 0, 0), NULL)
+cfg_section(global_CFG_SECTION, "global", root_CFG_SECTION, CFG_PROFILABLE, vsn(1, 0, 0), NULL)
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(report_CFG_SECTION, "report", root_CFG_SECTION, CFG_ADVANCED | CFG_PROFILABLE, vsn(1, 0, 0), NULL)
@@ -150,8 +150,8 @@ cfg(shell_history_size_CFG, "history_size", shell_CFG_SECTION, 0, CFG_TYPE_INT,
cfg(global_umask_CFG, "umask", global_CFG_SECTION, 0, CFG_TYPE_INT, DEFAULT_UMASK, vsn(1, 0, 0), NULL)
cfg(global_test_CFG, "test", global_CFG_SECTION, 0, CFG_TYPE_BOOL, 0, vsn(1, 0, 0), NULL)
-cfg(global_units_CFG, "units", global_CFG_SECTION, 0, CFG_TYPE_STRING, DEFAULT_UNITS, vsn(1, 0, 0), NULL)
-cfg(global_si_unit_consistency_CFG, "si_unit_consistency", global_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_SI_UNIT_CONSISTENCY, vsn(2, 2, 54), NULL)
+cfg(global_units_CFG, "units", global_CFG_SECTION, CFG_PROFILABLE, CFG_TYPE_STRING, DEFAULT_UNITS, vsn(1, 0, 0), NULL)
+cfg(global_si_unit_consistency_CFG, "si_unit_consistency", global_CFG_SECTION, CFG_PROFILABLE, CFG_TYPE_BOOL, DEFAULT_SI_UNIT_CONSISTENCY, vsn(2, 2, 54), NULL)
cfg(global_activation_CFG, "activation", global_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_ACTIVATION, vsn(1, 0, 0), NULL)
cfg(global_suffix_CFG, "suffix", global_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_SUFFIX, vsn(1, 0, 0), NULL)
cfg(global_fallback_to_lvm1_CFG, "fallback_to_lvm1", global_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_FALLBACK_TO_LVM1, vsn(1, 0, 18), NULL)
diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
index 6fe4670..454bee8 100644
--- a/tools/lvmcmdline.c
+++ b/tools/lvmcmdline.c
@@ -1137,6 +1137,8 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv)
log_error("Failed to apply configuration profile.");
return ECMD_FAILED;
}
+ if (!process_profilable_config(cmd))
+ return_ECMD_FAILED;
}
if ((ret = _get_settings(cmd)))
9 years, 8 months
master - tests: make test usable in cluster
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a2c544dc91d871...
Commit: a2c544dc91d8712b49c44aeea2241b37044eedac
Parent: ae2d80dd7e3379e62be610e56114ebba02a0eac2
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Mar 17 15:18:20 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Mar 17 15:18:20 2014 +0100
tests: make test usable in cluster
Origin needs exclusive activation
---
test/shell/lvconvert-snapshot.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/test/shell/lvconvert-snapshot.sh b/test/shell/lvconvert-snapshot.sh
index 4a650d2..e38d69b 100644
--- a/test/shell/lvconvert-snapshot.sh
+++ b/test/shell/lvconvert-snapshot.sh
@@ -20,7 +20,7 @@ vgcreate -s 1k $vg $(cat DEVICES)
lvcreate -V50 -L1 -n $lv1 -s $vg
-lvcreate -L1 -n $lv2 $vg
+lvcreate -aey -L1 -n $lv2 $vg
lvcreate -L1 -s -n $lv3 $vg/$lv2
lvcreate -l1 -n $lv4 $vg
9 years, 8 months
master - tests: update error message check
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=ae2d80dd7e3379...
Commit: ae2d80dd7e3379e62be610e56114ebba02a0eac2
Parent: e398901ed1d77684155a52c464f6265f68a96562
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Mar 17 15:18:02 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Mar 17 15:18:02 2014 +0100
tests: update error message check
---
test/shell/lvcreate-small-snap.sh | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/test/shell/lvcreate-small-snap.sh b/test/shell/lvcreate-small-snap.sh
index e0e6d1a..33532db 100644
--- a/test/shell/lvcreate-small-snap.sh
+++ b/test/shell/lvcreate-small-snap.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright (C) 2010-2013 Red Hat, Inc. All rights reserved.
+# Copyright (C) 2010-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
@@ -24,8 +24,8 @@ lvcreate -s -c 8k -l 24 -n snapX2 $vg/one
# Check that snapshots that are too small are caught with correct error.
not lvcreate -s -c 8k -l 8 -n snapX3 $vg/one 2>&1 | tee lvcreate.out
not grep "suspend origin one" lvcreate.out
-grep "Unable to create a snapshot" lvcreate.out
+grep "smaller" lvcreate.out
not lvcreate -s -l 4 -n snapB $vg/one 2>&1 | tee lvcreate.out
not grep "suspend origin one" lvcreate.out
-grep "Unable to create a snapshot" lvcreate.out
+grep "smaller" lvcreate.out
9 years, 8 months
master - tests: zero and error type tests
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=e398901ed1d776...
Commit: e398901ed1d77684155a52c464f6265f68a96562
Parent: fe8603dd609cb99f6a86b0345b6d0733aa1b5d1d
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Mar 17 13:16:17 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Mar 17 14:31:45 2014 +0100
tests: zero and error type tests
---
test/shell/error-usage.sh | 33 +++++++++++++++++++++++++++++++++
test/shell/zero-usage.sh | 34 ++++++++++++++++++++++++++++++++++
2 files changed, 67 insertions(+), 0 deletions(-)
diff --git a/test/shell/error-usage.sh b/test/shell/error-usage.sh
new file mode 100644
index 0000000..a7e3593
--- /dev/null
+++ b/test/shell/error-usage.sh
@@ -0,0 +1,33 @@
+#!/bin/bash
+# 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
+
+# Basic usage of zero target
+
+. lib/test
+
+which md5sum || skip
+
+aux prepare_pvs 1
+
+vgcreate -s 256k $vg $(cat DEVICES)
+
+lvcreate --type error -L1 -n $lv1 $vg
+lvextend -L+1 $vg/$lv1
+
+# has to match
+
+check lv_field $vg/$lv1 lv_modules "error"
+check lv_field $vg/$lv1 segtype "error"
+check lv_field $vg/$lv1 seg_count "1"
+check lv_field $vg/$lv1 seg_size_pe "8" # 8 * 256
+
+# FIXME should we print info we are ignoring stripping?
+lvextend -L+1 -I64 -i2 $vg/$lv1
diff --git a/test/shell/zero-usage.sh b/test/shell/zero-usage.sh
new file mode 100644
index 0000000..b140558
--- /dev/null
+++ b/test/shell/zero-usage.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+# 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
+
+# Basic usage of zero target
+
+. lib/test
+
+which md5sum || skip
+
+aux prepare_pvs 1
+
+vgcreate -s 256k $vg $(cat DEVICES)
+
+lvcreate --type zero -L1 -n $lv1 $vg
+lvextend -L+1 $vg/$lv1
+
+sum1=$(dd if=/dev/zero bs=2M count=1 | md5sum | cut -f1 -d' ')
+sum2=$(dd if="$DM_DEV_DIR/$vg/$lv1" bs=2M count=1 | md5sum | cut -f1 -d' ')
+
+# has to match
+test "$sum1" = "$sum2"
+
+check lv_field $vg/$lv1 lv_modules "zero"
+check lv_field $vg/$lv1 segtype "zero"
+check lv_field $vg/$lv1 seg_count "1"
+check lv_field $vg/$lv1 seg_size_pe "8" # 8 * 256
9 years, 8 months
master - tests: lvconvert snapshot testing
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=fe8603dd609cb9...
Commit: fe8603dd609cb99f6a86b0345b6d0733aa1b5d1d
Parent: 27d556de9e895291f7c57b956cdb0036ff5d6e51
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Mar 17 13:15:03 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Mar 17 14:31:45 2014 +0100
tests: lvconvert snapshot testing
---
test/shell/lvconvert-snapshot.sh | 57 ++++++++++++++++++++++++++++++++++++++
1 files changed, 57 insertions(+), 0 deletions(-)
diff --git a/test/shell/lvconvert-snapshot.sh b/test/shell/lvconvert-snapshot.sh
new file mode 100644
index 0000000..4a650d2
--- /dev/null
+++ b/test/shell/lvconvert-snapshot.sh
@@ -0,0 +1,57 @@
+#!/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 various supported conversion of snapshot
+
+. lib/test
+
+aux prepare_pvs 1
+
+vgcreate -s 1k $vg $(cat DEVICES)
+
+lvcreate -V50 -L1 -n $lv1 -s $vg
+
+lvcreate -L1 -n $lv2 $vg
+lvcreate -L1 -s -n $lv3 $vg/$lv2
+
+lvcreate -l1 -n $lv4 $vg
+lvcreate -L1 -n $lv5 $vg
+
+not lvconvert -s $vg/$lv1 $vg/not_exist
+
+# Can't convert to snapshot of origin
+not lvconvert -s $vg/$lv1 $vg/$lv2
+not lvconvert -s $vg/$lv2 $vg/$lv1
+not lvconvert -s $vg/$lv5 $vg/$lv1
+
+not lvconvert -s $vg/$lv5 $vg/$lv2
+not lvconvert -s $vg/$lv5 $vg/$lv3
+
+# Can't be itself
+not lvconvert -s $vg/$lv1 $vg/$lv1
+not lvconvert -s $vg/$lv2 $vg/$lv2
+
+# Can't convert snapshot to snapshot
+not lvconvert -s $vg/$lv1 $vg/$lv3
+not lvconvert -s $vg/$lv2 $vg/$lv3
+
+# Can't make a real LV snapshot of virtual 'zero' snapshot
+not lvconvert -s $vg/$lv1 $vg/$lv4
+
+# Check minimum size
+not lvconvert -s $vg/$lv2 $vg/$lv4 2>&1 | tee err
+grep "smaller" err
+
+# This should pass
+lvconvert -s $vg/$lv2 $vg/$lv5
+
+vgremove -f $vg
9 years, 8 months