Promote storage pool refresh lifecycle event to top level event

The VIR_STORAGE_POOL_EVENT_REFRESHED constant does not
reflect any change in the lifecycle of the storage pool.

It should thus not be part of the storage pool lifecycle
event set, but rather be a top level event in its own
right. Thus we introduce VIR_STORAGE_POOL_EVENT_ID_REFRESH
to replace it.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrange
2016-06-24 17:35:51 +01:00
parent 318ebb36f1
commit 0330848207
13 changed files with 232 additions and 32 deletions

View File

@@ -349,8 +349,6 @@ storagePoolEventToString(int event)
return "Started";
case VIR_STORAGE_POOL_EVENT_STOPPED:
return "Stopped";
case VIR_STORAGE_POOL_EVENT_REFRESHED:
return "Refreshed";
case VIR_STORAGE_POOL_EVENT_LAST:
break;
}
@@ -679,6 +677,17 @@ myStoragePoolEventCallback(virConnectPtr conn ATTRIBUTE_UNUSED,
}
static int
myStoragePoolEventRefreshCallback(virConnectPtr conn ATTRIBUTE_UNUSED,
virStoragePoolPtr pool,
void *opaque ATTRIBUTE_UNUSED)
{
printf("%s EVENT: Storage pool %s refresh\n", __func__,
virStoragePoolGetName(pool));
return 0;
}
static void
eventTypedParamsPrint(virTypedParameterPtr params,
int nparams)
@@ -936,6 +945,7 @@ struct storagePoolEventData {
struct storagePoolEventData storagePoolEvents[] = {
STORAGE_POOL_EVENT(VIR_STORAGE_POOL_EVENT_ID_LIFECYCLE, myStoragePoolEventCallback),
STORAGE_POOL_EVENT(VIR_STORAGE_POOL_EVENT_ID_REFRESH, myStoragePoolEventRefreshCallback),
};
/* make sure that the events are kept in sync */