diff --git a/src/conf/domain_event.c b/src/conf/domain_event.c index 5e5bac5e7808a240def9fc06d6a07c1ad4995a38..df370f60a04737a8b57aaff2ef126804085743a4 100644 --- a/src/conf/domain_event.c +++ b/src/conf/domain_event.c @@ -424,7 +424,7 @@ virDomainEventCallbackListMarkDelete(virConnectPtr conn, if (cbList->callbacks[i]->cb == VIR_OBJECT_EVENT_CALLBACK(callback) && cbList->callbacks[i]->eventID == VIR_DOMAIN_EVENT_ID_LIFECYCLE && cbList->callbacks[i]->conn == conn) { - cbList->callbacks[i]->deleted = 1; + cbList->callbacks[i]->deleted = true; for (i = 0; i < cbList->count; i++) { if (!cbList->callbacks[i]->deleted) ret++; diff --git a/src/conf/object_event.c b/src/conf/object_event.c index dad98d63f769c36004f2d85314f1f71f1b49c2c9..5173fdf618b2877801a2c1427d6d3e9bce5be13e 100644 --- a/src/conf/object_event.c +++ b/src/conf/object_event.c @@ -171,7 +171,7 @@ virObjectEventCallbackListMarkDeleteID(virConnectPtr conn, for (i = 0; i < cbList->count; i++) { if (cbList->callbacks[i]->callbackID == callbackID && cbList->callbacks[i]->conn == conn) { - cbList->callbacks[i]->deleted = 1; + cbList->callbacks[i]->deleted = true; for (i = 0; i < cbList->count; i++) { if (!cbList->callbacks[i]->deleted) ret++; @@ -577,18 +577,18 @@ virObjectEventQueuePush(virObjectEventQueuePtr evtQueue, } -static int +static bool virObjectEventDispatchMatchCallback(virObjectEventPtr event, virObjectEventCallbackPtr cb) { if (!cb) - return 0; + return false; if (cb->deleted) - return 0; + return false; if (!virObjectIsClass(event, cb->klass)) - return 0; + return false; if (cb->eventID != event->eventID) - return 0; + return false; if (cb->meta) { /* Deliberately ignoring 'id' for matching, since that @@ -597,13 +597,9 @@ virObjectEventDispatchMatchCallback(virObjectEventPtr event, * Xen sometimes renames guests during migration, thus * leaving 'uuid' as the only truly reliable ID we can use. */ - if (memcmp(event->meta.uuid, cb->meta->uuid, VIR_UUID_BUFLEN) == 0) - return 1; - - return 0; - } else { - return 1; + return memcmp(event->meta.uuid, cb->meta->uuid, VIR_UUID_BUFLEN) == 0; } + return true; } diff --git a/src/conf/object_event_private.h b/src/conf/object_event_private.h index bc80425a32df7a0569b5c8014b03bae87567ba2e..d2e466683620b5be1b788d2fb71dbaf44869fa2f 100644 --- a/src/conf/object_event_private.h +++ b/src/conf/object_event_private.h @@ -67,7 +67,7 @@ struct _virObjectEventCallback { virConnectObjectEventGenericCallback cb; void *opaque; virFreeCallback freecb; - int deleted; + bool deleted; }; typedef void