Use issuer type instead of event type to group vm related events. This saves us from explicit enumeration of all vm event types in prlsdkHandleVmEvent. --- src/parallels/parallels_sdk.c | 15 +++++---------- 1 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/parallels/parallels_sdk.c b/src/parallels/parallels_sdk.c index 88ad59b..d5a9790 100644 --- a/src/parallels/parallels_sdk.c +++ b/src/parallels/parallels_sdk.c @@ -1681,7 +1681,7 @@ prlsdkEventsHandler(PRL_HANDLE prlEvent, PRL_VOID_PTR opaque) parallelsConnPtr privconn = opaque; PRL_RESULT pret = PRL_ERR_UNINITIALIZED; PRL_HANDLE_TYPE handleType; - PRL_EVENT_TYPE prlEventType; + PRL_EVENT_ISSUER_TYPE prlIssuerType = PIE_UNKNOWN; pret = PrlHandle_GetType(prlEvent, &handleType); prlsdkCheckRetGoto(pret, cleanup); @@ -1697,20 +1697,15 @@ prlsdkEventsHandler(PRL_HANDLE prlEvent, PRL_VOID_PTR opaque) goto cleanup; } - PrlEvent_GetType(prlEvent, &prlEventType); + PrlEvent_GetIssuerType(prlEvent, &prlIssuerType); prlsdkCheckRetGoto(pret, cleanup); - switch (prlEventType) { - case PET_DSP_EVT_VM_STATE_CHANGED: - case PET_DSP_EVT_VM_CONFIG_CHANGED: - case PET_DSP_EVT_VM_CREATED: - case PET_DSP_EVT_VM_ADDED: - case PET_DSP_EVT_VM_DELETED: - case PET_DSP_EVT_VM_UNREGISTERED: + switch (prlIssuerType) { + case PIE_VIRTUAL_MACHINE: pret = prlsdkHandleVmEvent(privconn, prlEvent); break; default: - VIR_DEBUG("Skipping event of type %d", prlEventType); + VIR_DEBUG("Skipping event of issuer type %d", prlIssuerType); } pret = PRL_ERR_SUCCESS; -- 1.7.1 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list