master - tests: deactivate before remove
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=03c4fee5a7afee...
Commit: 03c4fee5a7afeeae0b3c215779d24b5faaa1ac26
Parent: a62cd64db6c65637f2f2125222962696a7c7c5ee
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jun 26 22:00:40 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jun 26 22:11:46 2015 +0200
tests: deactivate before remove
Testing if this avoids udev race with removal of snapshot on some
test machines.
See: https://bugzilla.redhat.com/show_bug.cgi?id=1217819
---
test/shell/lvconvert-repair-snapshot.sh | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/test/shell/lvconvert-repair-snapshot.sh b/test/shell/lvconvert-repair-snapshot.sh
index 1bb4138..73f2f88 100644
--- a/test/shell/lvconvert-repair-snapshot.sh
+++ b/test/shell/lvconvert-repair-snapshot.sh
@@ -28,4 +28,5 @@ aux enable_dev "$dev2" "$dev4"
lvs -a -o +devices $vg
check mirror $vg 4way "$dev5"
+vgchange -an $vg
vgremove -ff $vg
8 years, 10 months
master - makefiles: avoid bash == operator syntax, use = instead
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a62cd64db6c656...
Commit: a62cd64db6c65637f2f2125222962696a7c7c5ee
Parent: 844707067b5aef9bbcdf169b66a25bb79690d325
Author: Ferenc Wágner <wferi(a)niif.hu>
AuthorDate: Fri Jun 26 09:00:16 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jun 26 22:11:45 2015 +0200
makefiles: avoid bash == operator syntax, use = instead
Commit e587b0677b705786a78f21bac1966621f70b2752 broke the build on
systems where /bin/sh is Dash, for example.
Origin patch by Ferenc Wágner <wferi(a)niif.hu> changed later to
avoid using shell call, so makefile add 'server' target when
one of metad or polld daemon is requested.
---
WHATS_NEW | 1 +
libdaemon/Makefile.in | 7 +++++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 8f14bef..813eb5e 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.123 -
=================================
+ Fix makefile shell compare == when building lvmetad lvmpolld (2.02.120).
Add --type full to lvmconfig for full configuration tree view.
Add undocumented environment variables to lvm man page. (2.02.119)
Add device synchronization point before activating a new snapshot.
diff --git a/libdaemon/Makefile.in b/libdaemon/Makefile.in
index c0379a4..0a085db 100644
--- a/libdaemon/Makefile.in
+++ b/libdaemon/Makefile.in
@@ -1,5 +1,5 @@
#
-# Copyright (C) 2004-2011 Red Hat, Inc. All rights reserved.
+# Copyright (C) 2004-2015 Red Hat, Inc. All rights reserved.
#
# This file is part of LVM2.
#
@@ -19,7 +19,10 @@ top_builddir = @top_builddir@
SUBDIRS += client
-ifeq (yes, $(shell test @BUILD_LVMETAD@ == yes -o @BUILD_LVMPOLLD@ == yes && echo yes))
+ifeq (@BUILD_LVMETAD@,yes)
+ SUBDIRS += server
+server: client
+else ifeq (@BUILD_LVMPOLLD@,yes)
SUBDIRS += server
server: client
endif
8 years, 10 months
master - lvmconfig: do not display settings with undefined default values
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=844707067b5aef...
Commit: 844707067b5aef9bbcdf169b66a25bb79690d325
Parent: 07a34184dba585a4de875035e2acecc9dab1862d
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Thu Jun 25 12:49:59 2015 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Thu Jun 25 13:51:55 2015 +0200
lvmconfig: do not display settings with undefined default values
Do not display settings with undefined default values, but do display
these settings in case the value is defined directly in any part of
the existing config cascade.
For example, the lvmconfig --type current always displays these settings
(as it's somewhere in "current" configuration cascade that makes it defined).
The lvmconfig --type full displays these settings only if it's defined
somewhere in the cascade, but not if default value is used instead
The lvmconfig --type default never displays these settings...
More concrete example - let's have activation/volume_list directly
set in lvm.conf and activation/read_only_volume_list not set.
Both of these settings have *undefined default* values.
$lvmconfig --type full activation/volume_list activation/read_only_volume_list
volume_list="/dev/vg/lv"
(...only volume_list is defined, hence it's printed)
However, the comments will display more info (see also previous commit):
$lvmconfig --type full activation/volume_list activation/read_only_volume_list --withsummary
# Configuration option activation/volume_list.
# Only LVs selected by this list are activated.
# This configuration option does not have a default value defined.
# Value defined in existing configuration has been used for this setting.
volume_list="/dev/vg/lv"
# Configuration option activation/read_only_volume_list.
# LVs in this list are activated in read-only mode.
# This configuration option does not have a default value defined.
---
lib/config/config.c | 28 +++++++++++++++++++++++-----
1 files changed, 23 insertions(+), 5 deletions(-)
diff --git a/lib/config/config.c b/lib/config/config.c
index 4ce97a9..53987f8 100644
--- a/lib/config/config.c
+++ b/lib/config/config.c
@@ -1629,6 +1629,16 @@ static int _out_prefix_fn(const struct dm_config_node *cn, const char *line, voi
return 1;
}
+static int _should_print_cfg_with_undef_def_val(struct out_baton *out, cfg_def_item_t *cfg_def,
+ const struct dm_config_node *cn)
+{
+ if (!(cfg_def->flags & CFG_DEFAULT_UNDEFINED))
+ return 1;
+
+ /* print it only if the value is directly defined in some config = it's used */
+ return out->tree_spec->check_status && (out->tree_spec->check_status[cn->id] & CFG_USED);
+}
+
static int _out_line_fn(const struct dm_config_node *cn, const char *line, void *baton)
{
struct out_baton *out = baton;
@@ -1671,15 +1681,23 @@ static int _out_line_fn(const struct dm_config_node *cn, const char *line, void
}
/* Usual tree view with nodes and their values. */
+
if ((out->tree_spec->type != CFG_DEF_TREE_CURRENT) &&
(out->tree_spec->type != CFG_DEF_TREE_DIFF) &&
(out->tree_spec->type != CFG_DEF_TREE_FULL) &&
(cfg_def->flags & (CFG_DEFAULT_UNDEFINED | CFG_DEFAULT_COMMENTED))) {
- space_prefix = ((len = strspn(line, "\t "))) ? dm_pool_strndup(out->mem, line, len) : NULL;
- fprintf(out->fp, "%s%s%s\n", space_prefix ? : "", "# ", line + len);
- if (space_prefix)
- dm_pool_free(out->mem, space_prefix);
- } else
+ /* print with # at the front to comment out the line */
+ if (_should_print_cfg_with_undef_def_val(out, cfg_def, cn)) {
+ space_prefix = ((len = strspn(line, "\t "))) ? dm_pool_strndup(out->mem, line, len) : NULL;
+ fprintf(out->fp, "%s%s%s\n", space_prefix ? : "", "# ", line + len);
+ if (space_prefix)
+ dm_pool_free(out->mem, space_prefix);
+ }
+ return 1;
+ }
+
+ /* print the line as it is */
+ if (_should_print_cfg_with_undef_def_val(out, cfg_def, cn))
fprintf(out->fp, "%s\n", line);
return 1;
8 years, 10 months
master - lvmconfig: display comment about value from existing config being used
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=07a34184dba585...
Commit: 07a34184dba585a4de875035e2acecc9dab1862d
Parent: c794c163b5800625a116ee53711f4d8db786ff30
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Thu Jun 25 13:03:31 2015 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Thu Jun 25 13:51:54 2015 +0200
lvmconfig: display comment about value from existing config being used
Display comment abour value from existing config being used. For example:
$ lvmconfig --type full --withsummary report/compact_output report/buffered
# Configuration option report/compact_output.
# Do not print empty report fields.
# Value defined in existing configuration has been used for this setting.
compact_output=1
# Configuration option report/buffered.
# Buffer report output.
buffered=1
---
lib/config/config.c | 4 ++++
man/lvmconfig.8.in | 5 ++++-
2 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/lib/config/config.c b/lib/config/config.c
index fffaace..4ce97a9 100644
--- a/lib/config/config.c
+++ b/lib/config/config.c
@@ -1608,6 +1608,10 @@ static int _out_prefix_fn(const struct dm_config_node *cn, const char *line, voi
if (cfg_def->flags & CFG_DEFAULT_UNDEFINED)
fprintf(out->fp, "%s# This configuration %s does not have a default value defined.\n", line, node_type_name);
+
+ if ((out->tree_spec->type == CFG_DEF_TREE_FULL) &&
+ (out->tree_spec->check_status[cn->id] & CFG_USED))
+ fprintf(out->fp, "%s# Value defined in existing configuration has been used for this setting.\n", line);
}
if (out->tree_spec->withversions) {
diff --git a/man/lvmconfig.8.in b/man/lvmconfig.8.in
index 6d1b3fc..bbbeb6d 100644
--- a/man/lvmconfig.8.in
+++ b/man/lvmconfig.8.in
@@ -72,7 +72,10 @@ Display full configuration tree - a combination of current configuration tree
(\fB\-\-type current\fP) and tree of settings for which default values are
used (\fB\-\-type missing\fP). This is exactly the configuration tree that
LVM2 uses during command execution. Using this type also implies
-the use of \fB\-\-mergedconfig\fP option.
+the use of \fB\-\-mergedconfig\fP option. If comments are displayed
+(see \fB\-\-withcomments\fP and \fB\-\-withsummary\fP options), then
+for each setting found in existing configuration and for which defaults
+are not used, there's an extra comment line printed to denote this.
.IP list 3
Display plain list of configuration settings.
.IP missing 3
8 years, 10 months
master - lvmconfig: add --type full to display full tree of settings
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c794c163b58006...
Commit: c794c163b5800625a116ee53711f4d8db786ff30
Parent: f6de196c21a193db5400220f3636fad0875f6d5a
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Thu Jun 25 10:51:30 2015 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Thu Jun 25 13:33:52 2015 +0200
lvmconfig: add --type full to display full tree of settings
The lvmconfig --type full is actually a combination of --type current
and --type missing together with --mergedconfig options used.
The overall outcome is a configuration tree with settings as LVM sees
it when it looks for the values - that means, if the setting is defined
in some config source (lvm.conf, --config, lvmlocal.conf or any profile
that is used), the setting is used. Otherwise, if the setting is not
defined in any part of the config cascade, the defaults are used.
The --type full displays exactly this final tree with all the values
defined, either coming from configuration tree or from defaults.
---
WHATS_NEW | 1 +
lib/config/config.c | 42 ++++++++++++++++++++++++++++++++++++++----
lib/config/config.h | 29 +++++++++++++++--------------
man/lvmconfig.8.in | 10 ++++++++--
tools/commands.h | 6 +++---
tools/dumpconfig.c | 35 ++++++++++++++++++++++++++---------
6 files changed, 91 insertions(+), 32 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 41e5cc4..8f14bef 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.123 -
=================================
+ Add --type full to lvmconfig for full configuration tree view.
Add undocumented environment variables to lvm man page. (2.02.119)
Add device synchronization point before activating a new snapshot.
Add --withspaces to lvmconfig to add spaces in output for better readability.
diff --git a/lib/config/config.c b/lib/config/config.c
index 22b8f09..fffaace 100644
--- a/lib/config/config.c
+++ b/lib/config/config.c
@@ -1669,6 +1669,7 @@ static int _out_line_fn(const struct dm_config_node *cn, const char *line, void
/* Usual tree view with nodes and their values. */
if ((out->tree_spec->type != CFG_DEF_TREE_CURRENT) &&
(out->tree_spec->type != CFG_DEF_TREE_DIFF) &&
+ (out->tree_spec->type != CFG_DEF_TREE_FULL) &&
(cfg_def->flags & (CFG_DEFAULT_UNDEFINED | CFG_DEFAULT_COMMENTED))) {
space_prefix = ((len = strspn(line, "\t "))) ? dm_pool_strndup(out->mem, line, len) : NULL;
fprintf(out->fp, "%s%s%s\n", space_prefix ? : "", "# ", line + len);
@@ -1836,6 +1837,8 @@ static int _should_skip_def_node(struct config_def_tree_spec *spec, int section_
return 1;
switch (spec->type) {
+ case CFG_DEF_TREE_FULL:
+ /* fall through */
case CFG_DEF_TREE_MISSING:
if (!spec->check_status) {
log_error_once(INTERNAL_ERROR "couldn't determine missing "
@@ -1843,9 +1846,12 @@ static int _should_skip_def_node(struct config_def_tree_spec *spec, int section_
return 1;
}
if ((spec->check_status[id] & CFG_USED) ||
- (def->flags & CFG_NAME_VARIABLE) ||
- (def->since_version > spec->version) ||
- _should_skip_deprecated_def_node(def, spec))
+ (def->flags & CFG_NAME_VARIABLE))
+ return 1;
+
+ if ((spec->type == CFG_DEF_TREE_MISSING) &&
+ ((def->since_version > spec->version) ||
+ _should_skip_deprecated_def_node(def, spec)))
return 1;
break;
case CFG_DEF_TREE_NEW:
@@ -1854,7 +1860,9 @@ static int _should_skip_def_node(struct config_def_tree_spec *spec, int section_
return 1;
break;
case CFG_DEF_TREE_PROFILABLE:
+ /* fall through */
case CFG_DEF_TREE_PROFILABLE_CMD:
+ /* fall through */
case CFG_DEF_TREE_PROFILABLE_MDA:
if (!(def->flags & CFG_PROFILABLE) ||
(def->since_version > spec->version) ||
@@ -1910,7 +1918,7 @@ bad:
struct dm_config_tree *config_def_create_tree(struct config_def_tree_spec *spec)
{
- struct dm_config_tree *cft;
+ struct dm_config_tree *cft = NULL, *tmp_cft = NULL;
struct dm_config_node *root = NULL, *relay = NULL, *tmp;
int id;
@@ -1934,7 +1942,33 @@ struct dm_config_tree *config_def_create_tree(struct config_def_tree_spec *spec)
}
cft->root = root;
+
+ if (spec->type == CFG_DEF_TREE_FULL) {
+ if (!(tmp_cft = dm_config_create())) {
+ log_error("Failed to create temporary config tree while creating full tree.");
+ goto bad;
+ }
+
+ if (!(tmp_cft->root = dm_config_clone_node_with_mem(cft->mem, spec->current_cft->root, 1))) {
+ log_error("Failed to clone current config tree.");
+ goto bad;
+ }
+
+ if (!merge_config_tree(spec->cmd, cft, tmp_cft, CONFIG_MERGE_TYPE_RAW)) {
+ log_error("Failed to merge default and current config tree.");
+ goto bad;
+ }
+
+ dm_config_destroy(tmp_cft);
+ }
+
return cft;
+bad:
+ if (cft)
+ dm_config_destroy(cft);
+ if (tmp_cft)
+ dm_config_destroy(tmp_cft);
+ return NULL;
}
static int _check_profile(struct cmd_context *cmd, struct profile *profile)
diff --git a/lib/config/config.h b/lib/config/config.h
index 9601dc1..24d1f3f 100644
--- a/lib/config/config.h
+++ b/lib/config/config.h
@@ -141,7 +141,7 @@ typedef struct cfg_def_item {
typedef enum {
CFG_DEF_TREE_CURRENT, /* tree of nodes with values currently set in the config */
CFG_DEF_TREE_MISSING, /* tree of nodes missing in current config using default values */
- CFG_DEF_TREE_COMPLETE, /* CURRENT + MISSING, the tree actually used within execution, not implemented yet */
+ CFG_DEF_TREE_FULL, /* CURRENT + MISSING, the tree actually used within execution */
CFG_DEF_TREE_DEFAULT, /* tree of all possible config nodes with default values */
CFG_DEF_TREE_NEW, /* tree of all new nodes that appeared in given version */
CFG_DEF_TREE_PROFILABLE, /* tree of all nodes that are customizable by profiles */
@@ -153,19 +153,20 @@ typedef enum {
/* configuration definition tree specification */
struct config_def_tree_spec {
- struct cmd_context *cmd; /* command context (for run-time defaults */
- cfg_def_tree_t type; /* tree type */
- uint16_t version; /* tree at this LVM2 version */
- unsigned ignoreadvanced:1; /* do not include advanced configs */
- unsigned ignoreunsupported:1; /* do not include unsupported configs */
- unsigned ignoredeprecated:1; /* do not include deprecated configs */
- unsigned ignorelocal:1; /* do not include the local section */
- 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) */
+ struct cmd_context *cmd; /* command context (for run-time defaults */
+ struct dm_config_tree *current_cft; /* current config tree which is defined explicitly - defaults are not used */
+ cfg_def_tree_t type; /* tree type */
+ uint16_t version; /* tree at this LVM2 version */
+ unsigned ignoreadvanced:1; /* do not include advanced configs */
+ unsigned ignoreunsupported:1; /* do not include unsupported configs */
+ unsigned ignoredeprecated:1; /* do not include deprecated configs */
+ unsigned ignorelocal:1; /* do not include the local section */
+ 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/man/lvmconfig.8.in b/man/lvmconfig.8.in
index 761b1e9..6d1b3fc 100644
--- a/man/lvmconfig.8.in
+++ b/man/lvmconfig.8.in
@@ -6,7 +6,7 @@ lvmconfig, lvm dumpconfig, lvm config \(em Display LVM configuration
.RB [ \-f | \-\-file
.IR filename ]
.RB [ \-\-type
-.RI { current | default | diff | list | missing | new | profilable | profilable-command | profilable-metadata }
+.RI { current | default | diff | full | list | missing | new | profilable | profilable-command | profilable-metadata }
.RB [ \-\-atversion
.IR version ]
.RB [ \-\-ignoreadvanced ]
@@ -47,7 +47,7 @@ List configuration settings with summarizing comment. This is the same as using
\fBlvmconfig --type list --withsummary\fP.
.TP
-.IR \fB\-\-type " {" current | default | diff | missing | new | profilable }
+.IR \fB\-\-type " {" current | default | diff | full | missing | new | profilable | profilable-command | profilable-metadata }
Select the type of configuration to display. The configuration settings
displayed have either default values or currently-used values assigned based on
the type selected. If no type is selected, \fB\-\-type current\fP is used
@@ -67,6 +67,12 @@ Display all configuration settings for which the values used differ from default
The value assigned for each configuration setting is the value currently used.
This is actually minimal LVM configuration which can be used without
a change to current configured behaviour.
+.IP full 3
+Display full configuration tree - a combination of current configuration tree
+(\fB\-\-type current\fP) and tree of settings for which default values are
+used (\fB\-\-type missing\fP). This is exactly the configuration tree that
+LVM2 uses during command execution. Using this type also implies
+the use of \fB\-\-mergedconfig\fP option.
.IP list 3
Display plain list of configuration settings.
.IP missing 3
diff --git a/tools/commands.h b/tools/commands.h
index d89b214..9fe4db1 100644
--- a/tools/commands.h
+++ b/tools/commands.h
@@ -33,7 +33,7 @@ xx(config,
PERMITTED_READ_ONLY,
"config\n"
"\t[-f|--file filename]\n"
- "\t[--type {current|default|diff|list|missing|new|profilable|profilable-command|profilable-metadata}\n"
+ "\t[--type {current|default|diff|full|list|missing|new|profilable|profilable-command|profilable-metadata}\n"
"\t[--atversion version]]\n"
"\t[--ignoreadvanced]\n"
"\t[--ignoreunsupported]\n"
@@ -89,7 +89,7 @@ xx(dumpconfig,
PERMITTED_READ_ONLY,
"dumpconfig\n"
"\t[-f|--file filename]\n"
- "\t[--type {current|default|diff|list|missing|new|profilable|profilable-command|profilable-metadata}\n"
+ "\t[--type {current|default|diff|full|list|missing|new|profilable|profilable-command|profilable-metadata}\n"
"\t[--atversion version]]\n"
"\t[--ignoreadvanced]\n"
"\t[--ignoreunsupported]\n"
@@ -494,7 +494,7 @@ xx(lvmconfig,
PERMITTED_READ_ONLY,
"lvmconfig\n"
"\t[-f|--file filename]\n"
- "\t[--type {current|default|diff|list|missing|new|profilable|profilable-command|profilable-metadata}\n"
+ "\t[--type {current|default|diff|full|list|missing|new|profilable|profilable-command|profilable-metadata}\n"
"\t[--atversion version]]\n"
"\t[--ignoreadvanced]\n"
"\t[--ignoreunsupported]\n"
diff --git a/tools/dumpconfig.c b/tools/dumpconfig.c
index f6a6217..c9c5bf9 100644
--- a/tools/dumpconfig.c
+++ b/tools/dumpconfig.c
@@ -154,21 +154,22 @@ int dumpconfig(struct cmd_context *cmd, int argc, char **argv)
if (arg_count(cmd, ignorelocal_ARG))
tree_spec.ignorelocal = 1;
- if (!strcmp(type, "current")) {
+ if (!strcmp(type, "current") || !strcmp(type, "full")) {
if (arg_count(cmd, atversion_ARG)) {
- log_error("--atversion has no effect with --type current");
+ log_error("--atversion has no effect with --type %s", type);
return EINVALID_CMD_LINE;
}
- if (arg_count(cmd, ignoreunsupported_ARG) ||
- arg_count(cmd, ignoreadvanced_ARG)) {
+ if ((arg_count(cmd, ignoreunsupported_ARG) ||
+ arg_count(cmd, ignoreadvanced_ARG)) &&
+ !strcmp(type, "current")) {
/* FIXME: allow these even for --type current */
log_error("--ignoreadvanced and --ignoreunsupported has "
"no effect with --type current");
return EINVALID_CMD_LINE;
}
} else if (arg_count(cmd, mergedconfig_ARG)) {
- log_error("--mergedconfig has no effect without --type current");
+ log_error("--mergedconfig has no effect without --type current or --type full");
return EINVALID_CMD_LINE;
}
@@ -191,7 +192,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) && cmd->cft->cascade) {
+ if ((arg_count(cmd, mergedconfig_ARG) || !strcmp(type, "full")) && cmd->cft->cascade) {
if (!_merge_config_cascade(cmd, cmd->cft, &cft)) {
log_error("Failed to merge configuration.");
r = ECMD_FAILED;
@@ -199,6 +200,7 @@ int dumpconfig(struct cmd_context *cmd, int argc, char **argv)
}
} else
cft = cmd->cft;
+ tree_spec.current_cft = cft;
if (arg_count(cmd, validate_ARG)) {
if (_config_validate(cmd, cft)) {
@@ -218,6 +220,12 @@ int dumpconfig(struct cmd_context *cmd, int argc, char **argv)
return EINVALID_CMD_LINE;
}
/* list type does not require status check */
+ } else if (!strcmp(type, "full")) {
+ tree_spec.type = CFG_DEF_TREE_FULL;
+ if (!_do_def_check(&tree_spec, cft, &cft_check_handle)) {
+ r = ECMD_FAILED;
+ goto_out;
+ }
} else if (!strcmp(type, "current")) {
tree_spec.type = CFG_DEF_TREE_CURRENT;
if (!_do_def_check(&tree_spec, cft, &cft_check_handle)) {
@@ -261,8 +269,8 @@ int dumpconfig(struct cmd_context *cmd, int argc, char **argv)
}
else {
log_error("Incorrect type of configuration specified. "
- "Expected one of: current, default, list, missing, new, "
- "profilable, profilable-command, profilable-metadata.");
+ "Expected one of: current, default, diff, full, list, missing, "
+ "new, profilable, profilable-command, profilable-metadata.");
r = EINVALID_CMD_LINE;
goto out;
}
@@ -295,8 +303,17 @@ int dumpconfig(struct cmd_context *cmd, int argc, char **argv)
r = ECMD_FAILED;
}
out:
+ if (tree_spec.current_cft && (tree_spec.current_cft != cft) &&
+ (tree_spec.current_cft != cmd->cft))
+ /*
+ * This happens in case of CFG_DEF_TREE_FULL where we
+ * have merged explicitly defined config trees and also
+ * we have used default tree.
+ */
+ dm_config_destroy(tree_spec.current_cft);
+
if (cft && (cft != cmd->cft))
- dm_pool_destroy(cft->mem);
+ dm_config_destroy(cft);
else if (profile)
remove_config_tree_by_source(cmd, CONFIG_PROFILE_COMMAND);
8 years, 10 months
master - config: also clone associated id when cloning node using dm_config_clone_node{_with_mem}
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f6de196c21a193...
Commit: f6de196c21a193db5400220f3636fad0875f6d5a
Parent: 110a0745cd162680002c8f7d30220dd627300a95
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Thu Jun 25 10:21:07 2015 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Thu Jun 25 10:21:07 2015 +0200
config: also clone associated id when cloning node using dm_config_clone_node{_with_mem}
---
libdm/libdm-config.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/libdm/libdm-config.c b/libdm/libdm-config.c
index 7b28972..f163677 100644
--- a/libdm/libdm-config.c
+++ b/libdm/libdm-config.c
@@ -1308,6 +1308,8 @@ struct dm_config_node *dm_config_clone_node_with_mem(struct dm_pool *mem, const
return NULL;
}
+ new_cn->id = cn->id;
+
if ((cn->v && !(new_cn->v = _clone_config_value(mem, cn->v))) ||
(cn->child && !(new_cn->child = dm_config_clone_node_with_mem(mem, cn->child, 1))) ||
(siblings && cn->sib && !(new_cn->sib = dm_config_clone_node_with_mem(mem, cn->sib, siblings))))
8 years, 10 months
master - man: Add missing env vars to lvm man page.
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=110a0745cd1626...
Commit: 110a0745cd162680002c8f7d30220dd627300a95
Parent: 7760665fb8f4a85a244a9751a0a1d1cc46c157dc
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Wed Jun 24 20:43:35 2015 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Wed Jun 24 20:43:35 2015 +0100
man: Add missing env vars to lvm man page.
---
WHATS_NEW | 1 +
man/lvm.8.in | 35 +++++++++++++++++++++++++++++------
2 files changed, 30 insertions(+), 6 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 34f4cf0..41e5cc4 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.123 -
=================================
+ Add undocumented environment variables to lvm man page. (2.02.119)
Add device synchronization point before activating a new snapshot.
Add --withspaces to lvmconfig to add spaces in output for better readability.
diff --git a/man/lvm.8.in b/man/lvm.8.in
index b8b4854..685a4fc 100644
--- a/man/lvm.8.in
+++ b/man/lvm.8.in
@@ -518,8 +518,7 @@ Directory containing \fBlvm.conf\fP(5) and other LVM system files.
Defaults to "#DEFAULT_SYS_DIR#".
.TP
.B LVM_SUPPRESS_FD_WARNINGS
-Suppress warnings about openned file descriptors, when lvm command
-is executed.
+Suppress warnings about unexpected file descriptors passed into LVM.
.TP
.B LVM_VG_NAME
The Volume Group name that is assumed for
@@ -527,16 +526,40 @@ any reference to a Logical Volume that doesn't specify a path.
Not set by default.
.TP
.B LVM_LVMETAD_PIDFILE
-Path for the lvmetad pid file.
+Path to the file that stores the lvmetad process ID.
.TP
.B LVM_LVMETAD_SOCKET
-Path for the lvmetad socket file.
+Path to the socket used to communicate with lvmetad.
.TP
.B LVM_LVMPOLLD_PIDFILE
-Path for the lvmpolld pid file.
+Path to the file that stores the lvmpolld process ID.
.TP
.B LVM_LVMPOLLD_SOCKET
-Path for the lvmpolld socket file.
+Path to the socket used to communicate with lvmpolld..
+.TP
+.B LVM_LOG_FILE_EPOCH
+A string of up to 32 letters appended to the log filename and
+followed by the process ID and a timestamp. When set, each process logs to a
+separate file.
+.TP
+.B LVM_EXPECTED_EXIT_STATUS
+The status anticipated when the process exits. Use ">N" to match any
+status greater than N. If the actual exit status matches and a log
+file got produced, it is deleted.
+
+LVM_LOG_FILE_EPOCH and LVM_EXPECTED_EXIT_STATUS together allow
+automated test scripts to discard uninteresting log data.
+.TP
+.B LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES
+Used to suppress warning messages when the configured locking is known
+to be unavailable.
+.TP
+.B DM_ABORT_ON_INTERNAL_ERRORS
+Abort processing if the code detects a non-fatal internal error.
+.TP
+.B DM_DISABLE_UDEV
+Avoid interaction with udev. LVM will manage the relevant nodes in /dev
+directly.
.SH FILES
.I #DEFAULT_SYS_DIR#/lvm.conf
.br
8 years, 10 months
master - libdaemon: add comment about using main and init
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=7760665fb8f4a8...
Commit: 7760665fb8f4a85a244a9751a0a1d1cc46c157dc
Parent: 44c7bc0262b6719efe75ecb6eb32eaab359e5779
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Jun 24 12:16:26 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Jun 24 12:16:26 2015 -0500
libdaemon: add comment about using main and init
---
libdaemon/server/daemon-server.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/libdaemon/server/daemon-server.c b/libdaemon/server/daemon-server.c
index ef0b964..8eda8cf 100644
--- a/libdaemon/server/daemon-server.c
+++ b/libdaemon/server/daemon-server.c
@@ -604,6 +604,11 @@ void daemon_start(daemon_state s)
if (!s.foreground)
kill(getppid(), SIGTERM);
+ /*
+ * Use daemon_main for daemon-specific init and polling, or
+ * use daemon_init for daemon-specific init and generic lib polling.
+ */
+
if (s.daemon_main) {
if (!s.daemon_main(&s))
failed = 1;
8 years, 10 months
master - tests: workaround udev problem
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=44c7bc0262b671...
Commit: 44c7bc0262b6719efe75ecb6eb32eaab359e5779
Parent: e217873ed6ef7d77974fa10bfee4609160d7091d
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Jun 24 13:21:21 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Jun 24 15:19:53 2015 +0200
tests: workaround udev problem
If udev has not removed 'dir' entry - just issue TEST WARNING, clear
dir, but do not fail whole rest of test.
---
test/shell/profiles-thin.sh | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/test/shell/profiles-thin.sh b/test/shell/profiles-thin.sh
index 0c7fb61..5940cc6 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"
8 years, 10 months
master - snapshot: add synchronization point
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=e217873ed6ef7d...
Commit: e217873ed6ef7d77974fa10bfee4609160d7091d
Parent: cf189a572ae6fa6f7e00047925ebc965e57c6a8b
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Jun 24 15:12:43 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Jun 24 15:18:49 2015 +0200
snapshot: add synchronization point
Synchronize with udev logic before reusing device as snapshot.
This patch tries to fix the problem with udev, where we manage
to 'active' LV for clearing, then we deactivate such device and
active again as member of 'origin&snapshot' tree all in 1 step.
There needs to be a sync point where udev has time to remove all links,
otherwise we race with scans and we may end-up with mysterious 'free'
links in the system pointing to wrong dm names.
This patch tries to fix failing topology cluster tests..
---
WHATS_NEW | 1 +
lib/metadata/lv_manip.c | 3 +++
2 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 94766af..34f4cf0 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
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/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 07f119a..de96743 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -7446,6 +7446,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,
8 years, 10 months