From: "Eduardo Lima (Etrunko)" <eblima(a)br.ibm.com>
Signed-off-by: Eduardo Lima (Etrunko) <eblima(a)br.ibm.com>
---
src/Virt_ComputerSystemIndication.c | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/src/Virt_ComputerSystemIndication.c b/src/Virt_ComputerSystemIndication.c
index 712e12c..ab6ffe4 100644
--- a/src/Virt_ComputerSystemIndication.c
+++ b/src/Virt_ComputerSystemIndication.c
@@ -489,11 +489,11 @@ static int update_domain_list(virConnectPtr conn, csi_thread_data_t
*thread)
return s.rc;
}
-static int csi_domain_event_cb(virConnectPtr conn,
- virDomainPtr dom,
- int event,
- int detail,
- void *data)
+static void csi_domain_event_cb(virConnectPtr conn,
+ virDomainPtr dom,
+ int event,
+ int detail,
+ void *data)
{
int cs_event = CS_MODIFIED;
csi_thread_data_t *thread = (csi_thread_data_t *) data;
@@ -501,6 +501,11 @@ static int csi_domain_event_cb(virConnectPtr conn,
char *prefix = class_prefix_name(thread->args->classname);
CMPIStatus s = {CMPI_RC_OK, NULL};
+ if (lifecycle_enabled == false || thread->active_filters <= 0) {
+ CU_DEBUG("%s indications deactivated, return");
+ return;
+ }
+
CU_DEBUG("Event: Domain %s(%d) event: %d detail: %d\n",
virDomainGetName(dom), virDomainGetID(dom), event, detail);
@@ -557,7 +562,6 @@ static int csi_domain_event_cb(virConnectPtr conn,
end:
free(prefix);
- return 0;
}
static CMPI_THREAD_RETURN lifecycle_thread(void *params)
--
1.7.7.6