event-test: Add VIR_DOMAIN_EVENT_ID_JOB_COMPLETED

This commit is contained in:
Peter Krempa 2016-04-14 17:31:52 +02:00
parent bb25001a5b
commit 9e9a5cf0f4

View File

@ -624,19 +624,12 @@ myNetworkEventCallback(virConnectPtr conn ATTRIBUTE_UNUSED,
return 0;
}
static int
myDomainEventTunableCallback(virConnectPtr conn ATTRIBUTE_UNUSED,
virDomainPtr dom,
virTypedParameterPtr params,
int nparams,
void *opaque ATTRIBUTE_UNUSED)
static void
eventTypedParamsPrint(virTypedParameterPtr params,
int nparams)
{
size_t i;
printf("%s EVENT: Domain %s(%d) tunable updated:\n",
__func__, virDomainGetName(dom), virDomainGetID(dom));
for (i = 0; i < nparams; i++) {
switch (params[i].type) {
case VIR_TYPED_PARAM_INT:
@ -666,6 +659,20 @@ myDomainEventTunableCallback(virConnectPtr conn ATTRIBUTE_UNUSED,
printf("\t%s: unknown type\n", params[i].field);
}
}
}
static int
myDomainEventTunableCallback(virConnectPtr conn ATTRIBUTE_UNUSED,
virDomainPtr dom,
virTypedParameterPtr params,
int nparams,
void *opaque ATTRIBUTE_UNUSED)
{
printf("%s EVENT: Domain %s(%d) tunable updated:\n",
__func__, virDomainGetName(dom), virDomainGetID(dom));
eventTypedParamsPrint(params, nparams);
return 0;
}
@ -778,6 +785,22 @@ myDomainEventMigrationIterationCallback(virConnectPtr conn ATTRIBUTE_UNUSED,
}
static int
myDomainEventJobCompletedCallback(virConnectPtr conn ATTRIBUTE_UNUSED,
virDomainPtr dom,
virTypedParameterPtr params,
int nparams,
void *opaque ATTRIBUTE_UNUSED)
{
printf("%s EVENT: Domain %s(%d) job completed:\n",
__func__, virDomainGetName(dom), virDomainGetID(dom));
eventTypedParamsPrint(params, nparams);
return 0;
}
static void
myFreeFunc(void *opaque)
{
@ -828,7 +851,7 @@ struct domainEventData domainEvents[] = {
DOMAIN_EVENT(VIR_DOMAIN_EVENT_ID_AGENT_LIFECYCLE, myDomainEventAgentLifecycleCallback),
DOMAIN_EVENT(VIR_DOMAIN_EVENT_ID_DEVICE_ADDED, myDomainEventDeviceAddedCallback),
DOMAIN_EVENT(VIR_DOMAIN_EVENT_ID_MIGRATION_ITERATION, myDomainEventMigrationIterationCallback),
/* VIR_DOMAIN_EVENT_ID_JOB_COMPLETED */
DOMAIN_EVENT(VIR_DOMAIN_EVENT_ID_JOB_COMPLETED, myDomainEventJobCompletedCallback),
/* VIR_DOMAIN_EVENT_ID_DEVICE_REMOVAL_FAILED */
};