summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikolay Shirokovskiy <nshirokovskiy@parallels.com>2015-06-04 14:45:02 +0300
committerDmitry Guryanov <dguryanov@parallels.com>2015-06-08 20:13:29 +0300
commitc71f5f8cee3fe4078c3ab8aa7c46de7210b468c6 (patch)
tree436b23dc3993e5145f6aa54965ba7da305ead6f4
parentceb46a662dcca71e46cf67247bfa18cb3ae240d3 (diff)
downloadlibvirt-c71f5f8cee3fe4078c3ab8aa7c46de7210b468c6.tar.gz
parallels: simplify event types discrimination
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.
-rw-r--r--src/parallels/parallels_sdk.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/parallels/parallels_sdk.c b/src/parallels/parallels_sdk.c
index 05f11b0d42..e1abf624d0 100644
--- a/src/parallels/parallels_sdk.c
+++ b/src/parallels/parallels_sdk.c
@@ -1699,7 +1699,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);
@@ -1715,20 +1715,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;