1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-09-24 21:44:22 +03:00

Compare commits

...

1 Commits

Author SHA1 Message Date
David Teigland
892584ee75 clvmd: add L option to enable lvm debugging 2019-08-05 14:08:52 -05:00
2 changed files with 19 additions and 1 deletions

View File

@@ -69,6 +69,8 @@ static unsigned max_csid_len;
static unsigned max_cluster_message;
static unsigned max_cluster_member_name_len;
int clvmd_debug_lvm;
static void _add_client(struct local_client *new_client, struct local_client *existing_client)
{
_local_client_count++;
@@ -411,7 +413,7 @@ int main(int argc, char *argv[])
/* Deal with command-line arguments */
opterr = 0;
optind = 0;
while ((opt = getopt_long(argc, argv, "Vhfd:t:RST:CI:E:",
while ((opt = getopt_long(argc, argv, "Vhfd:t:RST:CLI:E:",
longopts, NULL)) != -1) {
switch (opt) {
case 'h':
@@ -432,6 +434,10 @@ int main(int argc, char *argv[])
clusterwide_opt = 1;
break;
case 'L':
clvmd_debug_lvm = 1;
break;
case 'd':
debug_opt = DEBUG_STDERR;
debug_arg = (debug_t) atoi(optarg);

View File

@@ -38,6 +38,8 @@ static pthread_mutex_t lv_hash_lock;
static pthread_mutex_t lvm_lock;
static char last_error[1024];
extern int clvmd_debug_lvm;
struct lv_info {
int lock_id;
int lock_mode;
@@ -656,6 +658,11 @@ int do_refresh_cache(void)
label_scan_destroy(cmd); /* destroys bcache (to close devs), keeps lvmcache */
dm_pool_empty(cmd->mem);
if (clvmd_debug_lvm) {
init_verbose(11);
init_debug(11);
}
pthread_mutex_unlock(&lvm_lock);
return 0;
@@ -909,6 +916,11 @@ int init_clvm(struct dm_hash_table *excl_uuid)
check_config();
init_ignore_suspended_devices(1);
if (clvmd_debug_lvm) {
init_verbose(11);
init_debug(11);
}
/* Trap log messages so we can pass them back to the user */
init_log_fn(lvm2_log_fn);
memlock_inc_daemon(cmd);