summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarian Csontos <mcsontos@redhat.com>2015-06-24 16:13:06 +0200
committerMarian Csontos <mcsontos@redhat.com>2015-06-24 16:13:06 +0200
commit0d2ae29a71b9ed8c40f736fe7517837309a03618 (patch)
tree3fb6aedd3bd820f94f12fdfc5fa469866d907763
parent71ccefe0123023c8ffb7d28020902e1777a862de (diff)
parent44c7bc0262b6719efe75ecb6eb32eaab359e5779 (diff)
downloadlvm2-dev-mcsontos-lvmlockd-test.tar.gz
Merge remote-tracking branch 'origin/master' into dev-dct-lvmlockd-testdev-mcsontos-lvmlockd-test
* origin/master: tests: workaround udev problem snapshot: add synchronization point commands: --withspaces also for config and lvmconfig cmd aliases make: use lvmconfig ... --withspaces when generating lvm.conf and lvmlocal.conf lvmconfig: add --withspaces option WHATS_NEW: recent commits - config value format flags config: regenerate configure.in to accomodate all recent changes config: devices/filter and devices/global_filter setting have 'a/.*/' as default value config: allow empty values for {thin,cache}_{check,repair}_options configure: add DEFAULT_USE_BLKID_WIPING config: display global/umask in octal form config: use proper unconfigured default values for use_lvmetad and use_lvmpolld settings config: cleanup default values for some configuration settings with array values config: add support for config value formatting flags
-rw-r--r--WHATS_NEW2
-rw-r--r--WHATS_NEW_DM3
-rw-r--r--conf/Makefile.in4
-rw-r--r--conf/example.conf.in78
-rw-r--r--conf/lvmlocal.conf.in5
-rwxr-xr-xconfigure12
-rw-r--r--configure.in9
-rw-r--r--lib/config/config.c34
-rw-r--r--lib/config/config.h3
-rw-r--r--lib/config/config_settings.h33
-rw-r--r--lib/config/defaults.h5
-rw-r--r--lib/metadata/lv_manip.c3
-rw-r--r--lib/misc/configure.h.in3
-rw-r--r--libdm/.exported_symbols.DM_1_02_1002
-rw-r--r--libdm/libdevmapper.h19
-rw-r--r--libdm/libdm-config.c48
-rw-r--r--man/lvmconfig.8.in5
-rw-r--r--test/shell/profiles-thin.sh5
-rw-r--r--tools/args.h1
-rw-r--r--tools/commands.h9
-rw-r--r--tools/dumpconfig.c3
21 files changed, 210 insertions, 76 deletions
diff --git a/WHATS_NEW b/WHATS_NEW
index 7da2b51b5..34f4cf0c7 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,7 @@
Version 2.02.123 -
=================================
+ Add device synchronization point before activating a new snapshot.
+ Add --withspaces to lvmconfig to add spaces in output for better readability.
Version 2.02.122 - 20th June 2015
=================================
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index d4b16396a..ce10238fe 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,8 @@
Version 1.02.100 -
================================
+ Add DM_CONFIG_VALUE_FMT_{INT_OCTAL,STRING_NO_QUOTES} config value format flag.
+ Add DM_CONFIG_VALUE_FMT_COMMON_{ARRAY,EXTRA_SPACE} config value format flag.
+ Add dm_config_value_{get,set}_format_flags to get and set config value format.
Version 1.02.99 - 20th June 2015
================================
diff --git a/conf/Makefile.in b/conf/Makefile.in
index c98be881f..43d5f75ee 100644
--- a/conf/Makefile.in
+++ b/conf/Makefile.in
@@ -27,8 +27,8 @@ include $(top_builddir)/make.tmpl
.PHONY: install_conf install_localconf install_profiles
generate:
- (cat $(top_srcdir)/conf/example.conf.base && LD_LIBRARY_PATH=$(top_builddir)/libdm:$(LD_LIBRARY_PATH) $(top_builddir)/tools/lvm dumpconfig --type default --unconfigured --withcomments --ignorelocal) > example.conf.in
- (cat $(top_srcdir)/conf/lvmlocal.conf.base && LD_LIBRARY_PATH=$(top_builddir)/libdm:$(LD_LIBRARY_PATH) $(top_builddir)/tools/lvm dumpconfig --type default --unconfigured --withcomments local) > lvmlocal.conf.in
+ (cat $(top_srcdir)/conf/example.conf.base && LD_LIBRARY_PATH=$(top_builddir)/libdm:$(LD_LIBRARY_PATH) $(top_builddir)/tools/lvm dumpconfig --type default --unconfigured --withcomments --ignorelocal --withspaces) > example.conf.in
+ (cat $(top_srcdir)/conf/lvmlocal.conf.base && LD_LIBRARY_PATH=$(top_builddir)/libdm:$(LD_LIBRARY_PATH) $(top_builddir)/tools/lvm dumpconfig --type default --unconfigured --withcomments --withspaces local) > lvmlocal.conf.in
install_conf: $(CONFSRC)
@if [ ! -e $(confdir)/$(CONFDEST) ]; then \
diff --git a/conf/example.conf.in b/conf/example.conf.in
index e80948865..41d219a0f 100644
--- a/conf/example.conf.in
+++ b/conf/example.conf.in
@@ -4,6 +4,17 @@
#
# Refer to 'man lvm.conf' for further information including the file layout.
#
+# Refer to 'man lvm.conf' for information about how settings configured in
+# this file are combined with built-in values and command line options to
+# arrive at the final values used by LVM.
+#
+# Refer to 'man lvmconfig' for information about displaying the built-in
+# and configured values used by LVM.
+#
+# If a default value is set in this file (not commented out), then a
+# new version of LVM using this file will continue using that value,
+# even if the new version of LVM changes the built-in default value.
+#
# To put this file in a different directory and override @DEFAULT_SYS_DIR@ set
# the environment variable LVM_SYSTEM_DIR before running the tools.
#
@@ -92,7 +103,7 @@ devices {
# Example:
# preferred_names = [ "^/dev/mpath/", "^/dev/mapper/mpath", "^/dev/[hs]d" ]
# This configuration option does not have a default value defined.
- # preferred_names=[]
+ # preferred_names = [ ]
# Configuration option devices/filter.
# Limit the block devices that are used by LVM commands.
@@ -128,8 +139,7 @@ devices {
# Example:
# Use anchors to be very specific.
# filter = [ "a|^/dev/hda8$|", "r|.*/|" ]
- # This configuration option does not have a default value defined.
- # filter = []
+ # filter = [ "a|.*/|" ]
# Configuration option devices/global_filter.
# Limit the block devices that are used by LVM system components.
@@ -138,8 +148,7 @@ devices {
# and lvmetad. Use global_filter to hide devices from these LVM
# system components. The syntax is the same as devices/filter.
# Devices rejected by global_filter are not opened by LVM.
- # This configuration option does not have a default value defined.
- # global_filter = []
+ # global_filter = [ "a|.*/|" ]
# Configuration option devices/cache_dir.
# Directory in which to store the device cache file.
@@ -167,7 +176,7 @@ devices {
# types = [ "fd", 16 ]
# This configuration option is advanced.
# This configuration option does not have a default value defined.
- # types = []
+ # types = [ ]
# Configuration option devices/sysfs_scan.
# Restrict device scanning to block devices appearing in sysfs.
@@ -316,7 +325,7 @@ allocation {
# they are situated.
# cling_tag_list = [ "@site1", "@site2" ]
# This configuration option does not have a default value defined.
- # cling_tag_list = []
+ # cling_tag_list = [ ]
# Configuration option allocation/maximise_cling.
# Use a previous allocation algorithm.
@@ -336,7 +345,7 @@ allocation {
# MD device signatures, swap signature, and LUKS signatures.
# To see the list of signatures recognized by blkid, check the
# output of the 'blkid -k' command.
- use_blkid_wiping = 1
+ use_blkid_wiping = @DEFAULT_USE_BLKID_WIPING@
# Configuration option allocation/wipe_signatures_when_zeroing_new_lvs.
# Look for and erase any signatures while zeroing a new LV.
@@ -492,7 +501,7 @@ log {
# Configuration option log/activation.
# Log messages during activation.
# Don't use this in low memory situations (can deadlock).
- # activation = 0
+ activation = 0
# Configuration option log/debug_classes.
# Select log messages by class.
@@ -502,8 +511,7 @@ log {
# memory, devices, activation, allocation,
# lvmetad, metadata, cache, locking, lvmpolld.
# Use "all" to see everything.
- debug_classes = ["memory", "devices", "activation", "allocation",
- "lvmetad", "metadata", "cache", "locking", "lvmpolld"]
+ debug_classes = [ "memory", "devices", "activation", "allocation", "lvmetad", "metadata", "cache", "locking", "lvmpolld" ]
}
# Configuration section backup.
@@ -600,7 +608,7 @@ global {
# The LVM1 tools need to be installed with .lvm1 suffices,
# e.g. vgscan.lvm1. They will stop working once the lvm2
# on-disk metadata format is used.
- # fallback_to_lvm1 = 0
+ # fallback_to_lvm1 = 1
# Configuration option global/format.
# The default metadata format that commands should use.
@@ -613,11 +621,11 @@ global {
# If support for LVM1 metadata was compiled as a shared library use
# format_libraries = "liblvm2format1.so"
# This configuration option does not have a default value defined.
- # format_libraries = []
+ # format_libraries = [ ]
# Configuration option global/segment_libraries.
# This configuration option does not have a default value defined.
- # segment_libraries = []
+ # segment_libraries = [ ]
# Configuration option global/proc.
# Location of proc filesystem.
@@ -856,12 +864,12 @@ global {
# ignorable errors and fix them later.
# With thin_check version 3.2 or newer you should add
# --clear-needs-check-flag.
- # thin_check_options = ["-q", "--clear-needs-check-flag"]
+ # thin_check_options = [ "-q" ]
# Configuration option global/thin_repair_options.
# List of options passed to the thin_repair command.
# This configuration option does not have a default value defined.
- # thin_repair_options = ""
+ # thin_repair_options = [ ]
# Configuration option global/thin_disabled_features.
# Features to not use in the thin driver.
@@ -873,7 +881,7 @@ global {
# Example:
# thin_disabled_features = [ "discards", "block_size" ]
# This configuration option does not have a default value defined.
- # thin_disabled_features = []
+ # thin_disabled_features = [ ]
# Configuration option global/cache_check_executable.
# The full path to the cache_check command.
@@ -904,12 +912,12 @@ global {
# Configuration option global/cache_check_options.
# List of options passed to the cache_check command.
- # cache_check_options = "-q"
+ # cache_check_options = [ "-q" ]
# Configuration option global/cache_repair_options.
# List of options passed to the cache_repair command.
# This configuration option does not have a default value defined.
- # cache_repair_options = ""
+ # cache_repair_options = [ ]
# Configuration option global/system_id_source.
# The method LVM uses to set the local system ID.
@@ -925,12 +933,12 @@ global {
# 'local' section of an lvm configuration file, e.g. lvmlocal.conf.
# uname - Set the system ID from the hostname (uname) of the system.
# System IDs beginning localhost are not permitted.
- # machineid - Use the contents of the file @CONFDIR@/machine-id to set the
+ # machineid - Use the contents of the machine-id file to set the
# system ID. Some systems create this file at installation time.
- # See 'man machine-id'.
+ # See 'man machine-id' and global/etc.
# file - Use the contents of another file (system_id_file) to set
# the system ID.
- # system_id_source = "none"
+ system_id_source = "none"
# Configuration option global/system_id_file.
# The full path to the file containing a system ID.
@@ -939,15 +947,16 @@ global {
# This configuration option does not have a default value defined.
# system_id_file = ""
+ # Configuration option global/use_lvmpolld.
# Use lvmpolld to supervise long running LVM commands.
# When enabled, control of long running LVM commands is transferred
- # from the original LVM command to the lvmpolld daemon. This allows
+ # from the original LVM command to the lvmpolld daemon. This allows
# the operation to continue independent of the original LVM command.
# After lvmpolld takes over, the LVM command displays the progress
- # of the ongoing operation. lvmpolld itself runs LVM commands to manage
- # the progress of ongoing operations. lvmpolld can be used as a native
+ # of the ongoing operation. lvmpolld itself runs LVM commands to manage
+ # the progress of ongoing operations. lvmpolld can be used as a native
# systemd service, which allows it to be started on demand, and to use
- # its own control group. When this option is disabled, LVM commands will
+ # its own control group. When this option is disabled, LVM commands will
# supervise long running operations by forking themselves.
use_lvmpolld = @DEFAULT_USE_LVMPOLLD@
}
@@ -1048,7 +1057,7 @@ activation {
# Example:
# volume_list = [ "vg1", "vg2/lvol1", "@tag1", "@*" ]
# This configuration option does not have a default value defined.
- # volume_list = []
+ # volume_list = [ ]
# Configuration option activation/auto_activation_volume_list.
# Only LVs selected by this list are auto-activated.
@@ -1080,7 +1089,7 @@ activation {
# Possible options are: vgname, vgname/lvname, @tag, @*
# See volume_list for how these options are matched to LVs.
# This configuration option does not have a default value defined.
- # auto_activation_volume_list = []
+ # auto_activation_volume_list = [ ]
# Configuration option activation/read_only_volume_list.
# LVs in this list are activated in read-only mode.
@@ -1092,7 +1101,7 @@ activation {
# Possible options are: vgname, vgname/lvname, @tag, @*
# See volume_list for how these options are matched to LVs.
# This configuration option does not have a default value defined.
- # read_only_volume_list = []
+ # read_only_volume_list = [ ]
# Configuration option activation/raid_region_size.
# Size in KiB of each raid or mirror synchronization region.
@@ -1221,7 +1230,7 @@ activation {
# Auto-extending a thin pool adds this percent extra space.
# The amount of additional space added to a thin pool is this
# percent of its current size.
- thin_pool_autoextend_percent=20
+ thin_pool_autoextend_percent = 20
# Configuration option activation/mlock_filter.
# Do not mlock these memory areas.
@@ -1240,7 +1249,7 @@ activation {
# mlock_filter = [ "locale/locale-archive", "gconv/gconv-modules.cache" ]
# This configuration option is advanced.
# This configuration option does not have a default value defined.
- # mlock_filter = []
+ # mlock_filter = [ ]
# Configuration option activation/use_mlockall.
# Use the old behavior of mlockall to pin all memory.
@@ -1361,7 +1370,7 @@ activation {
# dirs = [ "/etc/lvm/metadata", "/mnt/disk2/lvm/metadata2" ]
# This configuration option is advanced.
# This configuration option does not have a default value defined.
- # dirs = []
+ # dirs = [ ]
# }
# Configuration section report.
@@ -1410,7 +1419,7 @@ activation {
# Configuration option report/colums_as_rows.
# Output each column as a row.
- # If set, this also implies report/prefixes = 1.
+ # If set, this also implies report/prefixes=1.
# colums_as_rows = 0
# Configuration option report/binary_values_as_numeric.
@@ -1572,7 +1581,6 @@ dmeventd {
# bar is given to the hosts named machine1 and machine2.
# tags { foo { } bar { host_list = [ "machine1", "machine2" ] } }
# This configuration section has variable name.
- # This configuration section does not have a default value defined.
# tag {
# Configuration option tags/<tag>/host_list.
@@ -1582,6 +1590,6 @@ dmeventd {
# matches an entry in this list, the name of the
# subsection is applied to the machine as a 'host tag'.
# This configuration option does not have a default value defined.
- # host_list = ""
+ # host_list = [ ]
# }
# }
diff --git a/conf/lvmlocal.conf.in b/conf/lvmlocal.conf.in
index e151b50e4..ec3b08162 100644
--- a/conf/lvmlocal.conf.in
+++ b/conf/lvmlocal.conf.in
@@ -36,8 +36,7 @@ local {
# Example:
# Set the system_id to the string 'host1'.
# system_id = "host1"
- # This configuration option does not have a default value defined.
- # system_id=""
+ # system_id = ""
# Configuration option local/extra_system_ids.
# A list of extra VG system IDs the local host can access.
@@ -49,5 +48,5 @@ local {
# Use this only after consulting 'man lvmsystemid'
# to be certain of correct usage and possible dangers.
# This configuration option does not have a default value defined.
- # extra_system_ids=[]
+ # extra_system_ids = [ ]
}
diff --git a/configure b/configure
index 534948fd0..13d10c4ed 100755
--- a/configure
+++ b/configure
@@ -695,6 +695,7 @@ DL_LIBS
DEVMAPPER
DEFAULT_USE_LVMPOLLD
DEFAULT_USE_LVMETAD
+DEFAULT_USE_BLKID_WIPING
DEFAULT_SYS_DIR
DEFAULT_SPARSE_SEGTYPE
DEFAULT_RUN_DIR
@@ -724,7 +725,6 @@ BUILD_LVMPOLLD
BUILD_LVMETAD
BUILD_DMEVENTD
BUILD_CMIRRORD
-BLKID_WIPING
BLKID_PC
APPLIB
MODPROBE_CMD
@@ -11052,12 +11052,22 @@ $as_echo "yes" >&6; }
fi
if test "$BLKID_WIPING" = yes; then
BLKID_PC="blkid"
+ DEFAULT_USE_BLKID_WIPING=1
$as_echo "#define BLKID_WIPING_SUPPORT 1" >>confdefs.h
+ else
+ DEFAULT_USE_BLKID_WIPING=1
fi
+else
+ DEFAULT_USE_BLKID_WIPING=0
fi
+cat >>confdefs.h <<_ACEOF
+#define DEFAULT_USE_BLKID_WIPING $DEFAULT_USE_BLKID_WIPING
+_ACEOF
+
+
################################################################################
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use udev-systemd protocol for jobs in background" >&5
$as_echo_n "checking whether to use udev-systemd protocol for jobs in background... " >&6; }
diff --git a/configure.in b/configure.in
index 965eaa632..0bd6828ed 100644
--- a/configure.in
+++ b/configure.in
@@ -1197,9 +1197,16 @@ if test "$BLKID_WIPING" != no; then
fi])
if test "$BLKID_WIPING" = yes; then
BLKID_PC="blkid"
+ DEFAULT_USE_BLKID_WIPING=1
AC_DEFINE([BLKID_WIPING_SUPPORT], 1, [Define to 1 to use libblkid detection of signatures when wiping.])
+ else
+ DEFAULT_USE_BLKID_WIPING=1
fi
+else
+ DEFAULT_USE_BLKID_WIPING=0
fi
+AC_DEFINE_UNQUOTED(DEFAULT_USE_BLKID_WIPING, [$DEFAULT_USE_BLKID_WIPING],
+ [Use blkid wiping by default.])
################################################################################
dnl -- Enable udev-systemd protocol to instantiate a service for background jobs
@@ -1787,7 +1794,6 @@ LVM_LIBAPI=`echo "$VER" | $AWK -F '[[()]]' '{print $2}'`
AC_SUBST(APPLIB)
AC_SUBST(AWK)
AC_SUBST(BLKID_PC)
-AC_SUBST(BLKID_WIPING)
AC_SUBST(BUILD_CMIRRORD)
AC_SUBST(BUILD_DMEVENTD)
AC_SUBST(BUILD_LVMETAD)
@@ -1829,6 +1835,7 @@ AC_SUBST(DEFAULT_RAID10_SEGTYPE)
AC_SUBST(DEFAULT_RUN_DIR)
AC_SUBST(DEFAULT_SPARSE_SEGTYPE)
AC_SUBST(DEFAULT_SYS_DIR)
+AC_SUBST(DEFAULT_USE_BLKID_WIPING)
AC_SUBST(DEFAULT_USE_LVMETAD)
AC_SUBST(DEFAULT_USE_LVMPOLLD)
AC_SUBST(DEFAULT_USE_LVMLOCKD)
diff --git a/lib/config/config.c b/lib/config/config.c
index 32b3c6611..22b8f09a2 100644
--- a/lib/config/config.c
+++ b/lib/config/config.c
@@ -667,7 +667,8 @@ static void _log_type_error(const char *path, cfg_def_type_t actual,
}
static struct dm_config_value *_get_def_array_values(struct dm_config_tree *cft,
- const cfg_def_item_t *def)
+ const cfg_def_item_t *def,
+ uint32_t format_flags)
{
char *enc_value, *token, *p, *r;
struct dm_config_value *array = NULL, *v = NULL, *oldv = NULL;
@@ -678,6 +679,7 @@ static struct dm_config_value *_get_def_array_values(struct dm_config_tree *cft,
return NULL;
}
array->type = DM_CFG_EMPTY_ARRAY;
+ dm_config_value_set_format_flags(array, format_flags);
return array;
}
@@ -710,6 +712,9 @@ static struct dm_config_value *_get_def_array_values(struct dm_config_tree *cft,
dm_free(enc_value);
return NULL;
}
+
+ dm_config_value_set_format_flags(v, format_flags);
+
if (oldv)
oldv->next = v;
if (!array)
@@ -839,7 +844,7 @@ static int _check_value_differs_from_default(struct cft_check_handle *handle,
}
if (!v_def && (def->type & CFG_TYPE_ARRAY)) {
- if (!(v_def_array = v_def_iter = _get_def_array_values(handle->cft, def)))
+ if (!(v_def_array = v_def_iter = _get_def_array_values(handle->cft, def, 0)))
return_0;
do {
/* iterate over each element of the array and check its value */
@@ -1739,15 +1744,20 @@ static struct dm_config_node *_add_def_node(struct dm_config_tree *cft,
{
struct dm_config_node *cn;
const char *str;
+ uint32_t format_flags = 0;
if (!(cn = dm_config_create_node(cft, def->name))) {
log_error("Failed to create default config setting node.");
return NULL;
}
- if (!(def->type & CFG_TYPE_SECTION) && (!(cn->v = dm_config_create_value(cft)))) {
- log_error("Failed to create default config setting node value.");
- return NULL;
+ if (!(def->type & CFG_TYPE_SECTION) && !(def->type & CFG_TYPE_ARRAY)) {
+ if (!(cn->v = dm_config_create_value(cft))) {
+ log_error("Failed to create default config setting node value.");
+ return NULL;
+ }
+ if (spec->withspaces)
+ format_flags |= DM_CONFIG_VALUE_FMT_COMMON_EXTRA_SPACES;
}
cn->id = def->id;
@@ -1755,6 +1765,9 @@ static struct dm_config_node *_add_def_node(struct dm_config_tree *cft,
if (spec->unconfigured && def->default_unconfigured_value.v_UNCONFIGURED) {
cn->v->type = DM_CFG_STRING;
cn->v->v.str = cfg_def_get_default_unconfigured_value_hint(spec->cmd, def);
+ if (def->type != CFG_TYPE_STRING)
+ format_flags |= DM_CONFIG_VALUE_FMT_STRING_NO_QUOTES;
+ dm_config_value_set_format_flags(cn->v, format_flags);
} else if (!(def->type & CFG_TYPE_ARRAY)) {
switch (def->type) {
case CFG_TYPE_SECTION:
@@ -1767,6 +1780,8 @@ static struct dm_config_node *_add_def_node(struct dm_config_tree *cft,
case CFG_TYPE_INT:
cn->v->type = DM_CFG_INT;
cn->v->v.i = cfg_def_get_default_value_hint(spec->cmd, def, CFG_TYPE_INT, NULL);
+ if (def->flags & CFG_FORMAT_INT_OCTAL)
+ format_flags |= DM_CONFIG_VALUE_FMT_INT_OCTAL;
break;
case CFG_TYPE_FLOAT:
cn->v->type = DM_CFG_FLOAT;
@@ -1783,8 +1798,13 @@ static struct dm_config_node *_add_def_node(struct dm_config_tree *cft,
return NULL;
break;
}
- } else
- cn->v = _get_def_array_values(cft, def);
+ dm_config_value_set_format_flags(cn->v, format_flags);
+ } else {
+ if (spec->withspaces)
+ format_flags |= DM_CONFIG_VALUE_FMT_COMMON_EXTRA_SPACES;
+ format_flags |= DM_CONFIG_VALUE_FMT_COMMON_ARRAY;
+ cn->v = _get_def_array_values(cft, def, format_flags);
+ }
cn->child = NULL;
if (parent) {
diff --git a/lib/config/config.h b/lib/config/config.h
index 0b7221cea..9601dc189 100644
--- a/lib/config/config.h
+++ b/lib/config/config.h
@@ -119,6 +119,8 @@ typedef union {
#define CFG_DEFAULT_RUN_TIME 0x100
/* whether the configuration setting is disabled (and hence defaults always used) */
#define CFG_DISABLED 0x200
+/* whether to print integers in octal form (prefixed by "0") */
+#define CFG_FORMAT_INT_OCTAL 0x400
/* configuration definition item structure */
typedef struct cfg_def_item {
@@ -161,6 +163,7 @@ struct config_def_tree_spec {
unsigned withsummary:1; /* include first line of comments - a summary */
unsigned withcomments:1; /* include all comment lines */
unsigned withversions:1; /* include versions */
+ unsigned withspaces:1; /* add more spaces in output for better readability */
unsigned unconfigured:1; /* use unconfigured path strings */
uint8_t *check_status; /* status of last tree check (currently needed for CFG_DEF_TREE_MISSING only) */
};
diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h
index b49c65a82..6c6a34fb5 100644
--- a/lib/config/config_settings.h
+++ b/lib/config/config_settings.h
@@ -50,6 +50,7 @@
* CFG_DEFAULT_UNDEFINED - node's default value is undefined (depends on other system/kernel values outside of lvm)
* CFG_DEFAULT_COMMENTED - node's default value is commented out on output
* CFG_DISABLED - configuration is disabled (defaults always used)
+ * CFG_FORMAT_INT_OCTAL - print integer number in octal form (also prefixed by "0")
*
* type: Allowed type for the value of simple configuation setting, one of:
* CFG_TYPE_BOOL
@@ -202,7 +203,7 @@ cfg(devices_external_device_info_source_CFG, "external_device_info_source", devi
"udev - Reuse existing udev database records. Applicable\n"
"only if LVM is compiled with udev support.\n")
-cfg_array(devices_preferred_names_CFG, "preferred_names", devices_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_COMMENTED , CFG_TYPE_STRING, "#S", vsn(1, 2, 19), NULL, 0, NULL,
+cfg_array(devices_preferred_names_CFG, "preferred_names", devices_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_UNDEFINED , CFG_TYPE_STRING, NULL, vsn(1, 2, 19), NULL, 0, NULL,
"Select which path name to display for a block device.\n"
"If multiple path names exist for a block device,\n"
"and LVM needs to display a name for the device,\n"
@@ -219,7 +220,7 @@ cfg_array(devices_preferred_names_CFG, "preferred_names", devices_CFG_SECTION, C
"Example:\n"
"preferred_names = [ \"^/dev/mpath/\", \"^/dev/mapper/mpath\", \"^/dev/[hs]d\" ]\n")
-cfg_array(devices_filter_CFG, "filter", devices_CFG_SECTION, CFG_DEFAULT_UNDEFINED, CFG_TYPE_STRING, NULL, vsn(1, 0, 0), NULL, 0, NULL,
+cfg_array(devices_filter_CFG, "filter", devices_CFG_SECTION, CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, "#Sa|.*/|", vsn(1, 0, 0), NULL, 0, NULL,
"Limit the block devices that are used by LVM commands.\n"
"This is a list of regular expressions used to accept or\n"
"reject block device path names. Each regex is delimited\n"
@@ -249,12 +250,12 @@ cfg_array(devices_filter_CFG, "filter", devices_CFG_SECTION, CFG_DEFAULT_UNDEFIN
"filter = [ \"a|loop|\", \"r|.*|\" ]\n"
"Example:\n"
"Accept all loop devices and ide drives except hdc.\n"
- "filter =[ \"a|loop|\", \"r|/dev/hdc|\", \"a|/dev/ide|\", \"r|.*|\" ]\n"
+ "filter = [ \"a|loop|\", \"r|/dev/hdc|\", \"a|/dev/ide|\", \"r|.*|\" ]\n"
"Example:\n"
"Use anchors to be very specific.\n"
"filter = [ \"a|^/dev/hda8$|\", \"r|.*/|\" ]\n")
-cfg_array(devices_global_filter_CFG, "global_filter", devices_CFG_SECTION, CFG_DEFAULT_UNDEFINED, CFG_TYPE_STRING, NULL, vsn(2, 2, 98), NULL, 0, NULL,
+cfg_array(devices_global_filter_CFG, "global_filter", devices_CFG_SECTION, CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, "#Sa|.*/|", vsn(2, 2, 98), NULL, 0, NULL,
"Limit the block devices that are used by LVM system components.\n"
"Because devices/filter may be overridden from the command line,\n"
"it is not suitable for system-wide device filtering, e.g. udev\n"
@@ -422,7 +423,7 @@ cfg(allocation_maximise_cling_CFG, "maximise_cling", allocation_CFG_SECTION, 0,
"the same disks. This setting can be used to disable the changes\n"
"and revert to the previous algorithm.\n")
-cfg(allocation_use_blkid_wiping_CFG, "use_blkid_wiping", allocation_CFG_SECTION, 0, CFG_TYPE_BOOL, 1, vsn(2, 2, 105), NULL, 0, NULL,
+cfg(allocation_use_blkid_wiping_CFG, "use_blkid_wiping", allocation_CFG_SECTION, 0, CFG_TYPE_BOOL, 1, vsn(2, 2, 105), "@DEFAULT_USE_BLKID_WIPING@", 0, NULL,
"Use blkid to detect existing signatures on new PVs and LVs.\n"
"The blkid library can detect more signatures than the\n"
"native LVM detection code, but may take longer.\n"
@@ -596,7 +597,7 @@ cfg(backup_retain_days_CFG, "retain_days", backup_CFG_SECTION, 0, CFG_TYPE_INT,
cfg(shell_history_size_CFG, "history_size", shell_CFG_SECTION, 0, CFG_TYPE_INT, DEFAULT_MAX_HISTORY, vsn(1, 0, 0), NULL, 0, NULL,
"Number of lines of history to store in ~/.lvm_history.\n")
-cfg(global_umask_CFG, "umask", global_CFG_SECTION, 0, CFG_TYPE_INT, DEFAULT_UMASK, vsn(1, 0, 0), NULL, 0, NULL,
+cfg(global_umask_CFG, "umask", global_CFG_SECTION, CFG_FORMAT_INT_OCTAL, CFG_TYPE_INT, DEFAULT_UMASK, vsn(1, 0, 0), NULL, 0, NULL,
"The file creation mask for any files and directories created.\n"
"Interpreted as octal if the first digit is zero.\n")
@@ -617,7 +618,7 @@ cfg(global_si_unit_consistency_CFG, "si_unit_consistency", global_CFG_SECTION, C
cfg(global_suffix_CFG, "suffix", global_CFG_SECTION, CFG_PROFILABLE, CFG_TYPE_BOOL, DEFAULT_SUFFIX, vsn(1, 0, 0), NULL, 0, NULL,
"Display unit suffix for sizes.\n"
"This setting has no effect if the units are in human-readable\n"
- "form (global/units=\"h\") in which case the suffix is always\n"
+ "form (global/units = \"h\") in which case the suffix is always\n"
"displayed.\n")
cfg(global_activation_CFG, "activation", global_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_ACTIVATION, vsn(1, 0, 0), NULL, 0, NULL,
@@ -796,7 +797,7 @@ cfg(global_lvdisplay_shows_full_device_path_CFG, "lvdisplay_shows_full_device_pa
"was never a valid path in the /dev filesystem.\n"
"Enable this option to reinstate the previous format.\n")
-cfg(global_use_lvmetad_CFG, "use_lvmetad", global_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_USE_LVMETAD, vsn(2, 2, 93), NULL, 0, NULL,
+cfg(global_use_lvmetad_CFG, "use_lvmetad", global_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_USE_LVMETAD, vsn(2, 2, 93), "@DEFAULT_USE_LVMETAD@", 0, NULL,
"Use lvmetad to cache metadata and reduce disk scanning.\n"
"When enabled (and running), lvmetad provides LVM commands\n"
"with VG metadata and PV state. LVM commands then avoid\n"
@@ -875,7 +876,7 @@ cfg(global_thin_repair_executable_CFG, "thin_repair_executable", global_CFG_SECT
"Also see thin_repair_options.\n"
"(For thin tools, see thin_check_executable.)\n")
-cfg_array(global_thin_check_options_CFG, "thin_check_options", global_CFG_SECTION, CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, "#S" DEFAULT_THIN_CHECK_OPTION1 "#S" DEFAULT_THIN_CHECK_OPTION2, vsn(2, 2, 96), NULL, 0, NULL,
+cfg_array(global_thin_check_options_CFG, "thin_check_options", global_CFG_SECTION, CFG_ALLOW_EMPTY | (DEFAULT_THIN_CHECK_OPTIONS_CONFIG ? CFG_DEFAULT_COMMENTED : CFG_DEFAULT_UNDEFINED), CFG_TYPE_STRING, DEFAULT_THIN_CHECK_OPTIONS_CONFIG, vsn(2, 2, 96), NULL, 0, NULL,
"List of options passed to the thin_check command.\n"
"With thin_check version 2.1 or newer you can add\n"
"--ignore-non-fatal-errors to let it pass through\n"
@@ -883,10 +884,10 @@ cfg_array(global_thin_check_options_CFG, "thin_check_options", global_CFG_SECTIO
"With thin_check version 3.2 or newer you should add\n"
"--clear-needs-check-flag.\n")
-cfg_array(global_thin_repair_options_CFG, "thin_repair_options", global_CFG_SECTION, CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, "#S" DEFAULT_THIN_REPAIR_OPTIONS, vsn(2, 2, 100), NULL, 0, NULL,
+cfg_array(global_thin_repair_options_CFG, "thin_repair_options", global_CFG_SECTION, CFG_ALLOW_EMPTY | (DEFAULT_THIN_REPAIR_OPTIONS_CONFIG ? CFG_DEFAULT_COMMENTED : CFG_DEFAULT_UNDEFINED), CFG_TYPE_STRING, DEFAULT_THIN_REPAIR_OPTIONS_CONFIG, vsn(2, 2, 100), NULL, 0, NULL,
"List of options passed to the thin_repair command.\n")
-cfg_array(global_thin_disabled_features_CFG, "thin_disabled_features", global_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, "#S", vsn(2, 2, 99), NULL, 0, NULL,
+cfg_array(global_thin_disabled_features_CFG, "thin_disabled_features", global_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_UNDEFINED, CFG_TYPE_STRING, NULL, vsn(2, 2, 99), NULL, 0, NULL,
"Features to not use in the thin driver.\n"
"This can be helpful for testing, or to avoid\n"
"using a feature that is causing problems.\n"
@@ -920,10 +921,10 @@ cfg(global_cache_repair_executable_CFG, "cache_repair_executable", global_CFG_SE
"Also see cache_repair_options.\n"
"(For cache tools, see cache_check_executable.)\n")
-cfg_array(global_cache_check_options_CFG, "cache_check_options", global_CFG_SECTION, CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, "#S" DEFAULT_CACHE_CHECK_OPTION1, vsn(2, 2, 108), NULL, 0, NULL,
+cfg_array(global_cache_check_options_CFG, "cache_check_options", global_CFG_SECTION, CFG_ALLOW_EMPTY | (DEFAULT_CACHE_CHECK_OPTIONS_CONFIG ? CFG_DEFAULT_COMMENTED : CFG_DEFAULT_UNDEFINED), CFG_TYPE_STRING, DEFAULT_CACHE_CHECK_OPTIONS_CONFIG, vsn(2, 2, 108), NULL, 0, NULL,
"List of options passed to the cache_check command.\n")
-cfg_array(global_cache_repair_options_CFG, "cache_repair_options", global_CFG_SECTION, CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, "#S" DEFAULT_CACHE_REPAIR_OPTIONS, vsn(2, 2, 108), NULL, 0, NULL,
+cfg_array(global_cache_repair_options_CFG, "cache_repair_options", global_CFG_SECTION, CFG_ALLOW_EMPTY | (DEFAULT_CACHE_REPAIR_OPTIONS_CONFIG ? CFG_DEFAULT_COMMENTED : CFG_DEFAULT_UNDEFINED), CFG_TYPE_STRING, DEFAULT_CACHE_REPAIR_OPTIONS_CONFIG, vsn(2, 2, 108), NULL, 0, NULL,
"List of options passed to the cache_repair command.\n")
cfg(global_system_id_source_CFG, "system_id_source", global_CFG_SECTION, 0, CFG_TYPE_STRING, DEFAULT_SYSTEM_ID_SOURCE, vsn(2, 2, 117), NULL, 0, NULL,
@@ -957,7 +958,7 @@ cfg(activation_checks_CFG, "checks", activation_CFG_SECTION, 0, CFG_TYPE_BOOL, D
"Some of the checks may be expensive, so it's best to use\n"
"this only when there seems to be a problem.\n")
-cfg(global_use_lvmpolld_CFG, "use_lvmpolld", global_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_USE_LVMPOLLD, vsn(2, 2, 120), NULL, 0, NULL,
+cfg(global_use_lvmpolld_CFG, "use_lvmpolld", global_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_USE_LVMPOLLD, vsn(2, 2, 120), "@DEFAULT_USE_LVMPOLLD@", 0, NULL,
"Use lvmpolld to supervise long running LVM commands.\n"
"When enabled, control of long running LVM commands is transferred\n"
"from the original LVM command to the lvmpolld daemon. This allows\n"
@@ -1226,7 +1227,7 @@ cfg_array(activation_mlock_filter_CFG, "mlock_filter", activation_CFG_SECTION, C
"locale-archive was found to make up over 80% of the memory\n"
"used by the process.\n"
"Example:\n"
- "mlock_filter=[ \"locale/locale-archive\", \"gconv/gconv-modules.cache\" ]\n")
+ "mlock_filter = [ \"locale/locale-archive\", \"gconv/gconv-modules.cache\" ]\n")
cfg(activation_use_mlockall_CFG, "use_mlockall", activation_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_USE_MLOCKALL, vsn(2, 2, 62), NULL, 0, NULL,
"Use the old behavior of mlockall to pin all memory.\n"
@@ -1525,7 +1526,7 @@ cfg(local_system_id_CFG, "system_id", local_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_D
"Set the system_id to the string 'host1'.\n"
"system_id = \"host1\"\n")
-cfg_array(local_extra_system_ids_CFG, "extra_system_ids", local_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_COMMENTED, CFG_TYPE_STRING, "#S", vsn(2, 2, 117), NULL, 0, NULL,
+cfg_array(local_extra_system_ids_CFG, "extra_system_ids", local_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_UNDEFINED, CFG_TYPE_STRING, NULL, vsn(2, 2, 117), NULL, 0, NULL,
"A list of extra VG system IDs the local host can access.\n"
"VGs with the system IDs listed here (in addition\n"
"to the host's own system ID) can be fully accessed\n"
diff --git a/lib/config/defaults.h b/lib/config/defaults.h
index 4dd9bef88..e581ca981 100644
--- a/lib/config/defaults.h
+++ b/lib/config/defaults.h
@@ -81,12 +81,15 @@
#ifdef THIN_CHECK_NEEDS_CHECK
# define DEFAULT_THIN_CHECK_OPTION1 "-q"
# define DEFAULT_THIN_CHECK_OPTION2 "--clear-needs-check-flag"
+# define DEFAULT_THIN_CHECK_OPTIONS_CONFIG "#S" DEFAULT_THIN_CHECK_OPTION1 "#S" DEFAULT_THIN_CHECK_OPTION2
#else
# define DEFAULT_THIN_CHECK_OPTION1 "-q"
# define DEFAULT_THIN_CHECK_OPTION2 ""
+# define DEFAULT_THIN_CHECK_OPTIONS_CONFIG "#S" DEFAULT_THIN_CHECK_OPTION1
#endif
#define DEFAULT_THIN_REPAIR_OPTIONS ""
+#define DEFAULT_THIN_REPAIR_OPTIONS_CONFIG NULL
#define DEFAULT_THIN_POOL_METADATA_REQUIRE_SEPARATE_PVS 0
#define DEFAULT_THIN_POOL_MAX_METADATA_SIZE (16 * 1024 * 1024) /* KB */
#define DEFAULT_THIN_POOL_MIN_METADATA_SIZE 2048 /* KB */
@@ -99,7 +102,9 @@
#define DEFAULT_POOL_METADATA_SPARE 1 /* thin + cache */
#define DEFAULT_CACHE_CHECK_OPTION1 "-q"
+#define DEFAULT_CACHE_CHECK_OPTIONS_CONFIG "#S" DEFAULT_CACHE_CHECK_OPTION1
#define DEFAULT_CACHE_REPAIR_OPTIONS ""
+#define DEFAULT_CACHE_REPAIR_OPTIONS_CONFIG NULL
#define DEFAULT_CACHE_POOL_METADATA_REQUIRE_SEPARATE_PVS 0
#define DEFAULT_CACHE_POOL_CHUNK_SIZE 64 /* KB */
#define DEFAULT_CACHE_POOL_MIN_METADATA_SIZE 2048 /* KB */
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 9dabe6ee7..ad8eccbd7 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -7473,6 +7473,9 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg,
goto deactivate_and_revert_new_lv; /* Let's retry on error path */
}
+ /* Get in sync with deactivation, before reusing LV as snapshot */
+ sync_local_dev_names(lv->vg->cmd);
+
/* Create zero origin volume for spare snapshot */
if (lp->virtual_extents &&
!(origin_lv = _create_virtual_origin(cmd, vg, lv->name,
diff --git a/lib/misc/configure.h.in b/lib/misc/configure.h.in
index 3af8ec0f4..9ec997fa9 100644
--- a/lib/misc/configure.h.in
+++ b/lib/misc/configure.h.in
@@ -95,6 +95,9 @@
/* Path to LVM system directory. */
#undef DEFAULT_SYS_DIR
+/* Use blkid wiping by default. */
+#undef DEFAULT_USE_BLKID_WIPING
+
/* Use lvmetad by default. */
#undef DEFAULT_USE_LVMETAD
diff --git a/libdm/.exported_symbols.DM_1_02_100 b/libdm/.exported_symbols.DM_1_02_100
new file mode 100644
index 000000000..00d7d5b10
--- /dev/null
+++ b/libdm/.exported_symbols.DM_1_02_100
@@ -0,0 +1,2 @@
+dm_config_value_set_format_flags
+dm_config_value_get_format_flags
diff --git a/libdm/libdevmapper.h b/libdm/libdevmapper.h
index cbd4f3d91..7476aef73 100644
--- a/libdm/libdevmapper.h
+++ b/libdm/libdevmapper.h
@@ -1847,6 +1847,7 @@ struct dm_config_value {
} v;
struct dm_config_value *next; /* For arrays */
+ uint32_t format_flags;
};
struct dm_config_node {
@@ -1949,6 +1950,24 @@ struct dm_config_node *dm_config_create_node(struct dm_config_tree *cft, const c
struct dm_config_value *dm_config_create_value(struct dm_config_tree *cft);
struct dm_config_node *dm_config_clone_node(struct dm_config_tree *cft, const struct dm_config_node *cn, int siblings);
+/*
+ * Common formatting flags applicable to all config node types (lower 16 bits).
+ */
+#define DM_CONFIG_VALUE_FMT_COMMON_ARRAY 0x00000001 /* value is array */
+#define DM_CONFIG_VALUE_FMT_COMMON_EXTRA_SPACES 0x00000002 /* add spaces in "key = value" pairs in constrast to "key=value" for better readability */
+
+/*
+ * Type-related config node formatting flags (higher 16 bits).
+ */
+/* int-related formatting flags */
+#define DM_CONFIG_VALUE_FMT_INT_OCTAL 0x00010000 /* print number in octal form */
+
+/* string-related formatting flags */
+#define DM_CONFIG_VALUE_FMT_STRING_NO_QUOTES 0x00010000 /* do not print quotes around string value */
+
+void dm_config_value_set_format_flags(struct dm_config_value *cv, uint32_t format_flags);
+uint32_t dm_config_value_get_format_flags(struct dm_config_value *cv);
+
struct dm_pool *dm_config_memory(struct dm_config_tree *cft);
/* Udev device directory. */
diff --git a/libdm/libdm-config.c b/libdm/libdm-config.c
index f7b07a513..7b2897212 100644
--- a/libdm/libdm-config.c
+++ b/libdm/libdm-config.c
@@ -273,11 +273,13 @@ static int _line_end(const struct dm_config_node *cn, struct config_output *out)
static int _write_value(struct config_output *out, const struct dm_config_value *v)
{
char *buf;
+ const char *s;
switch (v->type) {
case DM_CFG_STRING:
buf = alloca(dm_escaped_len(v->v.str));
- line_append("\"%s\"", dm_escape_double_quotes(buf, v->v.str));
+ s = (v->format_flags & DM_CONFIG_VALUE_FMT_STRING_NO_QUOTES) ? "" : "\"";
+ line_append("%s%s%s", s, dm_escape_double_quotes(buf, v->v.str), s);
break;
case DM_CFG_FLOAT:
@@ -285,11 +287,15 @@ static int _write_value(struct config_output *out, const struct dm_config_value
break;
case DM_CFG_INT:
- line_append("%" PRId64, v->v.i);
+ if (v->format_flags & DM_CONFIG_VALUE_FMT_INT_OCTAL)
+ line_append("0%" PRIo64, v->v.i);
+ else
+ line_append("%" PRId64, v->v.i);
break;
case DM_CFG_EMPTY_ARRAY:
- line_append("[]");
+ s = (v->format_flags & DM_CONFIG_VALUE_FMT_COMMON_EXTRA_SPACES) ? " " : "";
+ line_append("[%s]", s);
break;
default:
@@ -303,6 +309,8 @@ static int _write_value(struct config_output *out, const struct dm_config_value
static int _write_config(const struct dm_config_node *n, int only_one,
struct config_output *out, int level)
{
+ const char *extra_space;
+ int format_array;
char space[MAX_INDENT + 1];
int l = (level < MAX_INDENT) ? level : MAX_INDENT;
int i;
@@ -316,6 +324,9 @@ static int _write_config(const struct dm_config_node *n, int only_one,
space[i] = '\0';
do {
+ extra_space = (n->v && (n->v->format_flags & DM_CONFIG_VALUE_FMT_COMMON_EXTRA_SPACES)) ? " " : "";
+ format_array = (n->v && (n->v->format_flags & DM_CONFIG_VALUE_FMT_COMMON_ARRAY));
+
if (out->spec && out->spec->prefix_fn)
out->spec->prefix_fn(n, space, out->baton);
@@ -341,20 +352,25 @@ static int _write_config(const struct dm_config_node *n, int only_one,
} else {
/* it's a value */
const struct dm_config_value *v = n->v;
- line_append("=");
+ line_append("%s=%s", extra_space, extra_space);
if (v->next) {
- line_append("[");
+ line_append("[%s", extra_space);
while (v && v->type != DM_CFG_EMPTY_ARRAY) {
if (!_write_value(out, v))
return_0;
v = v->next;
if (v && v->type != DM_CFG_EMPTY_ARRAY)
- line_append(", ");
+ line_append(",%s", extra_space);
}
- line_append("]");
- } else
+ line_append("%s]", extra_space);
+ } else {
+ if (format_array && (v->type != DM_CFG_EMPTY_ARRAY))
+ line_append("[%s", extra_space);
if (!_write_value(out, v))
return_0;
+ if (format_array && (v->type != DM_CFG_EMPTY_ARRAY))
+ line_append("%s]", extra_space);
+ }
}
if (!_line_end(n, out))
return_0;
@@ -1328,6 +1344,22 @@ struct dm_config_value *dm_config_create_value(struct dm_config_tree *cft)
return _create_value(cft->mem);
}
+void dm_config_value_set_format_flags(struct dm_config_value *cv, uint32_t format_flags)
+{
+ if (!cv)
+ return;
+
+ cv->format_flags = format_flags;
+}
+
+uint32_t dm_config_value_get_format_flags(struct dm_config_value *cv)
+{
+ if (!cv)
+ return 0;
+
+ return cv->format_flags;
+}
+
struct dm_pool *dm_config_memory(struct dm_config_tree *cft)
{
return cft->mem;
diff --git a/man/lvmconfig.8.in b/man/lvmconfig.8.in
index 4e6128098..761b1e922 100644
--- a/man/lvmconfig.8.in
+++ b/man/lvmconfig.8.in
@@ -27,6 +27,7 @@ lvmconfig, lvm dumpconfig, lvm config \(em Display LVM configuration
.RB [ \-\-validate ]
.RB [ \-\-withsummary ]
.RB [ \-\-withcomments ]
+.RB [ \-\-withspaces ]
.RB [ \-\-withversions ]
.RB [ ConfigurationNode... ]
@@ -186,6 +187,10 @@ Display a full comment for each configuration node. For deprecated
settings, also display comments about deprecation in addition.
.TP
+.B \-\-withspaces
+Where appropriate, add more spaces in output for better readability.
+
+.TP
.B \-\-withversions
Also display a comment containing the version of introduction for
each configuration node. If the setting is deprecated, also display
diff --git a/test/shell/profiles-thin.sh b/test/shell/profiles-thin.sh
index 0c7fb6157..5940cc6d2 100644
--- a/test/shell/profiles-thin.sh
+++ b/test/shell/profiles-thin.sh
@@ -59,6 +59,11 @@ check lv_field $vg/pool_performance zero ""
vgremove -ff $vg
+if test -d "$DM_DEV_DIR/$vg" ; then
+ should not echo "Udev has left \"$DM_DEV_DIR/$vg\"!"
+ rm -rf "$DM_DEV_DIR/$vg"
+fi
+
# 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"
diff --git a/tools/args.h b/tools/args.h
index 1ca2e0ed5..80c2a24d3 100644
--- a/tools/args.h
+++ b/tools/args.h
@@ -132,6 +132,7 @@ arg(vgmetadatacopies_ARG, '\0', "vgmetadatacopies", metadatacopies_arg, 0)
arg(virtualoriginsize_ARG, '\0', "virtualoriginsize", size_mb_arg, 0)
arg(withsummary_ARG, '\0', "withsummary", NULL, 0)
arg(withcomments_ARG, '\0', "withcomments", NULL, 0)
+arg(withspaces_ARG, '\0', "withspaces", NULL, 0)
arg(withversions_ARG, '\0', "withversions", NULL, 0)
arg(writebehind_ARG, '\0', "writebehind", int_arg, 0)
arg(writemostly_ARG, '\0', "writemostly", string_arg, ARG_GROUPABLE)
diff --git a/tools/commands.h b/tools/commands.h
index a5ba9c8e6..d3ec5e014 100644
--- a/tools/commands.h
+++ b/tools/commands.h
@@ -49,13 +49,14 @@ xx(config,
"\t[--validate]\n"
"\t[--withsummary]\n"
"\t[--withcomments]\n"
+ "\t[--withspaces]\n"
"\t[--unconfigured]\n"
"\t[--withversions]\n"
"\t[ConfigurationNode...]\n",
atversion_ARG, configtype_ARG, file_ARG, ignoreadvanced_ARG,
ignoreunsupported_ARG, ignorelocal_ARG, list_ARG, mergedconfig_ARG, metadataprofile_ARG,
showdeprecated_ARG, showunsupported_ARG, validate_ARG, withsummary_ARG, withcomments_ARG,
- unconfigured_ARG, withversions_ARG)
+ withspaces_ARG, unconfigured_ARG, withversions_ARG)
xx(devtypes,
"Display recognised built-in block device types",
@@ -104,13 +105,14 @@ xx(dumpconfig,
"\t[--validate]\n"
"\t[--withsummary]\n"
"\t[--withcomments]\n"
+ "\t[--withspaces]\n"
"\t[--unconfigured]\n"
"\t[--withversions]\n"
"\t[ConfigurationNode...]\n",
atversion_ARG, configtype_ARG, file_ARG, ignoreadvanced_ARG,
ignoreunsupported_ARG, ignorelocal_ARG, list_ARG, mergedconfig_ARG, metadataprofile_ARG,
showdeprecated_ARG, showunsupported_ARG, validate_ARG, withsummary_ARG, withcomments_ARG,
- unconfigured_ARG, withversions_ARG)
+ withspaces_ARG, unconfigured_ARG, withversions_ARG)
xx(formats,
"List available metadata formats",
@@ -508,13 +510,14 @@ xx(lvmconfig,
"\t[--validate]\n"
"\t[--withsummary]\n"
"\t[--withcomments]\n"
+ "\t[--withspaces]\n"
"\t[--unconfigured]\n"
"\t[--withversions]\n"
"\t[ConfigurationNode...]\n",
atversion_ARG, configtype_ARG, file_ARG, ignoreadvanced_ARG,
ignoreunsupported_ARG, ignorelocal_ARG, list_ARG, mergedconfig_ARG, metadataprofile_ARG,
showdeprecated_ARG, showunsupported_ARG, validate_ARG, withsummary_ARG, withcomments_ARG,
- unconfigured_ARG, withversions_ARG)
+ withspaces_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 97de57abd..f6a62172e 100644
--- a/tools/dumpconfig.c
+++ b/tools/dumpconfig.c
@@ -277,6 +277,9 @@ int dumpconfig(struct cmd_context *cmd, int argc, char **argv)
if (arg_count(cmd, withversions_ARG))
tree_spec.withversions = 1;
+ if (arg_count(cmd, withspaces_ARG))
+ tree_spec.withspaces = 1;
+
if (cft_check_handle)
tree_spec.check_status = cft_check_handle->status;