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 | 154 ++++++++++++++++++++++++------------------------ 1 file changed, 77 insertions(+), 77 deletions(-) diff --git a/src/conf/domain_event.c b/src/conf/domain_event.c index c2b2210..23d4965 100644 --- a/src/conf/domain_event.c +++ b/src/conf/domain_event.c @@ -757,11 +757,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; @@ -797,9 +797,9 @@ virDomainEventPtr 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; @@ -831,9 +831,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) @@ -841,9 +841,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) @@ -851,9 +851,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, @@ -864,9 +864,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; @@ -881,10 +881,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; @@ -900,9 +900,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; @@ -917,10 +917,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; @@ -940,8 +940,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; @@ -967,9 +967,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; @@ -1038,9 +1038,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; @@ -1067,10 +1067,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; @@ -1094,9 +1094,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) { @@ -1134,9 +1134,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; } @@ -1149,10 +1149,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; } @@ -1169,9 +1169,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) @@ -1225,9 +1225,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) @@ -1270,9 +1270,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; @@ -1301,9 +1301,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; @@ -1332,9 +1332,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; } @@ -1361,9 +1361,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; @@ -1378,9 +1378,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; @@ -1399,9 +1399,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) -- 1.8.4.4 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list