lvm2/display-dm-name-for-lv-name.diff

57 lines
2.7 KiB
Diff
Raw Normal View History

---
lib/config/config_settings.h | 3 +++
lib/config/defaults.h | 1 +
lib/display/display.c | 13 +++++++++----
3 files changed, 13 insertions(+), 4 deletions(-)
Index: LVM2.2.02.139/lib/config/config_settings.h
===================================================================
--- LVM2.2.02.139.orig/lib/config/config_settings.h
+++ LVM2.2.02.139/lib/config/config_settings.h
@@ -947,6 +947,9 @@ cfg_array(global_cache_check_options_CFG
cfg_array(global_cache_repair_options_CFG, "cache_repair_options", global_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_COMMENTED, 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_display_dm_name_for_lv_name_CFG, "display_dm_name_for_lv_name", global_CFG_SECTION, CFG_DEFAULT_COMMENTED, CFG_TYPE_BOOL, DEFAULT_DISPLAY_DM_NAME_FOR_LV_NAME, vsn(2, 2, 98), NULL, 0, NULL,
+ "Display dm name for lv name.\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,
"The method LVM uses to set the local system ID.\n"
"Volume Groups can also be given a system ID (by vgcreate, vgchange,\n"
Index: LVM2.2.02.139/lib/config/defaults.h
===================================================================
--- LVM2.2.02.139.orig/lib/config/defaults.h
+++ LVM2.2.02.139/lib/config/defaults.h
@@ -33,6 +33,7 @@
#define DEFAULT_OBTAIN_DEVICE_LIST_FROM_UDEV 1
#define DEFAULT_EXTERNAL_DEVICE_INFO_SOURCE "none"
#define DEFAULT_SYSFS_SCAN 1
+#define DEFAULT_DISPLAY_DM_NAME_FOR_LV_NAME 0
#define DEFAULT_MD_COMPONENT_DETECTION 1
#define DEFAULT_FW_RAID_COMPONENT_DETECTION 0
#define DEFAULT_MD_CHUNK_ALIGNMENT 1
Index: LVM2.2.02.139/lib/display/display.c
===================================================================
--- LVM2.2.02.139.orig/lib/display/display.c
+++ LVM2.2.02.139/lib/display/display.c
@@ -371,10 +371,15 @@ int lvdisplay_full(struct cmd_context *c
lv->vg->cmd->dev_dir, lv->vg->name, lv->name);
else if (lv_is_visible(lv)) {
/* Thin pool does not have /dev/vg/name link */
- if (!lv_is_thin_pool(lv))
- log_print("LV Path %s%s/%s",
- lv->vg->cmd->dev_dir,
- lv->vg->name, lv->name);
+ if (!lv_is_thin_pool(lv)) {
+ if (find_config_tree_bool(cmd, global_display_dm_name_for_lv_name_CFG, NULL)) {
+ log_print("LV Path %smapper/%s-%s", lv->vg->cmd->dev_dir,
+ lv->vg->name, lv->name);
+ } else {
+ log_print("LV Path %s%s/%s", lv->vg->cmd->dev_dir,
+ lv->vg->name, lv->name);
+ }
+ }
log_print("LV Name %s", lv->name);
} else
log_print("Internal LV Name %s", lv->name);