master - pvs: replace 'unknown device' with [unknown]
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=57cd94b9e3b74c65f34eb2c40096cbbac024e986 Commit: 57cd94b9e3b74c65f34eb2c40096cbbac024e986 Parent: afae3355f8e79b8fab8d5bc45f99caf0d8b2420c Author: David Teigland <[email protected]> AuthorDate: Mon Feb 29 13:38:31 2016 -0600 Committer: David Teigland <[email protected]> CommitterDate: Tue Mar 1 11:12:03 2016 -0600
pvs: replace 'unknown device' with [unknown]
A config setting can restore the old string.
--- lib/commands/toolcontext.c | 3 +++ lib/config/config_settings.h | 4 ++++ lib/config/defaults.h | 1 + lib/device/dev-cache.c | 2 +- lib/misc/lvm-globals.c | 12 ++++++++++++ lib/misc/lvm-globals.h | 2 ++ 6 files changed, 23 insertions(+), 1 deletions(-)
lib/commands/toolcontext.c +3 -0
@@ -675,6 +675,9 @@ static int _process_config(struct cmd_context *cmd)if (!process_profilable_config (cmd)) return_0; +if (find_config_tree_bool (cmd, report_two_word_unknown_device_CFG,NULL )) +init_unknown_device_name ("unknown device" ); +init_detect_internal_vg_cache_corruption (find_config_tree_bool (cmd, global_detect_internal_vg_cache_corruption_CFG,NULL ));
lib/config/config_settings.h +4 -0
@@ -1682,6 +1682,10 @@ cfg(report_pvsegs_cols_verbose_CFG, "pvsegs_cols_verbose", report_CFG_SECTION, Ccfg (report_mark_hidden_devices_CFG,"mark_hidden_devices" , report_CFG_SECTION,CFG_PROFILABLE |CFG_DEFAULT_COMMENTED ,CFG_TYPE_BOOL ,1 ,vsn (2 ,2 ,140 ),NULL ,0 ,NULL , "Use brackets [] to mark hidden devices.\n") +cfg (report_two_word_unknown_device_CFG,"two_word_unknown_device" , report_CFG_SECTION,CFG_DEFAULT_COMMENTED ,CFG_TYPE_BOOL ,0 ,vsn (2 ,2 ,146 ),NULL ,0 ,NULL , +"Use the two words 'unknown device' in place of '[unknown]'.\n" + "This is displayed when the device for a PV is not known.\n") +cfg (dmeventd_mirror_library_CFG,"mirror_library" , dmeventd_CFG_SECTION,0 ,CFG_TYPE_STRING ,DEFAULT_DMEVENTD_MIRROR_LIB ,vsn (1 ,2 ,3 ),NULL ,0 ,NULL ,"The library dmeventd uses when monitoring a mirror device.\n" "libdevmapper-event-lvm2mirror.so attempts to recover from\n"
lib/config/defaults.h +1 -0
@@ -56,6 +56,7 @@#define DEFAULT_USE_MLOCKALL 0#define DEFAULT_METADATA_READ_ONLY 0#define DEFAULT_LVDISPLAY_SHOWS_FULL_DEVICE_PATH 0 +#define DEFAULT_UNKNOWN_DEVICE_NAME "[unknown]"#define DEFAULT_SANLOCK_LV_EXTEND_MB 256
lib/device/dev-cache.c +1 -1
@@ -1108,5 +1108,5 @@ int dev_fd(struct device *dev)const char *dev_name (const struct device *dev) { return (dev && dev->aliases.n) ? dm_list_item(dev->aliases.n, struct dm_str_list)->str : -"unknown device" ; +unknown_device_name (); }
lib/misc/lvm-globals.c +12 -0
@@ -55,6 +55,7 @@ static int _dev_disable_after_error_count = DEFAULT_DISABLE_AFTER_ERROR_COUNT;static uint64_t _pv_min_size = (DEFAULT_PV_MIN_SIZE_KB *1024L >>SECTOR_SHIFT );static int _detect_internal_vg_cache_corruption =DEFAULT_DETECT_INTERNAL_VG_CACHE_CORRUPTION ; +static const char *_unknown_device_name =DEFAULT_UNKNOWN_DEVICE_NAME ;void init_verbose (int level) {
@@ -379,3 +380,14 @@ int detect_internal_vg_cache_corruption(void) {return _detect_internal_vg_cache_corruption; } + +const char *unknown_device_name (void ) +{ +return _unknown_device_name; +} + +void init_unknown_device_name (const char *name) +{ + _unknown_device_name = name; +} +
lib/misc/lvm-globals.h +2 -0
@@ -52,6 +52,7 @@ void init_pv_min_size(uint64_t sectors);void init_activation_checks (int checks);void init_detect_internal_vg_cache_corruption (int detect);void init_retry_deactivation (int retry); +void init_unknown_device_name (const char *name);void set_cmd_name (const char *cmd_name);const char *get_cmd_name (void );
@@ -84,6 +85,7 @@ uint64_t pv_min_size(void);int activation_checks (void );int detect_internal_vg_cache_corruption (void );int retry_deactivation (void ); +const char *unknown_device_name (void );#define DMEVENTD_MONITOR_IGNORE -1int dmeventd_monitor_mode (void );