This change may be confusing at first, but provides a much more
consistent naming scheme for the virObjectEvent children construction
functions.
---
src/conf/domain_event.c | 156 ++++++++++++++++++++++++------------------------
1 file changed, 78 insertions(+), 78 deletions(-)
diff --git a/src/conf/domain_event.c b/src/conf/domain_event.c
index 1c5dcd3..07c8100 100644
--- a/src/conf/domain_event.c
+++ b/src/conf/domain_event.c
@@ -755,11 +755,11 @@ static void *virObjectEventNew(virClassPtr klass,
return event;
}
-static void *virDomainEventNewInternal(virClassPtr klass,
- int eventID,
- int id,
- const char *name,
- const unsigned char *uuid)
+static void *virDomainEventNew(virClassPtr klass,
+ int eventID,
+ int id,
+ const char *name,
+ const unsigned char *uuid)
{
virDomainEventPtr event;
@@ -795,9 +795,9 @@ void *virDomainEventLifecycleNew(int id, const char *name,
if (virObjectEventInitialize() < 0)
return NULL;
- if (!(event = virDomainEventNewInternal(virDomainEventLifecycleClass,
- VIR_DOMAIN_EVENT_ID_LIFECYCLE,
- id, name, uuid)))
+ if (!(event = virDomainEventNew(virDomainEventLifecycleClass,
+ VIR_DOMAIN_EVENT_ID_LIFECYCLE,
+ id, name, uuid)))
return NULL;
event->type = type;
@@ -829,9 +829,9 @@ virDomainEventPtr virDomainEventRebootNew(int id, const char *name,
if (virObjectEventInitialize() < 0)
return NULL;
- return virDomainEventNewInternal(virDomainEventClass,
- VIR_DOMAIN_EVENT_ID_REBOOT,
- id, name, uuid);
+ return virDomainEventNew(virDomainEventClass,
+ VIR_DOMAIN_EVENT_ID_REBOOT,
+ id, name, uuid);
}
virDomainEventPtr virDomainEventRebootNewFromDom(virDomainPtr dom)
@@ -839,9 +839,9 @@ virDomainEventPtr virDomainEventRebootNewFromDom(virDomainPtr dom)
if (virObjectEventInitialize() < 0)
return NULL;
- return virDomainEventNewInternal(virDomainEventClass,
- VIR_DOMAIN_EVENT_ID_REBOOT,
- dom->id, dom->name, dom->uuid);
+ return virDomainEventNew(virDomainEventClass,
+ VIR_DOMAIN_EVENT_ID_REBOOT,
+ dom->id, dom->name, dom->uuid);
}
virDomainEventPtr virDomainEventRebootNewFromObj(virDomainObjPtr obj)
@@ -849,9 +849,9 @@ virDomainEventPtr virDomainEventRebootNewFromObj(virDomainObjPtr obj)
if (virObjectEventInitialize() < 0)
return NULL;
- return virDomainEventNewInternal(virDomainEventClass,
- VIR_DOMAIN_EVENT_ID_REBOOT,
- obj->def->id, obj->def->name,
obj->def->uuid);
+ return virDomainEventNew(virDomainEventClass,
+ VIR_DOMAIN_EVENT_ID_REBOOT,
+ obj->def->id, obj->def->name,
obj->def->uuid);
}
virDomainEventPtr virDomainEventRTCChangeNewFromDom(virDomainPtr dom,
@@ -862,9 +862,9 @@ virDomainEventPtr virDomainEventRTCChangeNewFromDom(virDomainPtr dom,
if (virObjectEventInitialize() < 0)
return NULL;
- if (!(ev = virDomainEventNewInternal(virDomainEventClass,
- VIR_DOMAIN_EVENT_ID_RTC_CHANGE,
- dom->id, dom->name, dom->uuid)))
+ if (!(ev = virDomainEventNew(virDomainEventClass,
+ VIR_DOMAIN_EVENT_ID_RTC_CHANGE,
+ dom->id, dom->name, dom->uuid)))
return NULL;
ev->data.rtcChange.offset = offset;
@@ -879,10 +879,10 @@ virDomainEventPtr virDomainEventRTCChangeNewFromObj(virDomainObjPtr
obj,
if (virObjectEventInitialize() < 0)
return NULL;
- if (!(ev = virDomainEventNewInternal(virDomainEventClass,
- VIR_DOMAIN_EVENT_ID_RTC_CHANGE,
- obj->def->id, obj->def->name,
- obj->def->uuid)))
+ if (!(ev = virDomainEventNew(virDomainEventClass,
+ VIR_DOMAIN_EVENT_ID_RTC_CHANGE,
+ obj->def->id, obj->def->name,
+ obj->def->uuid)))
return NULL;
ev->data.rtcChange.offset = offset;
@@ -898,9 +898,9 @@ virDomainEventPtr virDomainEventWatchdogNewFromDom(virDomainPtr dom,
if (virObjectEventInitialize() < 0)
return NULL;
- if (!(ev = virDomainEventNewInternal(virDomainEventClass,
- VIR_DOMAIN_EVENT_ID_WATCHDOG,
- dom->id, dom->name, dom->uuid)))
+ if (!(ev = virDomainEventNew(virDomainEventClass,
+ VIR_DOMAIN_EVENT_ID_WATCHDOG,
+ dom->id, dom->name, dom->uuid)))
return NULL;
ev->data.watchdog.action = action;
@@ -915,10 +915,10 @@ virDomainEventPtr virDomainEventWatchdogNewFromObj(virDomainObjPtr
obj,
if (virObjectEventInitialize() < 0)
return NULL;
- if (!(ev = virDomainEventNewInternal(virDomainEventClass,
- VIR_DOMAIN_EVENT_ID_WATCHDOG,
- obj->def->id, obj->def->name,
- obj->def->uuid)))
+ if (!(ev = virDomainEventNew(virDomainEventClass,
+ VIR_DOMAIN_EVENT_ID_WATCHDOG,
+ obj->def->id, obj->def->name,
+ obj->def->uuid)))
return NULL;
ev->data.watchdog.action = action;
@@ -938,8 +938,8 @@ static virDomainEventPtr virDomainEventIOErrorNewFromDomImpl(int
event,
if (virObjectEventInitialize() < 0)
return NULL;
- if (!(ev = virDomainEventNewInternal(virDomainEventClass, event,
- dom->id, dom->name, dom->uuid)))
+ if (!(ev = virDomainEventNew(virDomainEventClass, event,
+ dom->id, dom->name, dom->uuid)))
return NULL;
ev->data.ioError.action = action;
@@ -965,9 +965,9 @@ static virDomainEventPtr virDomainEventIOErrorNewFromObjImpl(int
event,
if (virObjectEventInitialize() < 0)
return NULL;
- if (!(ev = virDomainEventNewInternal(virDomainEventClass, event,
- obj->def->id, obj->def->name,
- obj->def->uuid)))
+ if (!(ev = virDomainEventNew(virDomainEventClass, event,
+ obj->def->id, obj->def->name,
+ obj->def->uuid)))
return NULL;
ev->data.ioError.action = action;
@@ -1036,9 +1036,9 @@ virDomainEventPtr virDomainEventGraphicsNewFromDom(virDomainPtr
dom,
if (virObjectEventInitialize() < 0)
return NULL;
- if (!(ev = virDomainEventNewInternal(virDomainEventClass,
- VIR_DOMAIN_EVENT_ID_GRAPHICS,
- dom->id, dom->name, dom->uuid)))
+ if (!(ev = virDomainEventNew(virDomainEventClass,
+ VIR_DOMAIN_EVENT_ID_GRAPHICS,
+ dom->id, dom->name, dom->uuid)))
return NULL;
ev->data.graphics.phase = phase;
@@ -1065,10 +1065,10 @@ virDomainEventPtr virDomainEventGraphicsNewFromObj(virDomainObjPtr
obj,
if (virObjectEventInitialize() < 0)
return NULL;
- if (!(ev = virDomainEventNewInternal(virDomainEventClass,
- VIR_DOMAIN_EVENT_ID_GRAPHICS,
- obj->def->id, obj->def->name,
- obj->def->uuid)))
+ if (!(ev = virDomainEventNew(virDomainEventClass,
+ VIR_DOMAIN_EVENT_ID_GRAPHICS,
+ obj->def->id, obj->def->name,
+ obj->def->uuid)))
return NULL;
ev->data.graphics.phase = phase;
@@ -1092,9 +1092,9 @@ virDomainEventBlockJobNew(int id, const char *name, unsigned char
*uuid,
if (virObjectEventInitialize() < 0)
return NULL;
- if (!(ev = virDomainEventNewInternal(virDomainEventClass,
- VIR_DOMAIN_EVENT_ID_BLOCK_JOB,
- id, name, uuid)))
+ if (!(ev = virDomainEventNew(virDomainEventClass,
+ VIR_DOMAIN_EVENT_ID_BLOCK_JOB,
+ id, name, uuid)))
return NULL;
if (VIR_STRDUP(ev->data.blockJob.path, path) < 0) {
@@ -1132,9 +1132,9 @@ virDomainEventPtr virDomainEventControlErrorNewFromDom(virDomainPtr
dom)
if (virObjectEventInitialize() < 0)
return NULL;
- if (!(ev = virDomainEventNewInternal(virDomainEventClass,
- VIR_DOMAIN_EVENT_ID_CONTROL_ERROR,
- dom->id, dom->name, dom->uuid)))
+ if (!(ev = virDomainEventNew(virDomainEventClass,
+ VIR_DOMAIN_EVENT_ID_CONTROL_ERROR,
+ dom->id, dom->name, dom->uuid)))
return NULL;
return ev;
}
@@ -1147,10 +1147,10 @@ virDomainEventPtr
virDomainEventControlErrorNewFromObj(virDomainObjPtr obj)
if (virObjectEventInitialize() < 0)
return NULL;
- if (!(ev = virDomainEventNewInternal(virDomainEventClass,
- VIR_DOMAIN_EVENT_ID_CONTROL_ERROR,
- obj->def->id, obj->def->name,
- obj->def->uuid)))
+ if (!(ev = virDomainEventNew(virDomainEventClass,
+ VIR_DOMAIN_EVENT_ID_CONTROL_ERROR,
+ obj->def->id, obj->def->name,
+ obj->def->uuid)))
return NULL;
return ev;
}
@@ -1167,9 +1167,9 @@ virDomainEventDiskChangeNew(int id, const char *name,
if (virObjectEventInitialize() < 0)
return NULL;
- if (!(ev = virDomainEventNewInternal(virDomainEventClass,
- VIR_DOMAIN_EVENT_ID_DISK_CHANGE,
- id, name, uuid)))
+ if (!(ev = virDomainEventNew(virDomainEventClass,
+ VIR_DOMAIN_EVENT_ID_DISK_CHANGE,
+ id, name, uuid)))
return NULL;
if (VIR_STRDUP(ev->data.diskChange.devAlias, devAlias) < 0)
@@ -1223,9 +1223,9 @@ virDomainEventTrayChangeNew(int id, const char *name,
if (virObjectEventInitialize() < 0)
return NULL;
- if (!(ev = virDomainEventNewInternal(virDomainEventClass,
- VIR_DOMAIN_EVENT_ID_TRAY_CHANGE,
- id, name, uuid)))
+ if (!(ev = virDomainEventNew(virDomainEventClass,
+ VIR_DOMAIN_EVENT_ID_TRAY_CHANGE,
+ id, name, uuid)))
return NULL;
if (VIR_STRDUP(ev->data.trayChange.devAlias, devAlias) < 0)
@@ -1268,9 +1268,9 @@ virDomainEventPMWakeupNew(int id, const char *name,
if (virObjectEventInitialize() < 0)
return NULL;
- if (!(ev = virDomainEventNewInternal(virDomainEventClass,
- VIR_DOMAIN_EVENT_ID_PMWAKEUP,
- id, name, uuid)))
+ if (!(ev = virDomainEventNew(virDomainEventClass,
+ VIR_DOMAIN_EVENT_ID_PMWAKEUP,
+ id, name, uuid)))
return NULL;
return ev;
@@ -1299,9 +1299,9 @@ virDomainEventPMSuspendNew(int id, const char *name,
if (virObjectEventInitialize() < 0)
return NULL;
- if (!(ev = virDomainEventNewInternal(virDomainEventClass,
- VIR_DOMAIN_EVENT_ID_PMSUSPEND,
- id, name, uuid)))
+ if (!(ev = virDomainEventNew(virDomainEventClass,
+ VIR_DOMAIN_EVENT_ID_PMSUSPEND,
+ id, name, uuid)))
return NULL;
return ev;
@@ -1330,9 +1330,9 @@ virDomainEventPMSuspendDiskNew(int id, const char *name,
if (virObjectEventInitialize() < 0)
return NULL;
- if (!(ev = virDomainEventNewInternal(virDomainEventClass,
- VIR_DOMAIN_EVENT_ID_PMSUSPEND_DISK,
- id, name, uuid)))
+ if (!(ev = virDomainEventNew(virDomainEventClass,
+ VIR_DOMAIN_EVENT_ID_PMSUSPEND_DISK,
+ id, name, uuid)))
return NULL;
return ev;
}
@@ -1359,9 +1359,9 @@ virDomainEventPtr virDomainEventBalloonChangeNewFromDom(virDomainPtr
dom,
if (virObjectEventInitialize() < 0)
return NULL;
- if (!(ev = virDomainEventNewInternal(virDomainEventClass,
- VIR_DOMAIN_EVENT_ID_BALLOON_CHANGE,
- dom->id, dom->name, dom->uuid)))
+ if (!(ev = virDomainEventNew(virDomainEventClass,
+ VIR_DOMAIN_EVENT_ID_BALLOON_CHANGE,
+ dom->id, dom->name, dom->uuid)))
return NULL;
ev->data.balloonChange.actual = actual;
@@ -1376,9 +1376,9 @@ virDomainEventPtr
virDomainEventBalloonChangeNewFromObj(virDomainObjPtr obj,
if (virObjectEventInitialize() < 0)
return NULL;
- if (!(ev = virDomainEventNewInternal(virDomainEventClass,
- VIR_DOMAIN_EVENT_ID_BALLOON_CHANGE,
- obj->def->id, obj->def->name,
obj->def->uuid)))
+ if (!(ev = virDomainEventNew(virDomainEventClass,
+ VIR_DOMAIN_EVENT_ID_BALLOON_CHANGE,
+ obj->def->id, obj->def->name,
obj->def->uuid)))
return NULL;
ev->data.balloonChange.actual = actual;
@@ -1397,9 +1397,9 @@ virDomainEventDeviceRemovedNew(int id,
if (virObjectEventInitialize() < 0)
return NULL;
- if (!(ev = virDomainEventNewInternal(virDomainEventClass,
- VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED,
- id, name, uuid)))
+ if (!(ev = virDomainEventNew(virDomainEventClass,
+ VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED,
+ id, name, uuid)))
return NULL;
if (VIR_STRDUP(ev->data.deviceRemoved.devAlias, devAlias) < 0)
@@ -1480,7 +1480,7 @@ virDomainEventDispatchDefaultFunc(virConnectPtr conn,
case VIR_DOMAIN_EVENT_ID_LIFECYCLE:
{
virDomainEventLifecyclePtr lifecycleEvent;
-
+
lifecycleEvent = (virDomainEventLifecyclePtr)event;
((virConnectDomainEventCallback)cb)(conn, dom,
lifecycleEvent->type,
--
1.8.4.2