From: Pavel Rochnyack Date: Tue, 12 Mar 2019 15:51:33 +0000 (+0700) Subject: virt plugin: Changed place of event loop start/stop debug messages output X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=298e38eb0a19efa15e474ab82a5873918a4edac3;p=collectd.git virt plugin: Changed place of event loop start/stop debug messages output --- diff --git a/src/virt.c b/src/virt.c index 00227dd8..214ddace 100644 --- a/src/virt.c +++ b/src/virt.c @@ -2055,6 +2055,8 @@ static int start_event_loop(virt_notif_thread_t *thread_data) { return -1; } + DEBUG(PLUGIN_NAME " plugin: starting event loop"); + virt_notif_thread_set_active(thread_data, 1); if (pthread_create(&thread_data->event_loop_tid, NULL, event_loop_worker, thread_data)) { @@ -2070,6 +2072,9 @@ static int start_event_loop(virt_notif_thread_t *thread_data) { /* stop event loop thread and deregister callback */ static void stop_event_loop(virt_notif_thread_t *thread_data) { + + DEBUG(PLUGIN_NAME " plugin: stopping event loop"); + /* Stopping loop */ if (virt_notif_thread_is_active(thread_data)) { virt_notif_thread_set_active(thread_data, 0); @@ -2312,8 +2317,6 @@ static int lv_init(void) { if (lv_connect() != 0) return -1; - DEBUG(PLUGIN_NAME " plugin: starting event loop"); - if (!persistent_notification) { virt_notif_thread_init(¬if_thread); if (start_event_loop(¬if_thread) != 0) @@ -2822,8 +2825,6 @@ static int lv_shutdown(void) { lv_fini_instance(i); } - DEBUG(PLUGIN_NAME " plugin: stopping event loop"); - if (!persistent_notification) stop_event_loop(¬if_thread);