1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-10 16:58:47 +03:00

dmeventd: add more debug messages

This commit is contained in:
Zdenek Kabelac 2015-10-10 16:36:18 +02:00
parent 13086c2523
commit 0e27210308
3 changed files with 17 additions and 3 deletions

View File

@ -874,7 +874,7 @@ static void *_monitor_thread(void *arg)
}
}
DEBUGLOG("Finished _monitor_thread");
DEBUGLOG("Finished _monitor_thread.");
pthread_cleanup_pop(1);
return NULL;
@ -1120,6 +1120,8 @@ static int _unregister_for_event(struct message_data *message_data)
}
_unlock_mutex();
DEBUGLOG("Unregistered uuid:%s.", thread->device.uuid);
out:
return ret;
}
@ -1147,6 +1149,7 @@ static int _registered_device(struct message_data *message_data,
return -ENOMEM;
msg->size = (uint32_t) r;
DEBUGLOG("Registered %s.", msg->data);
return 0;
}
@ -1154,6 +1157,7 @@ static int _registered_device(struct message_data *message_data,
static int _want_registered_device(char *dso_name, char *device_uuid,
struct thread_status *thread)
{
DEBUGLOG("Looking for dso:%s uuid:%s.", dso_name, device_uuid);
/* If DSO names and device paths are equal. */
if (dso_name && device_uuid)
return !strcmp(dso_name, thread->dso_data->dso_name) &&
@ -1175,6 +1179,9 @@ static int _get_registered_dev(struct message_data *message_data, int next)
struct thread_status *thread, *hit = NULL;
int ret = -ENOENT;
DEBUGLOG("Get%s dso:%s uuid:%s.", next ? "" : "Next",
message_data->dso_name,
message_data->device_uuid);
_lock_mutex();
/* Iterate list of threads checking if we want a particular one. */
@ -1205,8 +1212,10 @@ static int _get_registered_dev(struct message_data *message_data, int next)
goto reg;
}
if (!hit)
if (!hit) {
DEBUGLOG("Get%s not registered", next ? "" : "Next");
goto out;
}
while (1) {
if (dm_list_end(&_thread_registry, &thread->list))
@ -1613,9 +1622,9 @@ static void _cleanup_unused_threads(void)
}
if (thread->status == DM_THREAD_DONE) {
DEBUGLOG("Destroying Thr %x.", (int)thread->thread);
dm_list_del(l);
_unlock_mutex();
DEBUGLOG("Destroying Thr %x.", (int)thread->thread);
join_ret = pthread_join(thread->thread, NULL);
_free_thread_status(thread);
_lock_mutex();

View File

@ -74,6 +74,7 @@ int dmeventd_lvm2_init(void)
lvm2_disable_dmeventd_monitoring(_lvm_handle);
/* FIXME Temporary: move to dmeventd core */
lvm2_run(_lvm_handle, "_memlock_inc");
log_debug("lvm plugin initilized.");
}
_register_count++;
@ -89,14 +90,17 @@ void dmeventd_lvm2_exit(void)
pthread_mutex_lock(&_register_mutex);
if (!--_register_count) {
log_debug("lvm plugin shuting down.");
lvm2_run(_lvm_handle, "_memlock_dec");
dm_pool_destroy(_mem_pool);
_mem_pool = NULL;
log_debug("lvm plugin exiting.");
lvm2_exit(_lvm_handle);
_lvm_handle = NULL;
}
pthread_mutex_unlock(&_register_mutex);
log_debug("lvm plugin exited.");
}
struct dm_pool *dmeventd_lvm2_pool(void)

View File

@ -152,6 +152,7 @@ void process_event(struct dm_task *dmt,
if (status->invalid) {
struct dm_info info;
log_error("Snapshot %s is lost.", device);
if (dm_task_get_info(dmt, &info)) {
dmeventd_lvm2_unlock();
_umount(device, info.major, info.minor);