master - dmsetup: fix 'splitname -o' to not fail if used without '-c'
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=521a0a3323507e...
Commit: 521a0a3323507e1d07568d3047283975e66ca193
Parent: cbfb5a98b5dbe699aaafbced00120f60aaa35231
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Tue Mar 12 12:37:24 2013 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Tue Mar 12 13:01:57 2013 +0100
dmsetup: fix 'splitname -o' to not fail if used without '-c'
This was a regression introduced with e33fd978a8a56228677c14612fce99b3b3588125
(libdm v1.02.68/lvm2 v2.02.89) with the introduction of new output
fields blkdevname and blkdevs_used for ls and deps dmsetup commands.
A new common '_process_options' fn was added with that commit, but the
fn was called prematurely which then broke processing of
'dmsetup splitname -o' which should implicitly use '-c' option
and this was failing after the commit:
alatyr/~ $ dmsetup splitname -o lv_name /dev/mapper/vg_data-test
Option not recognised: lv_name
Couldn't process command line.
The '-c' had to be used for correct operation:
alatyr/~ $ dmsetup splitname -c -o lv_name /dev/mapper/vg_data-test
LV
test
Now fixed to work as it did before:
alatyr/~ $ dmsetup splitname -o lv_name /dev/mapper/vg_data-test
LV
test
---
WHATS_NEW_DM | 1 +
tools/dmsetup.c | 8 +++++---
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 3bf8927..98ffa6f 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,6 @@
Version 1.02.78 -
===================================
+ Fix 'dmsetup splitname -o' to not fail if used without '-c' switch (1.02.68).
Add dm_config_write_{node_out/one_node_out} for enhanced config output.
Add dm_config_value_is_bool to check for boolean value in supported formats.
Fix config node lookup inside empty sections to not return the section itself.
diff --git a/tools/dmsetup.c b/tools/dmsetup.c
index 8b1145f..ce46d6c 100644
--- a/tools/dmsetup.c
+++ b/tools/dmsetup.c
@@ -3749,9 +3749,6 @@ static int _process_switches(int *argc, char ***argv, const char *dev_dir)
return 0;
}
- if (!_process_options(_string_args[OPTIONS_ARG]))
- return 0;
-
if (_switches[TABLE_ARG] && _switches[NOTABLE_ARG]) {
fprintf(stderr, "--table and --notable are incompatible.\n");
return 0;
@@ -3824,6 +3821,11 @@ int main(int argc, char **argv)
if (!strcmp(cmd->name, "mangle"))
dm_set_name_mangling_mode(DM_STRING_MANGLING_NONE);
+ if (!_process_options(_string_args[OPTIONS_ARG])) {
+ fprintf(stderr, "Couldn't process command line.\n");
+ goto out;
+ }
+
if (_switches[COLS_ARG]) {
if (!_report_init(cmd))
goto out;
11 years, 1 month
master - filters: power2 devs get precedence if PVIDs match
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=cbfb5a98b5dbe6...
Commit: cbfb5a98b5dbe699aaafbced00120f60aaa35231
Parent: 69ae454d4d46228a5de3b95a2ddcd8b8307fed4a
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Mon Mar 11 20:10:49 2013 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Mon Mar 11 20:10:49 2013 +0000
filters: power2 devs get precedence if PVIDs match
Give precedence to EMC "power2" devices with duplicate PVIDs like
we already do with "emcpower" devices.
---
WHATS_NEW | 1 +
lib/filters/filter.c | 10 ++++++++++
2 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index d7dda58..082b414 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.99 -
===================================
+ Give precedence to EMC power2 devices with duplicate PVIDs.
Add --validate option to lvm dumpconfig to validate current config on demand.
Add --ignoreadvanced and --ignoreunsupported switch to lvm dumpconfig.
Add --withcomments and --withversions switch to lvm dumpconfig.
diff --git a/lib/filters/filter.c b/lib/filters/filter.c
index 6981b94..7925440 100644
--- a/lib/filters/filter.c
+++ b/lib/filters/filter.c
@@ -42,6 +42,7 @@ static int _blkext_major = -1;
static int _drbd_major = -1;
static int _device_mapper_major = -1;
static int _emcpower_major = -1;
+static int _power2_major = -1;
int dm_major(void)
{
@@ -71,6 +72,9 @@ int dev_subsystem_part_major(const struct device *dev)
if (MAJOR(dev->dev) == _emcpower_major)
return 1;
+ if (MAJOR(dev->dev) == _power2_major)
+ return 1;
+
if ((MAJOR(dev->dev) == _blkext_major) &&
(get_primary_dev(sysfs_dir_path(), dev, &primary_dev)) &&
(MAJOR(primary_dev) == _md_major))
@@ -90,6 +94,9 @@ const char *dev_subsystem_name(const struct device *dev)
if (MAJOR(dev->dev) == _emcpower_major)
return "EMCPOWER";
+ if (MAJOR(dev->dev) == _power2_major)
+ return "POWER2";
+
if (MAJOR(dev->dev) == _blkext_major)
return "BLKEXT";
@@ -228,6 +235,9 @@ static int _scan_proc_dev(const char *proc, const struct dm_config_node *cn)
if (!strncmp("emcpower", line + i, 8) && isspace(*(line + i + 8)))
_emcpower_major = line_maj;
+ if (!strncmp("power2", line + i, 6) && isspace(*(line + i + 6)))
+ _power2_major = line_maj;
+
/* Look for device-mapper device */
/* FIXME Cope with multiple majors */
if (!strncmp("device-mapper", line + i, 13) && isspace(*(line + i + 13)))
11 years, 1 month
master - test: Fix the way in_sync calculates the sync field location
by Jonathan Brassow
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=69ae454d4d4622...
Commit: 69ae454d4d46228a5de3b95a2ddcd8b8307fed4a
Parent: 31c24dd9f2ad7b5f7913a18c9f11a00d7b3474a1
Author: Jonathan Brassow <jbrassow(a)redhat.com>
AuthorDate: Wed Mar 6 11:12:09 2013 -0600
Committer: Jonathan Brassow <jbrassow(a)redhat.com>
CommitterDate: Wed Mar 6 11:12:09 2013 -0600
test: Fix the way in_sync calculates the sync field location
'in_sync' was using the last field in the RAID status output as
the location for the sync ratio field. The sync ratio may not always
be the last field, but it will always be the 7th field. So we switch
to using the absolute value rather than computing the last field
index number.
---
test/lib/check.sh | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/lib/check.sh b/test/lib/check.sh
index 6b7849f..48e3073 100644
--- a/test/lib/check.sh
+++ b/test/lib/check.sh
@@ -170,8 +170,8 @@ in_sync() {
fi
if [ ${a[2]} = "raid" ]; then
- # Last argument is the sync ratio for RAID
- idx=$((${#a[@]} - 1))
+ # 6th argument is the sync ratio for RAID
+ idx=6
type=${a[3]}
elif [ ${a[2]} = "mirror" ]; then
# 4th Arg tells us how far to the sync ratio
11 years, 1 month
master - RAID: Code changes missing from previous commit (bbc6378)
by Jonathan Brassow
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=31c24dd9f2ad7b...
Commit: 31c24dd9f2ad7b5f7913a18c9f11a00d7b3474a1
Parent: ed6f3945fd86385c172da5d6884c01d8c0b6a51b
Author: Jonathan Brassow <jbrassow(a)redhat.com>
AuthorDate: Wed Mar 6 10:17:11 2013 -0600
Committer: Jonathan Brassow <jbrassow(a)redhat.com>
CommitterDate: Wed Mar 6 10:17:11 2013 -0600
RAID: Code changes missing from previous commit (bbc6378)
Previous commit included changes to WHATSNEW, but the code changes
were missing. Here is the description from the previous commit:
commit bbc6378b73246d7ef00c16274fea38118531ae95
Author: Jonathan Brassow <jbrassow(a)redhat.com>
Date: Thu Feb 21 11:31:36 2013 -0600
RAID: Make 'lvchange --refresh' restore transiently failed RAID PVs
A new function (dm_tree_node_force_identical_table_reload) was added to
avoid the suppression of identical table reloads. This allows RAID LVs
to reload the on-disk superblock information that contains which devices
have failed and the bitmaps. If the failed device has returned, this has
the effect of restoring the device and initiating recovery. Without this
patch, the user had to completely deactivate their RAID LV and re-activate
it in order to restore the failed device. Now they simply need to
suspend and resume (which is done by 'lvchange --refresh').
The identical table suppression is only avoided if the LV is not PARTAIL
(i.e. all of it's devices can be seen and read by LVM) and the kernel
status of the array contains failed devices. In other words, the function
will only be called in the case where we may have success in restoring
a failed device in the array.
---
lib/raid/raid.c | 15 +++++++++++++++
libdm/libdevmapper.h | 3 ++-
libdm/libdm-deptree.c | 20 +++++++++++++++++++-
3 files changed, 36 insertions(+), 2 deletions(-)
diff --git a/lib/raid/raid.c b/lib/raid/raid.c
index 1e28c73..69b6ee3 100644
--- a/lib/raid/raid.c
+++ b/lib/raid/raid.c
@@ -161,6 +161,7 @@ static int _raid_add_target_line(struct dev_manager *dm __attribute__((unused)),
uint32_t s;
uint64_t flags = 0;
uint64_t rebuilds = 0;
+ char *raid_health = NULL;
if (!seg->area_count) {
log_error(INTERNAL_ERROR "_raid_add_target_line called "
@@ -190,6 +191,20 @@ static int _raid_add_target_line(struct dev_manager *dm __attribute__((unused)),
if (mirror_in_sync())
flags = DM_NOSYNC;
+ /*
+ * If the RAID LV is not 'PARTIAL' and the status indicates
+ * that the array has failed devices, it means that the
+ * failed devices have returned and can be reintegrated.
+ *
+ * We reload the (potentially identical) table to force the
+ * kernel to re-read the RAID superblocks - possibly restoring
+ * transiently failed devices.
+ */
+ if (!(seg->lv->status & PARTIAL_LV) &&
+ lv_raid_dev_health(seg->lv, &raid_health) &&
+ strchr(raid_health, 'D'))
+ dm_tree_node_force_identical_table_reload(node);
+
if (!dm_tree_node_add_raid_target(node, len, _raid_name(seg),
seg->region_size, seg->stripe_size,
rebuilds, flags))
diff --git a/libdm/libdevmapper.h b/libdm/libdevmapper.h
index 0460afa..184615f 100644
--- a/libdm/libdevmapper.h
+++ b/libdm/libdevmapper.h
@@ -491,13 +491,14 @@ struct dm_tree_node *dm_tree_next_child(void **handle,
uint32_t inverted);
/*
- * Get properties of a node.
+ * Get and set properties of a node.
*/
const char *dm_tree_node_get_name(const struct dm_tree_node *node);
const char *dm_tree_node_get_uuid(const struct dm_tree_node *node);
const struct dm_info *dm_tree_node_get_info(const struct dm_tree_node *node);
void *dm_tree_node_get_context(const struct dm_tree_node *node);
int dm_tree_node_size_changed(const struct dm_tree_node *dnode);
+int dm_tree_node_force_identical_table_reload(struct dm_tree_node *dnode);
/*
* Returns the number of children of the given node (excluding the root node).
diff --git a/libdm/libdm-deptree.c b/libdm/libdm-deptree.c
index 5e938d7..e702a25 100644
--- a/libdm/libdm-deptree.c
+++ b/libdm/libdm-deptree.c
@@ -232,6 +232,16 @@ struct load_properties {
/* Send messages for this node in preload */
unsigned send_messages;
+
+ /*
+ * If a mapping table is replacing an existing identical table,
+ * the load is suppressed by default - avoiding the construction
+ * of an unnecessary in-kernel table. Sometimes we want to avoid
+ * this optimization and load the identical table anyway. This
+ * field is used to indicate that we desire identical tables to be
+ * loaded and not suppressed.
+ */
+ unsigned force_identical_table_reload;
};
/* Two of these used to join two nodes with uses and used_by. */
@@ -587,6 +597,13 @@ int dm_tree_node_size_changed(const struct dm_tree_node *dnode)
return dnode->props.size_changed;
}
+int dm_tree_node_force_identical_table_reload(struct dm_tree_node *dnode)
+{
+ dnode->props.force_identical_table_reload = 1;
+ return 1;
+}
+
+
int dm_tree_node_num_children(const struct dm_tree_node *node, uint32_t inverted)
{
if (inverted) {
@@ -2409,7 +2426,8 @@ static int _load_node(struct dm_tree_node *dnode)
seg, &seg_start))
goto_out;
- if (!dm_task_suppress_identical_reload(dmt))
+ if (!dnode->props.force_identical_table_reload &&
+ !dm_task_suppress_identical_reload(dmt))
log_error("Failed to suppress reload of identical tables.");
if ((r = dm_task_run(dmt))) {
11 years, 1 month
master - clean-up: Typo 's/should had/should have/'
by Jonathan Brassow
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=ed6f3945fd8638...
Commit: ed6f3945fd86385c172da5d6884c01d8c0b6a51b
Parent: 6b777ccbb5dca4a6d80b8b0bf071993c049f6a9f
Author: Jonathan Brassow <jbrassow(a)redhat.com>
AuthorDate: Wed Mar 6 08:42:03 2013 -0600
Committer: Jonathan Brassow <jbrassow(a)redhat.com>
CommitterDate: Wed Mar 6 08:42:03 2013 -0600
clean-up: Typo 's/should had/should have/'
---
lib/activate/fs.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/activate/fs.c b/lib/activate/fs.c
index fe53349..7483044 100644
--- a/lib/activate/fs.c
+++ b/lib/activate/fs.c
@@ -205,7 +205,7 @@ static int _mk_link(const char *dev_dir, const char *vg_name,
return 0;
}
} else if (dm_udev_get_sync_support() && udev_checking() && check_udev)
- log_warn("The link %s should had been created by udev "
+ log_warn("The link %s should have been created by udev "
"but it was not found. Falling back to "
"direct link creation.", lv_path);
11 years, 1 month
master - cleanup: get rid of compiler's warning about possible unitialized variable
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=6b777ccbb5dca4...
Commit: 6b777ccbb5dca4a6d80b8b0bf071993c049f6a9f
Parent: f88690221bb23668e0b763d212b58eeaaa4150a4
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Wed Mar 6 12:53:27 2013 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Wed Mar 6 12:53:27 2013 +0100
cleanup: get rid of compiler's warning about possible unitialized variable
---
tools/dumpconfig.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/tools/dumpconfig.c b/tools/dumpconfig.c
index a340eb0..9ba451e 100644
--- a/tools/dumpconfig.c
+++ b/tools/dumpconfig.c
@@ -37,7 +37,7 @@ int dumpconfig(struct cmd_context *cmd, int argc, char **argv)
const char *type = arg_str_value(cmd, configtype_ARG, "current");
unsigned int major, minor, patchlevel;
struct config_def_tree_spec tree_spec = {0};
- struct dm_config_tree *cft;
+ struct dm_config_tree *cft = cmd->cft;
int r = ECMD_PROCESSED;
if (arg_count(cmd, configtype_ARG) && arg_count(cmd, validate_ARG)) {
@@ -71,7 +71,6 @@ int dumpconfig(struct cmd_context *cmd, int argc, char **argv)
log_error("--atversion has no effect with --type current");
return EINVALID_CMD_LINE;
}
- cft = cmd->cft;
tree_spec.type = CFG_DEF_TREE_CURRENT;
config_def_check(cmd, 1, 1, 1);
}
11 years, 1 month
master - config: make DEFAULT_MAX_HISTORY unconditional
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f88690221bb236...
Commit: f88690221bb23668e0b763d212b58eeaaa4150a4
Parent: 03b5c51730431ceb38c301293a19882b5829b84d
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Wed Mar 6 12:47:23 2013 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Wed Mar 6 12:47:23 2013 +0100
config: make DEFAULT_MAX_HISTORY unconditional
---
lib/config/defaults.h | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/lib/config/defaults.h b/lib/config/defaults.h
index cad9862..b8d46f1 100644
--- a/lib/config/defaults.h
+++ b/lib/config/defaults.h
@@ -145,9 +145,7 @@
#define DEFAULT_RAID_REGION_SIZE 512 /* KB */
#define DEFAULT_INTERVAL 15
-#ifdef READLINE_SUPPORT
-# define DEFAULT_MAX_HISTORY 100
-#endif
+#define DEFAULT_MAX_HISTORY 100
#define DEFAULT_MAX_ERROR_COUNT NO_DEV_ERROR_COUNT_LIMIT
11 years, 1 month
master - WHATS_NEW: add lines for config validation support
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=03b5c51730431c...
Commit: 03b5c51730431ceb38c301293a19882b5829b84d
Parent: 7d6991e900cbd5959e73285af81079bc22eadccb
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Wed Mar 6 10:38:40 2013 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Wed Mar 6 11:00:30 2013 +0100
WHATS_NEW: add lines for config validation support
---
WHATS_NEW | 5 +++++
WHATS_NEW_DM | 2 ++
2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 3a837aa..d7dda58 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,10 @@
Version 2.02.99 -
===================================
+ Add --validate option to lvm dumpconfig to validate current config on demand.
+ Add --ignoreadvanced and --ignoreunsupported switch to lvm dumpconfig.
+ Add --withcomments and --withversions switch to lvm dumpconfig.
+ Add --type {current|default|missing|new} and --atversion to lvm dumpconfig.
+ Support automatic config validation and add 'config' section to lvm.conf.
Add pvs -o ea_start,ea_size to report embedding area start and size.
Add --embeddingareasize to pvcreate and vgconvert to create an embedding area.
Add PV header extension: extension version, flags and embedding areas.
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 9d9c53d..3bf8927 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,7 @@
Version 1.02.78 -
===================================
+ Add dm_config_write_{node_out/one_node_out} for enhanced config output.
+ Add dm_config_value_is_bool to check for boolean value in supported formats.
Fix config node lookup inside empty sections to not return the section itself.
Extend support for status info of thin pool target.
Fix segfault for truncated string token in config file after the first '"'.
11 years, 1 month
master - dumpconfig: add --ignoreadvanced and --ignoreunsupported switch
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=7d6991e900cbd5...
Commit: 7d6991e900cbd5959e73285af81079bc22eadccb
Parent: 7fd04bd93a1ea3e86c90c396151424719f3e1b63
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Wed Mar 6 09:35:33 2013 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Wed Mar 6 10:46:36 2013 +0100
dumpconfig: add --ignoreadvanced and --ignoreunsupported switch
lvm dumpconfig [--ignoreadvanced] [--ignoreunsupported]
--ignoreadvanced causes the advanced configuration options to be left
out on dumpconfig output
--ignoreunsupported causes the options that are not officially supported
to be lef out on dumpconfig output
---
lib/config/config.c | 4 +++-
tools/args.h | 2 ++
tools/commands.h | 5 ++++-
tools/dumpconfig.c | 12 ++++++++++++
4 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/lib/config/config.c b/lib/config/config.c
index 1960b00..009eb5f 100644
--- a/lib/config/config.c
+++ b/lib/config/config.c
@@ -1080,7 +1080,9 @@ static struct dm_config_node *_add_def_node(struct dm_config_tree *cft,
static int _should_skip_def_node(struct config_def_tree_spec *spec, int section_id, cfg_def_item_t *def)
{
- if (def->parent != section_id)
+ if ((def->parent != section_id) ||
+ (spec->ignoreadvanced && def->flags & CFG_ADVANCED) ||
+ (spec->ignoreunsupported && def->flags & CFG_UNSUPPORTED))
return 1;
switch (spec->type) {
diff --git a/tools/args.h b/tools/args.h
index 1e85096..49ddcd2 100644
--- a/tools/args.h
+++ b/tools/args.h
@@ -82,6 +82,8 @@ arg(thinpool_ARG, '\0', "thinpool", string_arg, 0)
arg(configtype_ARG, '\0', "type", string_arg, 0)
arg(withcomments_ARG, '\0', "withcomments", NULL, 0)
arg(withversions_ARG, '\0', "withversions", NULL, 0)
+arg(ignoreadvanced_ARG, '\0', "ignoreadvanced", NULL, 0)
+arg(ignoreunsupported_ARG, '\0', "ignoreunsupported", NULL, 0)
arg(atversion_ARG, '\0', "atversion", string_arg, 0)
arg(validate_ARG, '\0', "validate", NULL, 0)
diff --git a/tools/commands.h b/tools/commands.h
index 36928c0..9aed9e7 100644
--- a/tools/commands.h
+++ b/tools/commands.h
@@ -36,11 +36,14 @@ xx(dumpconfig,
"\t[--type {current|default|missing|new} \n"
"\t[--withcomments] \n"
"\t[--withversions] \n"
+ "\t[--ignoreadvanced] \n"
+ "\t[--ignoreunsupported] \n"
"\t[--atversion version]] \n"
"\t[--validate]\n"
"\t[ConfigurationNode...]\n",
file_ARG, configtype_ARG, withcomments_ARG, atversion_ARG,
- withversions_ARG, validate_ARG)
+ withversions_ARG, ignoreadvanced_ARG, ignoreunsupported_ARG,
+ validate_ARG)
xx(formats,
"List available metadata formats",
diff --git a/tools/dumpconfig.c b/tools/dumpconfig.c
index 384f52d..a340eb0 100644
--- a/tools/dumpconfig.c
+++ b/tools/dumpconfig.c
@@ -50,6 +50,12 @@ int dumpconfig(struct cmd_context *cmd, int argc, char **argv)
return EINVALID_CMD_LINE;
}
+ if (arg_count(cmd, ignoreadvanced_ARG))
+ tree_spec.ignoreadvanced = 1;
+
+ if (arg_count(cmd, ignoreunsupported_ARG))
+ tree_spec.ignoreunsupported = 1;
+
if (arg_count(cmd, validate_ARG)) {
if (config_def_check(cmd, 1, 1, 0)) {
log_print("LVM configuration valid.");
@@ -82,6 +88,12 @@ int dumpconfig(struct cmd_context *cmd, int argc, char **argv)
return EINVALID_CMD_LINE;
}
+ if ((tree_spec.ignoreadvanced || tree_spec.ignoreunsupported) &&
+ (tree_spec.type == CFG_DEF_TREE_CURRENT)) {
+ log_error("--ignoreadvanced and --ignoreunsupported has no effect with --type current");
+ return EINVALID_CMD_LINE;
+ }
+
if (tree_spec.type != CFG_DEF_TREE_CURRENT) {
if (!_get_vsn(cmd, &major, &minor, &patchlevel))
return EINVALID_CMD_LINE;
11 years, 1 month
master - config: add comment note about advanced and unsupported config nodes
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=7fd04bd93a1ea3...
Commit: 7fd04bd93a1ea3e86c90c396151424719f3e1b63
Parent: 088d88cfe27ba6f5f78812af778cde54d4aed9c1
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Wed Mar 6 09:31:15 2013 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Wed Mar 6 10:46:36 2013 +0100
config: add comment note about advanced and unsupported config nodes
This shows up in the output as a short commentary:
$ lvm dumpconfig --type default --withcomments metadata/disk_areas
# Configuration option metadata/disk_areas.
# This configuration option is advanced.
# This configuration option is not officially supported.
disk_areas=""
---
lib/config/config.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/lib/config/config.c b/lib/config/config.c
index e8e0379..1960b00 100644
--- a/lib/config/config.c
+++ b/lib/config/config.c
@@ -838,6 +838,12 @@ static int _out_prefix_fn(const struct dm_config_node *cn, const char *line, voi
if (cfg_def->comment)
fprintf(out->fp, "%s# %s\n", line, cfg_def->comment);
+
+ if (cfg_def->flags & CFG_ADVANCED)
+ fprintf(out->fp, "%s# This configuration %s is advanced.\n", line, node_type_name);
+
+ if (cfg_def->flags & CFG_UNSUPPORTED)
+ fprintf(out->fp, "%s# This configuration %s is not officially supported.\n", line, node_type_name);
}
if (out->withversion) {
11 years, 1 month